GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
get hierarchy for all cities?  XML
Forum Index -> General
Author Message
ajsie



Joined: 20/03/2010 05:59:35
Messages: 2
Offline

i know that you can use the web API to look up the hierarchy (eg europe, sweden, skåne) for a city with its geoname_id.

but isnt there a way to look up this information locally? cause i have downloaded the whole database and imported it to mysql.

do i really have to use wep API for each city and then put the information in the mysql database myself?
marc



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

The information is available in the dump included in the admin1-4 codes. The relation ppl-pplx is available as a csv file in this forum.


Marc

[WWW]
ajsie



Joined: 20/03/2010 05:59:35
Messages: 2
Offline

could you please be more specific, cause im a beginner at this.

i dont get the admin1-4 codes in the table geonames. there is no such code for sweden and norway. do those codes only apply for the US? and there are only admin1 and admin2 tables. where are the admin3 and admin4 table? if a geoname got a admin4 code...how should i associate that with a place?

what do you mean in the dump? you mean the full database i downloaded?

and which csv file? why dont they just have that information in the native database?

please help...its kinda messy (why a lot of users are asking the same questions over and over).
geotree


[Avatar]
Joined: 23/07/2007 18:28:40
Messages: 138
Location: France
Offline

HowTo for Sweden :

1/ download SE.zip from :
http://download.geonames.org/export/dump/

2/ according to :
http://download.geonames.org/export/dump/readme.txt
select all records with "feature code" = ADM1

One of them is :
http://www.geonames.org/2721357/blekinge-laen.html
with "admin1 code" = 02

3/ select records with "feature code" = ADM2 and "admin1 code" = 02
Now you have all children of Blekinge.

etc


Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html
[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team