GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Continents -> Countries -> Regions -> Cities  XML
Forum Index -> Administrative Divisions
Author Message
champ1979



Joined: 24/07/2007 23:42:42
Messages: 4
Offline

I'm building a website where I need a list of continents displayed, and when a continent is clicked, the countries displayed, and
when a country is clicked, the regions displayed and if a region is clicked, the cities displayed--somewhat like TripAdvisor.

If anybody has done this before, could you please share with me the
webservice method calls that you used?

Thanks!
marc



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

Hi

The children web service from the place name hierarchy services are exactly used for this :

http://www.geonames.org/export/place-hierarchy.html


Marc

[WWW]
champ1979



Joined: 24/07/2007 23:42:42
Messages: 4
Offline

Thanks. But will this give me too many levels? For example, I wanted to bypass the county level for US. From country -> State -> City.

Also, how do I get the short names for the States? Some of them say "State of..."

Thanks for your help.
marc



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

If you want to bypass the counties you will have to implement it yourself.

The problem with the names of the states in the service has been improved in the last days. Please check again and report remaining long names.

Marc

[WWW]
olivier.voutat



Joined: 07/06/2008 18:54:52
Messages: 5
Offline

I'm looking for the same use but from countries -> states -> cities

From countries -> states it is easy as states are always adm1 but cities are sometimes adm2 or adm3 or even adm4.

How to discover which level cities are for all countries without having to inspect everything?

Cheers
marc



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

Hi Olivier

We have separated cities from administrative divisions. Cities have the feature class 'P' whereas administrative divisions (states, provinces, etc) have the feature class 'A'.
To find all the cities of a country you just have to search for all feature classes 'P'.

Best

Marc

[WWW]
olivier.voutat



Joined: 07/06/2008 18:54:52
Messages: 5
Offline

Great Marc,

Sorry, there is so many informations that I didn't see this. With this it will be really easy to organise.

Cheers
Olivier
olivier.voutat



Joined: 07/06/2008 18:54:52
Messages: 5
Offline

Hum, I did a little program to recursively import all geo_info to my database. At first I thought that I did a programmation error but I checked the information with the

http://ws.geonames.org/children?geonameId=geoid

For the country Albania per example, ADM2 elements has same ADM3 children. How does it can be possible?

http://ws.geonames.org/children?geonameId=865730 is the ADM2

http://ws.geonames.org/children?geonameId=783626
http://ws.geonames.org/children?geonameId=3315069

are examples that have the same childs!!!

Cheers,
Olivier
olivier.voutat



Joined: 07/06/2008 18:54:52
Messages: 5
Offline

And the other problem that I'm finding is that when I do several calls to the children method of the web service, sometimes it hangs up...
marc



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

Hi Olivier

The problem that the same ADM3 are returned as children for two different ADM2s has two causes.

1. The ADM2 and the ADM3 in question don't have admin2Codes in the database. This information is still missing. Would you like to help us fix it?
2. The web service compares the admincode to return the children and simply returns the elements with the same admincodes. In this case they all have blank admincodes and the service returns it.

We have not enforced integrity constraints as many sources are not 100% complete and consistent and we would have delete a lot of information to get a fully consistent database.

Marc

[WWW]
olivier.voutat



Joined: 07/06/2008 18:54:52
Messages: 5
Offline

I'm recursively retrieving data from your webservice.

I'm retrieving geoNameId, parent(s)geoNameId, Name, featurecode, featureclass

Cause I noticed this problem of "multiple parents" I'm adding to my "toponyms" the parents geoNameIds as this

:parentId;:parentId;:parentId;

Would you like to have all the Toponyms that have more than one parent? How else could I help?

Cheers,
Olivier
marc



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

Hi Olivier

We know which toponyms are having blank admincodes. What we need to know is the information to fix the blanks. The first step is to fix the blank admincodes for the administrativ divisions.
In order to help us you could find out which code to use for each admin division (in Albania for instance). Information like this is often available from the national statistical office.

Best

Marc

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