I am using Python with SQLAlchemy (and GeoAlchemy in my particular case), and I have a query that results in a single column of row objects. I wish to extract particular values from these row objects, but SQLAlchemy interprets the row object as a single entity (and returns them as strings, if I am correct). How can I get these individual values back more cleanly without parsing them in Python?
My real life use case:
The PostGIS extension of PostgreSQL provides a function called ST_IsValidDetail
. This function is designed to return a valid_detail
row, which consists of boolean valid
, a string reason
, and a geometry location
where the invalidity occurs. I have left off the PostGIS tag since I feel this question is more general than that. My query is something like SELECT ST_IsValidDetail('POINT(1 1)'::GEOMETRY);
(with a more complicated geometry, of course).