Understanding the output of `areaPolygon()` from package geosphere

前端 未结 1 687
难免孤独
难免孤独 2021-01-14 12:40

From this Question I obtained the great function areaPolygon() which gives me the area within a polygon of coordinates. however, when I experiment with the func

相关标签:
1条回答
  • 2021-01-14 13:20

    You've made an invalid polygon! If you plot it with type="l" you'll see a bow-tie:

    > plot(polygon,type="l")
    

    Half the bow-tie will have a negative area, the other half positive, so your result is the difference in the sizes of the halves. They won't be exactly the same because of the earth being spherical...

    You just need to reorder your points in polygon.

    0 讨论(0)
提交回复
热议问题