Link to home
Start Free TrialLog in
Avatar of tech
tech

asked on

How to convert geometry into latitude and longitude coordinates?

I have a column which contains geometry values (maps) like 01030009777700000000BCA142E2ABD08A2C0CA9466D8B4B4CC. I wanted to convert it into latitude and longitude coordinates. I tried using geopandas but didn't click for me. Any help is appreciated.
Avatar of noci
noci

What kind of encoding is it....    there must be some description.
Avatar of tech

ASKER

These are the hex values, very long sized characters and numbers. (they are polygons or lines)
Avatar of tech

ASKER

values are stored in postgresdatabase which i downloaded as csv and then i am  trying using postgis. (ST_AsText which Returns the Well-Known Text (WKT) representation of the geometry/geography)
Best starting point will be to have one of your strings along with the related lat/long values.

This will tell you how to decode the string.

Without this correlation/relation as a string point, tough to guess about what your string might represent.
Avatar of tech

ASKER

length of the strings vary as few are 50 characters long,  others are 20 long. they are polygons and lines. I tried

SELECT ST_AsText('01030000000100000005000000000000000000
0000000000000000000AB7600000000000000000000000
F03F000000000000F03F000000000000F03F000000000000F03
F0000000078540000000HFT000');

Open in new window


which converts it into

POLYGON((0 0,0 1,1 1,1 0,0 0))

not sure how to extract lat/long values from this.
There must be more data that is correlated. A Polygon is a geometric shape, with multiple corners.   (0,0)->(0,1)->(1,1)->(1,0)->(0,0).. which draws a closed square with size 1.
it doesn't tell where the square should be on the map.
Avatar of tech

ASKER

Data represents field maps of an agricultural field, represents fields, zones in a farm.
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tech

ASKER

Thanks noci. I got it solved using shapely python library.