Code Sample, a copy-pastable example if possible
from pyproj import Geod
from shapely.ops import transform, orient
from shapely.geometry import Point, Polygon
data = [
(89.9999, 179.9999),
(89.9999, -179.9999),
(-89.9999, -179.9999),
(-89.9999, 179.9999),
]
world_poly = Polygon(orient([(y, x) for (x, y) in data]))
geod = Geod(ellps="WGS84")
area = abs(geod.geometry_area_perimeter(world_poly)[0])
print(area)
Problem description
I want to calculate the area of whole world, so i use polygon with four points which are corners of the map. But the result is 283369789.8556872 which is very small.
Expected Output
The area of whole world
Environment Information
pyproj info:
pyproj: 3.0.1
PROJ: 8.0.1
data dir: /usr/share/proj
user_data_dir: /home/allen/.local/share/proj
System:
python: 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0]
executable: /usr/bin/python
machine: Linux-5.17.4-arch1-1-x86_64-with-glibc2.35
Python deps:
pip: 21.0
setuptools: 59.5.0
Cython: 0.29.28
Installation method