How to retrieve data from geoalchemy2 Query result?

33 views
Skip to first unread message

as...@chikpea.com

unread,
Feb 5, 2016, 1:26:49 AM2/5/16
to GeoAlchemy
Code snippet:

from dbinit import session
from geoalchemy2 import Geometry, func
result = session.query(func.ST_AsText('POINT(100 100)'))
How to retrieve the data from this result object?

Brian Clark

unread,
Jun 2, 2016, 5:44:35 AM6/2/16
to GeoAlchemy
I believe result = session.query(func.ST_AsText('POINT(100 100)')).all()

Should return the results for you and then you can loop through them

result = session.query(func.ST_AsText('POINT(100 100)')).first()

That would return a single result
Reply all
Reply to author
Forward
0 new messages