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

2020-09-18 Thread Alan Snow
EPSG 9835 is an conversion method which needs some parameters defined: https://pyproj4.github.io/pyproj/stable/api/crs/coordinate_operation.html#lambertcylindricalequalareaconversion You can use that conversion to build a projected CRS: https://pyproj4.github.io/pyproj/stable/build_crs.html#projec

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

2020-09-18 Thread Mikhail Kruk
Yes, you are correct, that was one of my first attempts and was wrong because I don't really understand these projection systems. I now have a better one which sort of works and produces areas in meters by setting first system to sr.SetWellKnownGeogCS("EPSG:4326") Now I am struggling with selecting

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

2020-09-18 Thread Michael Patrick
> > ... 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

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

2020-09-18 Thread Javier Jimenez Shaw
The documentation of AssignSpatialReference says: "Any existing spatial reference is replaced, but under no circumstances does this result in the object being reprojected. It is just changing the interpretation of the existing geometry." You have to reproject the polygon coordinates to actually h

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

2020-09-17 Thread Mikhail Kruk
Hi! 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: https://gis.stackexchange.com/questions/374428/default-geo-spatial-reference-system-in-gd