Geonames database query locally
<p>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?</p>

<p>I'm looking for a standalone solution because of rate limits of most reverse geocoding services.</p>

<p>Thank you.</p>