在移动设备上进行离线反向地理编码的技术? [英] Techniques for offline reverse geocoding on a mobile device?
问题描述
我正在研究移动地图应用程序(目前是iOS,最终是Android) - 我正在努力解决如何在不使用在线服务的情况下最好地支持从纬度/长度到国家/州的反向地理编码。
I am working on a mobile mapping application (currently iOS, eventually Android) - and I am struggling with how to best support reverse geocoding from lat/long to Country/State without using an online service.
Apple的反向地理编码API依赖于Google作为后端,并且在连接时运行良好。我也可以使用Open Street Maps项目或任意数量的其他Web服务来实现类似的功能。
Apple's reverse geocoding API depends on Google as the backend, and works great while connected. I could achieve similar functionality using the Open Street Maps project too, or any number of other web services.
我真正想要的是创建一个C库,我可以甚至在我的应用程序中离线时调用,传入GPS坐标,并让它返回那些坐标处的国家和/或州。我不需要比状态级更细的粒度,因此数据集不是很大。
What I really want however is to create a C library that I can call even when offline from within my application, passing in the GPS coordinates, and having it return the country and/or state at those coordinates. I do not need finer granularity than state-level, so the dataset is not huge.
我已经看到了如何在服务器上执行此操作的示例,但从来没有适用于移动设备。
I've seen examples of how to do this on a server, but never anything appropriate for a mobile device.
我听说 Spatialite 可能是一个解决方案,但我不知道如何让它在iOS上运行,我想知道这个问题是否有点过分。
I've heard Spatialite might be a solution, but I am not sure how to get it working on iOS, and I wonder if it may be overkill for the problem.
有哪些推荐技巧可以实现这一目标?
What are some recommended techniques to accomplish this?
推荐答案
Radven
您需要获取所有管理实体(美国各州,国家等)的Shapefile(lat / lng大纲)。这些有很多公共领域的资源。例如,NOAA具有可以下载的美国州和地区的shapefile:
You will need to get the Shapefiles (lat/lng outline) of all the administrative entities (US states, countries, etc). There are a lot of public domain sources for these. For example, the NOAA has shapefiles for US states and territories you can download:
http://www.nws.noaa.gov/geodata/catalog/national/html/us_state.htm
获得shapefile后,可以使用shapefile阅读器测试lat / lng是否在形状内。 C中有开源阅读器,只是google。我在sourceforge上看到了shapefile的内容,但是我自己没有使用它们。
Once you got the shapefiles, you can use a shapefile reader to test if a lat/lng is within a shape. There are open source readers in C, just google. I seen stuff at sourceforge for shapefiles, but have not used these myself.
OpenGeoCode.Org团队
The Team at OpenGeoCode.Org
这篇关于在移动设备上进行离线反向地理编码的技术?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!