GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Mapping Cities to State/Provinces to Countries  XML
Forum Index -> FAQ - frequently asked questions
Author Message
jimtrs



Joined: 22/04/2009 20:23:00
Messages: 3
Offline

I'm attempting to create a hierarchy for cities being a sub-region of states/provinces with states/provinces being a sub-region of countries.

It appears that if I select all records with a feature class = "A" and a feature code = "ADM1" I can use the country code attribute to map the states/provinces records returned.

Now when I attempt to select all of the records with a feature class = "P" and a feature code = "PPL" I receive all of the cities/villages and I can again map them to the countries using the country code attribute, but I am not able to figure out how to map these city/village records to their corresponding state/province; will someone please assist me in cracking the code?
Admin



Joined: 19/11/2005 16:33:24
Messages: 46
Offline

If the information is available then it is in the admin1 column. If the column is empty or has '00' then we don't know.

Marc
jimtrs



Joined: 22/04/2009 20:23:00
Messages: 3
Offline

If I understand correctly when I select all feature codes = "PPL" I will receive all cities/towns. The state/province code will be in the admin1Code attribute if known, otherwise it will be blank or contain zeros.

The admin1codes.txt file contains the translations for mapping to state/provinces. Code AD.02 = Canillo, Andorra; AD.04 = La Massana, Andorra; AD.07 = Andorra la Vella, Andorra; am I correct so far?

Now please walk through a couple of examples with me:

When I pull up "Santa Coloma" I receive the feature code = "PPL" and the admin1 = 0; so I conclude that it is not known by GeoNames to be located in the province of Andorra La Vella. If it were known the admin1Code would be "7" as per the admin1codes.txt file, correct?

When I pull up "Xixerella" it has an admin1Code = 1, instead of 4 (La Massana). So maybe I've just pulled up a couple of records that need to be corrected or I still don't understand how to crack the code.

Perhaps if you would walk through a couple of examples for me I would be better able to understand. Thank you for your assistance.

marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

it is as you say. You have understood the concept.

Marc

[WWW]
jimtrs



Joined: 22/04/2009 20:23:00
Messages: 3
Offline

Thank you.

Please update the following for the benefit of all users:

Change the "Santa Coloma" admin1 code from a "0" to a "7"; and

Change the "Xixerella" admin1 code from a "1" to a "4".

marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

jimtrs wrote:
Thank you.

Please update the following for the benefit of all users:

Change the "Santa Coloma" admin1 code from a "0" to a "7"; and

Change the "Xixerella" admin1 code from a "1" to a "4". 

Was already done a couple of days ago:
http://www.geonames.org/recent-changes/country/AD/

Please don't hesitate to directly fix errors yourself. It is pretty easy:
http://www.geonames.org/manual.html

Best
Marc

[WWW]
 
Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team