City select box should change its data based on Country
That was me fist idea: just find needed (possibly free!) API Service and use it from grails project. But after googling a lot I did not find any solution which allow to retrieve all cities of country in one API call. At all I did not find any API doing this.
The only API which looks similar was Geonames but it do not return cities of country but have children associations, like USA -> States -> Counties -> Cities. You need to call :
http://www.maxmind.com/app/worldcities – huge database of cities in csv format with lat,long for each city. Was dismissed as it is really huge – 3 millions of cities. I did not want to display all Country cities as it is too much – only 10 – 200 most important based on country. Really cool data but not usable for me
http://mydatamaster.com/free-downloads/ (World Cities and Languages) – contains about 4000 cities with district/region and population info in SQL format. That was my case! Small reprocessiong of SQL to change ISO3166-3 country codes into ISO3166-2 and that is it!
Of course in this case we do not show all cities and risk that data will be old in some years, but honestly I do not think that this will be the case for any time as in our changing world sites are re-written each 3 years minimum and info will be updated then.