How can i get the nearest significant town or city from google maps?

user156888 picture user156888 · Aug 2, 2011 · Viewed 23.5k times · Source

Is this possible?

I have users who will show where they live on a map, if this isn't a large town or city, i'd like to find that and associate this information with the users record.

Any idea how to do this?

Answer

ElaGorilaki picture ElaGorilaki · Jun 4, 2014

Why not use the GeoNames Web Service. You can download the complete dump.

It takes Lat/Lng as parameters and also there is an optional parameter called radius(distance in km) as well as parameter cities where:

cities1000.zip : all cities with a population > 1000 or seats of adm div (ca 80.000)

cities5000.zip : all cities with a population > 5000 or PPLA (ca 40.000)

cities15000.zip : all cities with a population > 15000 or capitals (ca 20.000)columns