GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
How to figure out parent features  XML
Forum Index -> General
Author Message
zcw100



Joined: 28/09/2019 15:28:16
Messages: 18
Offline

I'm having a hard time figuring out how to get parent features. I've got the administrative features figured out but how do you get that Mount Everest(geonameid=1283416) has a parent feature of Nepal (geonameid=128298

I've looked and it's definitely not coming from the hierarchy table which is a table I still don't understand since it seems to mostly duplicate the administrative hierarchy that's available from geonames table with some other random junk in there.

marc



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

The admin hierarchy is encoded in the countrycode and admincodeXX attributes.

There is a second countrycode column for a coma separated list for features belongig to multiple countries.

The hierarchy file is for other relations, outside of the standard tree like admin hierarchy (such as admin features belonging to more than one parent)

Best Regards

Marc

[WWW]
zcw100



Joined: 28/09/2019 15:28:16
Messages: 18
Offline

The cc2 column?

I feel like I keep getting closer but quickly find some inconsistency with the web data that I can't reconcile. Take this https://www.geonames.org/12110882/mountain-states.html

There is a single adm2 division but I can't figure out how to find that. It says it's Burleson which is goenameid 4677551 but that has fclascode P.PPL not ADM2 and there is no entry with country = TX and admin2 = '051'

It can't come from the cc2 column because it's not a country.

12110882 doesn't appear as a child in any entry in the hierarchy table.

What am I missing here?
zcw100



Joined: 28/09/2019 15:28:16
Messages: 18
Offline

This moderated forum really makes it hard to respond or edit previous responses.

I had previously said country = TX, should have been US

So I think I know where it's failing for https://www.geonames.org/12110882/mountain-states.html is has adm2 as Burleson, that's Burleson County 4677558, and the reason it wasn't joining is that mountain states has a null for adm1 and burleson county has TX.

Now I'll have to figure out how this works if the previous admin entry is null.
zcw100



Joined: 28/09/2019 15:28:16
Messages: 18
Offline

So after looking at it I'm really not sure how you're supposted to find the adm2 if the adm1 is null. Adm2 isn't unique within a hierarchy. You can have multiple adm1's for any given adm2. There are 36 adm2's (051). How did you figure out that 12110882's was the one in TX?
marc



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

For 12110882 it was simply a data error. I have just fixed it and set the adm2 code to null. It does not make sense for a region spanning severl states to have the adm2 code set.

If you want to know the counties within this region then you have to find all states from the hierarchy table and from the states you find the counties for these states.

Best Regards

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team