Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

I've answered to that kind of question there:

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.

share|improve this answer
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 : (great picture actually ;) – yonel Jan 7 '11 at 10:43
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 :… – 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( any better solution you found so far? can you guide me ? – nadeem gc Nov 26 '14 at 18:40

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

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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