Geonames database query locally
If I import the Geonames database to a MySQL or SQLite database, how can query the database by latitude and longitude? I need to find the current country code based on a given geolocation (latitude and longitude). In other words, if I have a database with gps coordinates, how can I accurately get the closest one to a given latitude and longitude?
I'm looking for a standalone solution because of rate limits of most reverse geocoding services.
Ok I found a beautiful article by Seth McLean that describes this situation perfectly and provides a MySQL query that does exactly what I need: to search a geonames database by latitude and longitude. Maybe this helps someone else: http://clickherelabs.com/2015/01/distance-searching-and-mysql/