是否有适用于 iOS 的离线地理编码框架、库或数据库?

发布于 2024-10-06 08:46:04 字数 161 浏览 1 评论 0原文

是否有适用于 iOS 的(离线)地理编码框架、库或数据库?从哪里获取数据?

我需要能够将世界各地(或至少在美国)城市的街道地址地理编码为纬度和经度,以便计算日出和日落。

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

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.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

貪欢 2024-10-13 08:46:05

我的建议是:

  • 从开放街道地图获取数据,许可证仅意味着您提及来源。有一些针对某些国家/地区的 OSM 摘录,我不知道是否已经为某些城市制作了一些,但我认为这可以在您这边实现。

[编辑]
例如,您可以从 http://www.openstreetmap.org 下载数据,只需单击导出选项卡,选择 Open Street映射 XML 数据格式,然后导出数据:您将获得所选边界框的 OSM 数据。
可以从 cloudmade 下载更多数据: http://downloads.cloudmade.com/

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

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

另一个很好的资源是 QGis,用于可视化 OSM 数据/创建空间数据库。它是免费/开源的并且非常成熟:
http://www.qgis.org/

  • 完成此操作后,您将能够实现基本的地理编码器,因为 Spatialite实现诸如“给我距离该 GPS 坐标最近的线路”等功能(基本 GIS 功能)。

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

What I would recommend :

  • Get the data from Open Street Maps, the license just implies that you mention the source. There are some OSM extracts for some countries, I don't know if there are some already made for some cities, but this can be achieved on your side I think.

[EDIT]
As an example, you can download data from http://www.openstreetmap.org , just click on the export tab, choose the Open Street Map XML Data format, and then export data: you'll get the OSM data for the chosen bounding box.
Some more data can be downloaded from cloudmade : http://downloads.cloudmade.com/

  • 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)

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

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

  • once you've done this, you'll be able to implement a basic geocoder because spatialite implements functions such as "give me the nearest line to this GPS coord" (basic GIS feature).

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.

一场春暖 2024-10-13 08:46:05

我不知道如何做你想做的事情,但这里有一些框架:

http://code.google.com/apis/maps/documentation/geocoding/(在线)
http://www.gisgraphy.com/(我认为它处于离线状态)

此链接也可能对您有帮助:

如何将地址转换为纬度/经度?

希望这有帮助:)

编辑:

这也可能对您有所帮助:) http://www.geonames.org/export/ geonames.org/export/

在搜索答案时,我发现有些人声称这是资源密集型的,我认为他们可能是对的:)所以在创建应用程序时请考虑这一点;)

I am not sure how to do the thing you want to do, but here is some frameworks:

http://code.google.com/apis/maps/documentation/geocoding/ (online)
http://www.gisgraphy.com/ (i think it is offline)

this link may also help you:

How to convert an address to a latitude/longitude?

Hope this helped :)

EDIT:

This may also help you on the way :) http://www.geonames.org/export/

while searching for the answer i found out that some people claim that this is resource intensive, and i think they may be right :) so consider that when you are creating your application ;)

吃→可爱长大的 2024-10-13 08:46:05

我认为没有可用的现有框架。但是,您可能比联系此骗局的作者更糟糕:无需 Web 访问的反向地理编码

I don't think there is an existing framework available. However you could do worse than contacting the author of this dupe: Reverse Geocoding Without Web Access

携余温的黄昏 2024-10-13 08:46:05

这个答案可能会有所帮助:
如何将地址转换为纬度/经度?

您可能需要做一些额外的工作。

This answer could be of help:
How to convert an address to a latitude/longitude?

You might have to do some extra work.

孤千羽 2024-10-13 08:46:05

世界(或美国)每个地方的所有地址...这需要大量空间,超出了普通 iOS 设备的处理能力。所以,绝对不是离线版本。

但是,您可以简单地使用 Open Street Maps,它可以帮助您获取一些数据,将其存储在某种缓存中(例如,仅存储 5 英里半径内的所有内容),并在您离开该区域时刷新此缓存。

All addresses of every single place in the world (or the US)... That takes a lot of space, more than the average iOS device can handle. So, definitely not an offline version.

However, you can simply use Open Street Maps which can help you get some data, store this in some kind of cache (store only everything in a 5 miles radius, for example) and refresh this cache when you leave the area.

美羊羊 2024-10-13 08:46:05

如果开发人员正在寻找 OpenStreetMaps 路径的教程,我强烈推荐本教程:

http://shikii.net/blog/offline-maps-in-ios-using-openstreetmap-and-route-me/

这是一个简单的教程,可帮助您入门Open Street Maps,它使用 Route-me github 存储库。以下是 github 上的示例应用程序:

https://github.com/Label305/iOS-OfflineMaps-Example

希望这有帮助

In case developers are searching for a tutorial for the OpenStreetMaps path, I strongly recommend this tutorial:

http://shikii.net/blog/offline-maps-in-ios-using-openstreetmap-and-route-me/

It's a simple tutorial to get you started with the Open Street Maps, which uses the Route-me github repository. Here is an example application on github:

https://github.com/Label305/iOS-OfflineMaps-Example

Hope this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文