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?
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.