Author |
Message |
07/01/2020 22:27:58
|
ejayt
Joined: 07/01/2020 20:16:49
Messages: 2
Offline
|
Hey guys! I wrote a small Python program that grabs a GeoNames database of your choosing and forms a SpatiaLite database that returns the closest place name with a given latitude and longitude - Useful if you need to query for this all the time. The query time from the command line is about 0.4-0.6 seconds.
I hope someone else can find some use for this. I ran into problems with over querying MapQuest for this data in one of my other Python programs (and the allCountries.txt from GeoNames has far more data anyway).
https://github.com/evanjt/closestgeoname
|
|
|
17/01/2020 22:25:08
|
SergioCob
Joined: 19/05/2018 12:15:06
Messages: 1
Offline
|
Can you use this program to automatically make queries?
|
|
|
18/01/2020 18:11:15
|
ejayt
Joined: 07/01/2020 20:16:49
Messages: 2
Offline
|
SergioCob wrote:
Can you use this program to automatically make queries?
Hi, yes, an example is here:
https://github.com/evanjt/elodie/blob/08069dbc0eae12fb98f8b8a36894e1dedfdd798f/elodie/geolocation.py#L155-L161
The output of the function query_closest_city() is a tuple of (city, state, country)
|
|
|
|