Skip to content

Using corners of the map to calculate the area of whole world does not return correct result #1074

@masterAllen

Description

@masterAllen

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

  • Output from: pyproj -v
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

  • pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions