ushahidi/Ushahidi_Web — pull request #1252 by ditorelo (2013-09-26 01:53:51+00:00)
Title: Adding Nominatin as a geocoder option (Issue #794)

A per #794, here's what this pull request is doing:

* Creating a geocode class to separate logic out of map class
* Moving current geocode functions to this class
* Reworking functions so we have geocoding and reverse geocoding functions for Google and Nominatin
* Adding config parameter on map config file so deployments can choose their geocoding engine (Nominatinis default)
* Updating country model to return a country by code for cases where country names differ from ones on database (Nominatim returns "United States of America" while the database has "United States")
* Creating test cases to make sure engines are working as expected.

As a side note, Nominatin data is quite different from Google Geocode. For countries like Brazil, the location display name can be painfully long. However, and don't see that as a massive downside, and I like the idea of moving away from Google's crazy T&Cs.

Nominatim limits us to 1 request / second (http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy). I'm not sure how restrictive that is, but I would say I'm comfortable about that. We could look into using MapQuest's API as well - shouldn't be too hard to get in place with this new structure.