2

I am new to Geopandas and I want the min and max values of both latitude and longitude for a single record. The Geodataframe is structured as so (not sure it matters):

STATEFP   STATENS     GEOID   STUSPS   NAME   geometry
49         48           48      TX     Texas  (POLYGON ((-94.718296 29.728855, -94.717207 29... 
4

Individual POLYGONs in geometry column are shapely objects, so you can use .bounds method on this object to get a tuple of (minx, miny, maxx, maxy).

from shapely.geometry import Polygon
poly = Polygon([[1,2], [2,5], [4,6], [5,3], [1,2]])
poly.bounds
# out: (1.0, 2.0, 5.0, 6.0)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.