Basically, I want to know how many times a 0.25°lat x 0.25°lon patch is fitting in various polygons located around the world. The latter have sizes around 3°lat x 10°lon or 2°lat x 4°lon.
I have the lat/lon values of the corners of the polygons and I am calculating their area like this:
from pyproj import Proj
from shapely.geometry import shape
def getArea(coords):
c = {"type": "Polygon",
"coordinates": [[ (coords[0], coords[2]), (coords[1], coords[2]),
(coords[0], coords[3]), (coords[1], coords[3]) ]]}
lon, lat = zip(*c['coordinates'][0])
pro = Proj("+proj=aea")
x, y = pro(lon, lat)
poly = {"type": "Polygon", "coordinates": [zip(x, y)]}
return shape(cop).area
I took the approach from here: How to calculate the area of a polygon on the earth's surface using python?
Now the question is, which equal area projection shall I choose in order to have comparable area sizes for the polygons. The area of the small patch is always the same, regardless of where it is located on the globe in such a projection.
Taking the Albers Equal Area Projection (aea) results in these areas of three polygons:
- 240993868.90978813
- 699931593.1047173
- 212092562.5238676
Taking the Lambert Azimuthal Equal Area Projection (laea) results in these areas of the same polygons:
- 148709452.69292444
- 409253749.5468254
- 106218747.36092758
Why is the relation between the areas in the two projections different? First 1:3 = 0.344; Second 1:3 = 0.363; They should be the same since both are equal area projections?!
That makes me wonder whether it is legitimate to compare the small patch to the areas of the polygons in either projection. Do you have any advice?