无需 Web 访问的反向地理编码 [英] Reverse Geocoding Without Web Access

查看:40
本文介绍了无需 Web 访问的反向地理编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,其中一个要求是我能够基于 GPS 数据执行实时反向地理编码操作.特别是,我必须能够确定纬度、经度对映射到的州/省,并检测我们何时从一个州/省移动到另一个州/省.

I am working on an application where one of the requirements is that I be able to perform realtime reverse geocoding operations based on GPS data. In particular, I must be able to determine the state/province to which a latitude, longitude pair maps and detect when we have moved from one state/province to another.

到目前为止,我有几个想法,但想知道是否有人对以下任何一个有任何想法:

I have a couple ideas so far but wondered if anyone had any ideas on either of the following:

  • 以有效方式解决此问题的最佳方法是什么?
  • 哪里是查找的好地方以及北美州/省边界的合适格式是什么

首先,我有两个主要想法:

As a starter, here are the two main ideas I have:

  1. 将北美划分为一个网格,网格中的每个矩形都映射到特定的州省.根据纬度和经度(反之亦然)查找此表(您希望越精确,该表增长得越快).
  2. 为每个州定义多边形并进行某种计算以确定纬度/经度对位于哪个多边形中.我不确定该怎么做.HTML 图像地图是定义州/省边界的一种方式.

我正在为感兴趣的人或那些可能有他们想要建议的好库的人工作.

I am working in python for the interested or those that might have a nice library they would like to suggest.

明确一点...我没有可用的网络访问权限,因此在运行时不能使用现有的反向地理编码服务

推荐答案

我建议使用你第一个想法的变体:使用 空间索引.空间索引是从矩形构建的数据结构,将纬度/经度映射到有效负载.在这种情况下,您可能会将矩形映射到州-省对.R-tree 可能是一个不错的选择.这是一个 R-tree python 包.您可以通过比较连续搜索的结果来检测漫游.

I suggest using a variant of your first idea: Use a spatial index. A spatial index is a data structure built from rectangles, mapping lat/long to the payload. In this case you will probably map rectangles to state-province pairs. An R-tree may be a good option. Here's an R-tree python package. You could detect roaming by comparing the results of consecutive searches.

这篇关于无需 Web 访问的反向地理编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆