github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

drodriguez / reversegeocoding

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 5
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Offline reverse geocoding library and scripts for the iPhone. — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Remove <> around email. 
drodriguez (author)
Tue Mar 31 23:22:32 -0700 2009
commit  14d32907dc0e351db9562d86c97015283731dfd3
tree    80b7d3e9b08e59566eec01c6059c4790fc94f3a4
parent  f3f5e049a20adf650e2b30cc227ca0097da9c6a1
reversegeocoding /
name age
history
message
file .gitignore Loading commit data...
directory Classes/
file Info.plist
file LICENSE
file MainWindow.xib
file README.markdown
file RGConfig.h
file RGReverseGeocoder.h
file RGReverseGeocoder.m
directory ReverseGeocoding.xcodeproj/
file ReverseGeocoding_Prefix.pch
file dist.plist
file geocoder.thor
file main.m
README.markdown

Reverse Geocoding

This project a Objective-C class (aim to be used on the iPhone) to include in your application a reverse geocoding system. Included in the project there is also a Thor http://github.com/wycats/thor script for downloading the cities database and transforming it into a suitable format for the iPhone.

What's a “reverse geocoding” system?

As Wikipedia says http://en.wikipedia.org/wiki/Geocoding:

Geocoding is the process of finding associated geographic coordinates … from other geographic data, such as street addresses, or zip codes. …

Reverse Geocoding is the opposite: finding an associated textual location such a street address, from geographic coordinates.

How do I use it

The project includes a script for Thor http://github.com/wycats/thor that tries to make the use of the project classes and the needed resources as easy as I can.

This project tries to leverage the tools include in Mac OS X 10.5, but there are some steps you have to do before using this script. So open your Terminal and type the following (except the dollar sign):

    $ gem install thor sqlite3-ruby fastercsv

After Thor installation you have to install this project Thor script into your system:

    $ thor install http://github.com/drodriguez/reversegeocoding/blob/master/geocoder.thor?raw=true

When asked, you should say “y” to the question “Do you wish to continue?” and provide “geocoder” as name for the script in your system.

Once installed you can use Thor anywhere in your system to access the geocoder tasks. You can get a list of the task typing the following:

    $ thor list geocoder

And you can update the Thor script easily by:

    $ thor update geocoder

The easiest way to use the reverse geocoding system is to use the defaults, download all (code and databases), and create the SQLite database and the auxiliary files.

    $ thor geocoder:download all
    $ thor geocoder:database

Then in your application include the following files:

  • RGReverseGeocoder.h
  • RGReverseGeocoder.m
  • RGConfig.h
  • geodata.sqlite.gz
  • geodata.sqlite.plist

And also add libsqlite3.dylib, libz.dylib and CoreLocation.framework to your application.

Then at the start of your application call to:

    [RGReverseGeocoder setupDatabase];

And when you need to get a place from a location:

    [[RGReverseGeocoder sharedGeocoder] placeForLocation:myLocation];

If you need more help look at help from the Thor script, the documentation of the source code and the example project included in this Git repository.

Credits

Author: Daniel Rodríguez Troitiño (drodrigueztroitino thAT yahoo thOT es)

This project could not have been done without the free data provided by GeoNames http://geonames.org. GeoNames data is licensed under a Creative Commons Attribution 3.0 License http://creativecommons.org/licenses/by/3.0/. The data is provided "as is" without warranty or any representation of accuracy, timeliness or completeness.

There is a small “inspiration” on some parts of SQLite Persistent Objects for Cocoa and Cocoa Touch http://code.google.com/p/sqlitepersistentobjects.

There is also a method adapted from Figure 14-10 of Hacker's Delight by Henry S. Warren http://www.hackersdelight.org/.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server