databasegeonames

Get state/province from geonames data?


I downloaded these databases for US and CA from GeoNames. The date looks like this:

5881639 100 Mile House  100 Mile House      51.64982    -121.28594  P   PPL CA      02              0       917 America/Vancouver   2006-01-18
5881640 101 Mile Lake   101 Mile Lake       51.66652    -121.30264  H   LK  CA      02              0       917 America/Vancouver   2006-01-18
5881641 101 Ponds   101 Ponds       47.811  -53.97733   H   PNDS    CA      05              0       18  America/St_Johns    2006-01-18

I want to use this data for a city-picker, but I want to display to province or state beside it. Doesn't look like this data contains that information. Is there some way to retrieve that? Or is there a better DB that includes that?


Solution

  • You use the data in the columns for the admin codes these are actually ids that link to the admin codes table (there are separate data sets available for the admin codes) it is very straightforward.

    Check the Geonames forums for more info.

    http://forum.geonames.org/