Can't transform geometry to geojson
问题 My problem is this. I'm creating a model for some data. class Cables(Base): __tablename__ = 'cables' id = Column(Integer, nullable=False) route = Column(Geometry(geometry_type='LINESTRING', srid=4326), nullable=False) Now, I want to transform such a route to GeoJSON. Things I've tried @app.route("/api/cable/<int:id>", methods=['GET']) def get_cable(id): cable = session.query(Cables).filter(Cables.id == id).first() return str(geoalchemy2.functions.ST_AsGeoJSON(cable.route)) returns ST