简体   繁体   English

使用经度和纬度,最好的方法是识别一个列表中的哪些点最接近另一列表中的每个点

[英]Using longitude and latitude, best method for identifying which points from one list are the closest to each point on another list

I have a list which has the latitude and longitude of points on a map. 我有一个列表,其中包含地图上点的纬度和经度。 I want to identify census tracts whose center is ten miles away or more from all points in the list (basically identifying rural census tracts). 我想确定中心距列表中所有点十英里或更远的人口普查区(基本上是确定农村人口普查区)。 I also have a list of all census tracts and the latitude and longitude of their center. 我还列出了所有人口普查区域及其中心的经度和纬度。 How can I cross reference each census tract with each point in the list and identify the distance from their center to each point and create a list of census tracts who have no points within ten miles of their center? 如何将每个人口普查区与列表中的每个点交叉引用,并确定从其中心到每个点的距离,并创建一个在其中心十英里内没有点的人口普查区列表?

So, what you could do is simply create 2 lists, a list of all census tracts, and then a list of rural census tracts. 因此,您可以做的就是简单地创建2个列表,所有普查区的列表,然后是农村普查区的列表。 The rural list should start out empty, and then as you add tracts to it you will have to compare the new track against all the other tracts in the list to make sure the great circle distance is more than ten miles. 乡村列表应该从空开始,然后在您添加路段时,您必须将新轨道与列表中的所有其他路段进行比较,以确保大圆距超过十英里。 If so you add it to the list, and if not remove the entity from the rural list, and keep iterating through your list to compare the new tract against all the remaining tracts in your rural list to make sure no more tracts are also in range. 如果是这样,则将其添加到列表中,如果未将其从乡村列表中删除,则继续遍历列表以将新区域与乡村列表中的所有其余区域进行比较,以确保没有更多区域在范围内。 If so delete those rural tracts as well. 如果是这样,请删除那些农村地区。

The real challenge with this problem is the complexity of it. 这个问题的真正挑战是它的复杂性。 If you are dealing with a large amount of CTs, iterating through a growing list to compare against some new value is going to be very costly. 如果您要处理大量的CT,那么遍历不断增长的列表以与某些新值进行比较将非常昂贵。 There is likely a way to optimize this using a map and only comparing the new tract against other tracts in a ten mile square around it, but this would be more of a math problem I think than a software one. 可能有一种方法可以使用地图进行优化,并且仅将新区域与周围10平方英里内的其他区域进行比较,但是我认为这更多的是数学问题,而不是软件问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找到第5个最近点到点列表中每个点的距离 - Finding the distance of the 5th closest point to each of the points in a list of points 基于纬度/经度的点列表之间的距离 - Distance between list of points based on latitude/longitude 是否有更多的pythonic方法可以在列表中找到最接近另一个点的点? - Is there a more pythonic way to find the point in a list which is closest to another point? 如何从另一个 RGB 列表中找到一个 RGB 列表的最近像素点索引? - How to find the closest pixel points indexes of one RGB list from another RGB list? 在纬度/经度python列表中查找纬度和经度最接近的匹配项 - Finding closest match of Latitude & Longitude in a list of Lat/Longs python 如何有效地从一组不同的点到python中另一组的每个点找到最近的点 - How to eficiently find the closest point from a distinct set of points to each point of another set in python 如何将shapefile转换为纬度和经度点的完整列表 - How to convert a shapefile to a complete list of latitude and longitude points 在列表中查找彼此最近的点的索引 - Find the index of points closest to each other in a list 从点列表中获取两个最近的点 - Get the two closest points from a list of points 对于给定的点,如何在点列表中找到最近的点? - For a given point, how to find closest point in a list of points?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM