GeoAlchemy2: Get the lat, lon of a point
问题 Consider the following SQLAalchemy / GeoAlchemy2 ORM with a geometry field: from geoalchemy2 import Geometry, WKTElement class Item(Base): __tablename__ = 'item' id = Column(Integer, primary_key=True) ... geom = Column(Geometry(geometry_type='POINTZ', srid=4326)) When I update an item in the PostgreSQL shell: UPDATE item SET geom = st_geomFromText('POINT(2 3 0)', 4326) WHERE id = 5; Fetching the field: items = session.query(Item).\ filter(Item.id == 3) for item in items: print item.geom Gives