0

When calculating the area for a polygon, the result using shapely/pyproj is drastically different when compared to google earth engine or geojson.io. I figured this has something to do with projection and when looking into it, I found examples such as (How do I get the area of a GeoJSON polygon with Python) which suggest Alders Equal Area projections but those don't seem to be an option in version 2.1.3 of PyProj. I'm also wondering if google earth engine and geojson.io have an automated way of selecting region appropriate area projections given the region of the polygon but I'm not sure how they'd go about selecting those.

For example:

coords = [(-97.59238135821987, 43.47456565304017),
 (-97.59244690469288, 43.47962399877412),
 (-97.59191951546768, 43.47962728271748),
 (-97.59185396090983, 43.47456565304017),
 (-97.59238135821987, 43.47456565304017)]

projection = partial(pyproj.transform, pyproj.Proj(init='epsg:4326'), pyproj.Proj(init='epsg:3857'))
shapely.ops.transform(projection, shapely.geometry.Polygon(sample_coords)).area

returns an area of 45573.993884405005 m^2.

Google Earth Engine returns 23944.14737277293 and Geojson.io returns 23997.77

Brenton
  • 85
  • 1
  • 8

1 Answers1

1

I found out the issue and made a corresponding github issue with shapely https://github.com/Toblerity/Shapely/issues/726

In short, shapely is using a different method whose origin isn't clear and the others are using a method described from a JPL paper.

Brenton
  • 85
  • 1
  • 8