iOS是否有离线地理编码框架,库或数据库? [英] Is there an offline geocoding framework, library, or database for iOS?

查看:138
本文介绍了iOS是否有离线地理编码框架,库或数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS是否有(离线)地理编码框架,库或数据库?从中获取数据的地方?

Is there an (offline) Geocoding framework, library or database for iOS? A place to get the data from?

我需要能够将全球(或至少在美国)城市的街道地址划分为经纬度和经度的日出和日落计算。

I need to be able to geocode street addresses in cities worldwide (or at least in the United States) into latitude and longitude for sunrise and sunset calculations.

信息必须采用适用于iPhone OS的格式。 (数据库文件或用C / Objective-C编写)

The information must be in a format that will work on iPhone OS. (Either a database file or written in C/Objective-C)

推荐答案

我建议:


  • 从Open Street Maps获取数据,许可证只是暗示您提及来源。某些国家/地区有一些OSM摘录,我不知道是否已经为某些城市制作了一些,但我认为这可以在您身边实现。


例如,您可以从 http://www.openstreetmap.org <下载数据/ a>,只需单击导出选项卡,选择打开街道地图XML数据格式,然后导出数据:您将获得所选边界框的OSM数据。
可以从cloudmade下载更多数据:
http://downloads.cloudmade.com/


  • 然后将此数据导入sqlite数据库。然后从这个带有地理信息的sqlite DB创建一个空间索引:这样的事情可以使用 spatialite 来实现(spatialite是一个非常好的GIS扩展到Sqlite)

  • Then import this data into a sqlite DB . Then create a spatial index from this sqlite DB with geographic info in it : such thing can be achieved using spatialite ( spatialite is a very good GIS extension to Sqlite)

Spatialite提供了一个GUI工具,用于从各种数据源格式创建空间数据库。该工具可以从这里下载为二进制文件: http://www.gaia-gis。 it / spatialite-2.4.0-4 / binaries.html (spatialite_gui)我正在链接到2.4.0 beta,因为那是最能支持.osm文件的那个。

Spatialite provides a GUI tool to create a spatial database from various data source formats. The tool can be downloaded as binary from here : http://www.gaia-gis.it/spatialite-2.4.0-4/binaries.html (spatialite_gui) I'm linking to the 2.4.0 beta because that's the one that best supports .osm files.

另一个好的资源是QGis可视化OSM数据/创建spaceite DB。它是免费/开源的,非常成熟:
http://www.qgis.org/

Another good ressource is QGis to visualiaze OSM data / create spatialite DB. It's free / open source and very mature: http://www.qgis.org/


  • 一旦完成此操作,您将能够实现基本地理编码器,因为spatialite实现了诸如给我最近的GPS坐标线等功能(基本GIS功能)。

这些是非常粗略的线条。如果你对这种方法感兴趣,我可以进一步深入细节:我已经实现了这一点。我知道如何为iOS编译spatialite(这需要一些时间......)以及如何导入OSM数据并为其创建空间索引。

These are the very rough lines. I can go in much more deeper details if you're interested in such approach : I've achieved this on my side. I know how to compile spatialite for iOS (this took me some time....) and also how to import OSM data and create spatial indexes for it.

这篇关于iOS是否有离线地理编码框架,库或数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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