GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Admin3 and Admin4 Codes  XML
Forum Index -> Administrative Divisions
Author Message
ozzii



Joined: 14/04/2015 11:21:26
Messages: 9
Offline

I'm unable to see any data dumps on your download page for admin3 and admin4 codes?

How do I find this information i.e. the place name that relates to admin3 and admin4 codes?
marc



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

they are in the same file with featurecode ADM3 and ADM4 respectively.

[WWW]
ozzii



Joined: 14/04/2015 11:21:26
Messages: 9
Offline

Do you mean they are self referencing as follows:

Code:
      select  t4.name as town,
         t3.name as county, 
         t2.name as district, 
         t1.name as admin1, 
         t0.name, 
         t0.feature_class, 
         t0.feature_code,
         t0.country_code,
         t0.admin1,
         t0.admin2,
         t0.admin3,
         t0.admin4,
         t0.population
 from geoname t0
 left join geoname t1 on t1.admin1 = t0.admin1 and t1.feature_code = 'ADM1'
 left join geoname t2 on t2.admin2 = t0.admin2 and t2.feature_code = 'ADM2'
 left join geoname t3 on t3.admin3 = t0.admin3 and t3.feature_code = 'ADM3'
 left join geoname t4 on t4.admin4 = t0.admin4 and t4.feature_code = 'ADM4'
 where t0.name = 'London'
 
 
 


It would help if the documentation was updated as it doesn't make this clear?
Admin



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

no. Your query is wrong. The full code hierarchy is needed in the where clause.

Marc
ozzii



Joined: 14/04/2015 11:21:26
Messages: 9
Offline

Not sure what you mean. Which file are you referring to - GB.zip is the one I'm using? The above query seems to work?

Please can you provide an example of what you mean. My query is for an autocomplete ajax suggestion.
 
Forum Index -> Administrative Divisions
Go to:   
Powered by JForum 2.1.5 © JForum Team