[gdal-dev] Vector area calculation

Even Rouault even.rouault at spatialys.com
Fri Jan 10 08:52:56 PST 2025


Hi,

I suspect you are running into 
https://gdal.org/en/stable/tutorials/osr_api_tut.html#crs-and-axis-order

Concretely try adding:

source_srs.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER)

at line 34.

Even


Le 10/01/2025 à 17:49, ky via gdal-dev a écrit :
> Hello all, hope you are well
>
> Got some unexpected results computing area using GDAL==3.4.1 and 
> official Brazilian projection, where results are about half of what is 
> reported as correct. Does anyone knows what is causing it ?
>
> Just to compare shapely/geopandas yields correct results using same 
> projections.
>
> code can be found on this gist: 
> https://gist.github.com/rupestre-campos/a82a1403cb47a8153f07c775d7902f50
>
> the linked scrip outputs
> Area ha farm: 6.0
> Area ha calculated (gdal): 3.23
> Area ha calculated (geopandas): 6.0
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250110/192ce70c/attachment.htm>


More information about the gdal-dev mailing list