简体   繁体   English

如何计算地理位置和边界之间的距离?

[英]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.

相关问题 如何计算R中沿线的两个点之间的地理距离? - How to calculate geographic distance between two points along a line in R? 如何计算R中所有国家和美国之间的地理和语言距离 - How to calculate the geographic and language distance between all countries and the USA in R 2 个经纬度点列表(坐标)之间的地理/地理空间距离 - Geographic / geospatial distance between 2 lists of lat/lon points (coordinates) 如何计算带有正负坐标的R中的点之间的距离 - How to calculate distance between points in R with negative and positive coordinate R-如何计算两组坐标点之间的距离? - R - How to calculate distance between two sets of coordinate points? 如何计算数据框中两个连续点之间的距离和角度? - How to calculate distance and angle between two consecutive points in data frame? 如何计算连续日期时间的 GPS 点之间的距离? - How to calculate distance between GPS points of consecutive Datetime? 如何使用R计算点与参考点之间的距离? - How to Calculate Distance between points from a reference point using R? 如何在 R Studio 中计算点与固定位置之间的距离 - How to calculate the distance between points and a fixed location in R Studio 如何使用 leaflet、geosphere 和 R shiny 计算 2 点之间的距离 - How to calculate distance between 2 points with leaflet, geosphere, and R shiny
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM