How to get lng lat value from query results of geoalchemy2

后端 未结 2 1677
日久生厌
日久生厌 2021-02-19 00:45

For exammple,

class Lake(Base):
     __tablename__ = \'lake\'
     id = Column(Integer, primary_key=True)
     name = Column(String)
     geom = Column(Geometry         


        
2条回答
  •  一生所求
    2021-02-19 01:05

    http://geoalchemy-2.readthedocs.org/en/0.2.4/spatial_functions.html#geoalchemy2.functions.ST_AsText is what you are looking for. This will return 'POINT (lng, lat)'. ST_X ought to work, though, so you may have another issue if it isn't returning the correct value.

提交回复
热议问题