Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an offline geocoding framework, library, or database for 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.

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

like image 603
Moshe Avatar asked Dec 07 '10 05:12

Moshe


People also ask

Is there any free geocoding API?

positionstack - Free Address Geocoding & Maps API.

What is the difference between geocoding and reverse geocoding?

Geocoding is the process of transforming a street address or other description of a location into a (latitude, longitude) coordinate. Reverse geocoding is the process of transforming a (latitude, longitude) coordinate into a (partial) address.

Is reverse geocoding API free?

Yes, the Geoapify Reverse Geocoding Tool is Free! You can upload and process multiple locations. No coding and registration required. You can also use Geoapify Reverse Geocoding API and process up to 3000 addresses per day for FREE.


1 Answers

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.

like image 144
yonel Avatar answered Nov 15 '22 19:11

yonel