Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

3 Answers 3

up vote 2 down vote accepted

I've answered to that kind of question there: http://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.

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 : 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 11 hours ago

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

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

Your Answer

 
discard

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.