[英]How to calculate distance between geographic points and boundaries?
I have around 50,000 geocoded properties and need to find the distance between the properties, formatted as spatial points, to the nearest school zone boundary which is formatted as a spatial polyogon. 我有大约50,000个经过地理编码的属性,需要找到属性之间的距离(格式为空间点)到最近的学区边界(格式为空间多边形)。 I'm able to associate and map the points and polygons together, and I've joined the school zone attributes to the properties that are located in the specific school zone with QGIS, but I need the distance.
我可以将点和多边形关联在一起并映射在一起,并且我已将学区属性与使用QGIS的特定学区中的属性结合在一起,但是我需要距离。 Ideally I'd like to do this in QGIS or R, but I'm open to anything else that could do it.
理想情况下,我想在QGIS或R中做到这一点,但我愿意接受任何其他可以做到的事情。
Consider gDistance()
from rgeos
package. 考虑
rgeos
软件包中的gDistance()
。 It works for point to polygon distances. 它适用于点到多边形的距离。
Edit (on 2018-10-22): 编辑(2018-10-22):
This answer was built on understanding of workflow of the sp
package, in workflow built on the highly recommended sf
package please consider sf::st_distance()
instead. 该答案是基于对
sp
程序包的工作流的理解而建立的,在强烈建议使用sf
程序包构建的工作流中,请sf::st_distance()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.