[gdal-dev] proper way to get area of a lon/lat polygon

Michael Patrick geodesy99 at gmail.com
Fri Sep 18 18:50:19 PDT 2020

> ... 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()
> sr.SetWellKnownGeogCS("NAD83")
> poly.AssignSpatialReference(sr)
> poly.GetArea() <https://lists.osgeo.org/mailman/listinfo/gdal-dev>
> I might be dense, but it seems you are assigning sr as a specific
transverse mercator, i.e.  UTM zone 18N, or a custom one centered on the
centroid of your polygon. i.e. you don't have sufficient arguments.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200918/e3799e25/attachment.html>

More information about the gdal-dev mailing list