例如,
class Lake(Base):
__tablename__ = 'lake'
id = Column(Integer, primary_key=True)
name = Column(String)
geom = Column(Geometry('POLYGON'))
point = Column(Geometry('Point'))
lake = Lake(name='Orta', geom='POLYGON((3 0,6 0,6 3,3 3,3 0))', point="POINT(2 9)")
query = session.query(Lake).filter(Lake.geom.ST_Contains('POINT(4 1)'))
for lake in query:
print lake.point
它回来了<WKBElement at 0x2720ed0; '010100000000000000000000400000000000002240'>
我也尝试过lake.point.ST_X()但它也没有给出预期的纬度
将值从 WKBElement 转换为可读且有用的格式(例如(lng,lat))的正确方法是什么?
谢谢