How to calculate the area of a polygon on the earth's surface using python?

前端 未结 9 524
生来不讨喜
生来不讨喜 2020-11-29 19:09

The title basically says it all. I need to calculate the area inside a polygon on the Earth\'s surface using Python. Calculating area enclosed by arbitrary polygon on Earth&

9条回答
  •  醉话见心
    2020-11-29 19:50

    Because the earth is a closed surface a closed polygon drawn on its surface creates TWO polygonal areas. You also need to define which one is inside and which is outside!

    Most times people will be dealing with small polygons, and so it's 'obvious' but once you have things the size of oceans or continents, you better make sure you get this the right way round.

    Also, remember that lines can go from (-179,0) to (+179,0) in two different ways. One is very much longer than the other. Again, mostly you'll make the assumption that this is a line that goes from (-179,0) to (-180,0) which is (+180,0) and then to (+179,0), but one day... it won't.

    Treating lat-long like a simple (x,y) coordinate system, or even neglecting the fact that any coordinate projection is going to have distortions and breaks, can make you fail big-time on spheres.

提交回复
热议问题