How to calculate geo-distance from a polygon?

蓝咒 提交于 2019-12-03 21:46:50

I'd project the data to a euclidean (or near euclidean) coordinate system - unless you are spanning a large chunk of the globe then this is feasible. Use spTransform from maptools or sp or rgdal (I forget which) and convert to a UTM zone near your data.

You also might do better with package rgeos and the gDistance function:

 gDistance by default returns the cartesian minimum distance
 between the two geometries in the units of the current projection.

If your data is over a large chunk of globe then... tricky... 42...

Barry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!