Is there an offline geocoding framework, library, or database for iOS?

后端 未结 6 1044
情歌与酒
情歌与酒 2020-12-12 18:14

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 worldwi

相关标签:
6条回答
  • 2020-12-12 18:56

    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.

    0 讨论(0)
  • 2020-12-12 19:05

    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.

    0 讨论(0)
  • 2020-12-12 19:05

    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

    0 讨论(0)
  • 2020-12-12 19:15

    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

    0 讨论(0)
  • 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 ;)

    0 讨论(0)
  • 2020-12-12 19:18

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

    You might have to do some extra work.

    0 讨论(0)
提交回复
热议问题