GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Populated Places and ADM5 relationship  XML
Forum Index -> General
Author Message
fla83tn



Joined: 10/09/2018 18:05:03
Messages: 4
Offline

Hi to everybody,
is there a way to reconstruct the ADM5 relationship of a populated place?
In hierarchy.zip file there's only the relationship between an ADM5 and its parent ADM4 or between the PPL and its parent PPL, while in adminCode5.zip there's only the Geonames label for that ADM5.

I didn't found any way to get such a relation (that indeed is present because for example if I go to http://www.geonames.org/6269270/eur.html the relationship with this PPLX and its ADM5 is reported).

Any help? Could this relationship be reported in a new dump?

Best,
Flavio
marc



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

Hi Flavio

I find the following in the file:

Code:
 grep 6269270 adminCode5.txt
 6269270 Q32
 

where Q32 is the admin5 code. This looks ok and complete.

Best Regards

Marc

[WWW]
fla83tn



Joined: 10/09/2018 18:05:03
Messages: 4
Offline

Hi Marc,
thanks for the reply. My problem is to know the ADM5 (if any) of a populated place. With the dumped data is very problematic to infer it.
Right now the only way I found is to issue a getJSON (via Web Service) for each location having a non null value for ADM4, filter those having not null "adminCode5" in the responde JSON, make it unique (ADM1.ADM2.ADM3.ADM4.ADM5) and then joining with the modified admin5codes (where the non-uniqie code has been transformed to a qualified version like the aforementioned one, i.e. ADM1.ADM2.ADM3.ADM4.ADM5).

Is there other simpler way (without passing throug WS)?
marc



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

Why is is problematic with the dumped data? The information is the same as for the other levels. The reason for the additional adm5 file is that this column was added later and adding it to the main file would have crashed all existing import scripts.
You can easily load the adm5 file, add a new adm5 colum to your main geonames table and set the adm5 code there. Then you can query as for the other levels directly on your own database.

Marc

[WWW]
fla83tn



Joined: 10/09/2018 18:05:03
Messages: 4
Offline

Hi Marc,
it's true that I can add the ADM5 code (in a ADM5 column) for locations of type A|ADM5, what is missing is the ADM5 relationship of a PPL. With the existing dump you filter a PPL record and then you get all ADMs for it but up to 4th level. You don't know wheter it has an ADM5 or not unless you do all the complicated steps I did...
marc



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

In the example we have spoken about a pplx which has its adm5 code in the file. I don't understand why you say only adm5 have the code in the file.

Best Regards

Marc

[WWW]
fla83tn



Joined: 10/09/2018 18:05:03
Messages: 4
Offline

Unfortunately the ADM5 code reported in the adminCode5 is not unique, it should report also the ADM5 geonames id.

For example, let's consider this case:

2808747 1 -> Wilhelmsburg (ADM5 = Hamburg-Mitte, id = 11669483)
2812384 1 -> Wein-Berg (ADM5 = Nordost, id= 11524046)

This file is almost useless
Admin



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

The first is in Hamburg the second one in Leipzig. The codes are unique in the combination of all parent codes.
The file is just the missing adm5 code with the same concept as for all other codes.

Best Regards

Marc
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team