Open jonathan-geoseer opened 2 months ago
This is calculated using geod_polygonarea. This code originated from: https://geographiclib.sourceforge.io/. It is likely that your request would be best handled upstream.
I don't believe any of the answers on there work any more
What issues are you seeing?
What issues are you seeing?
Five of the answers use a combination of shapely.ops.transform
, pyproj.transform
, and partial
- This is what I used to use, but upon upgrading the shapely version to 2.x, I was getting a lot of errors and the results were wrong. I assume something was deprecated, I forget the details.
Other option is geod = Geod(ellps="WGS84")
- which doesn't work on 50% of shapes (see bug ticket this suggestion comes from).
https://pypi.org/project/area/
- this is what I'm now using.
upon upgrading the shapely version to 2.x, I was getting a lot of errors and the results were wrong
This upgrade guide should resolve your issues: https://shapely.readthedocs.io/en/stable/manual.html#shapely.ops.transform
geometry_area_perimeter
has limitations that means it cannot calculate the area of many polygons: https://pyproj4.github.io/pyproj/stable/api/geod.html#pyproj.Geod.geometry_area_perimeterSuggestion: A method/function/class that allows calculation of the area of a polygon anywhere on the earth's surface (in m^2). Should scale up to global-coverage sized polygons.
This is a fairly commonly sought use-case: https://gis.stackexchange.com/questions/127607/calculating-area-in-km%C2%B2-for-polygon-in-wkt-using-python - I don't believe any of the answers on there work any more, so maybe this should be a bug (regression), rather than a feature request?