4

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'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.

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've seen examples of how to do this on a server, but never anything appropriate for a mobile device.

What are some techniques to accomplish this?

3

I've answered to that kind of question there: https://stackoverflow.com/questions/4373730/is-there-an-offline-geocoding-framework-library-or-database-for-ios/4419113#4419113

The compilation of spatialite under iOS is not that easy. I struggled for a while before having something that works OK.

I have made a pdf file that explains the steps required to compile spatialite (+GEOS and PROJ4 that are required to get spatial indexes working properly with spatialite), I made the compilation of the whole stuff under XCode.

If you're interested in such PDF, just tell me, I can send it to you.

  • I'm absolutely interested - I'd hate to bang my head against a wall that you've already banged down. Thanks! – radven Jan 6 '11 at 19:03
  • Hi Radven, I've sent you an email at the email I've got at this page : technomadia.com/about-us (great picture actually ;) – yonel Jan 7 '11 at 10:43
  • 1
    Hi, I've improved the build of static libraries for spatialite so that the integration of it in XCode gets a lot easier . More info there : stackoverflow.com/questions/4793970/… – yonel Feb 1 '11 at 14:36
  • Hi @yonel, I'm new so please bear with me. I read all your answers.Can you please share the pdf with me(m.nabilmughal@gmail.com)..Or any better solution you found so far? can you guide me ? – nadeem gc Nov 26 '14 at 18:40
3

I would look into using Spatialite. It's sqlite + spatial functions and indexes. It'll do what you need and should(?) work on iOS.

See also: Reverse Geocoding Without Web Access

2

In addition to spatialite you could also use a raster approach. Simply convert the vector to a sensible resolution, and include a lookup table for attributes in your code. It will not be terribly accurate close to boundaries but should be very fast if you get the correct formats and compression.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.