[gdal-dev] proper way to get area of a lon/lat polygon
meshko at gmail.com
Thu Sep 17 21:49:06 PDT 2020
I am a complete GIS newbie so please bear with me...
I am trying to get the area of a polygon specified in lon,lat pairs in some
reasonable units, like sq kilometers. My quest so far is documented here:
but basically I came to the conclusion that when people talk about an area
of something on Earth they really mean the area of a projection (am i right
about that?) and so i need to specify a projection before getting a
meaningful area. So i ended up with this code:
wkt = "POLYGON ((lon1 lat1, lon2 lat2, lon3 lat3))"
poly = ogr.CreateGeometryFromWkt(wkt)
sr = osr.SpatialReference()
and yet I get back a value which seems to be calculated in square degrees.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev