I have a column of data type geography in a Postgres table.
When I query it from DB it shows like this,
Now I'm trying to query the table with psycopg2 but instead of the points (lat, long), I'm getting some huge string.
What is this pattern and How I can cast it to get latitudes and longitudes?
I have tried searching over the internet but unluckily no help found.
CodePudding user response:
You can get the text representation with the dt_astext
function, or you can type cast to geometry
and use the st_y
and st_y
functions.