GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
getCapitalsByISOCountryCode  XML
Forum Index -> General
Author Message
mcjennis



Joined: 06/04/2007 23:37:04
Messages: 14
Offline

Hi everybody,
I couldn't find a web service that given a coutryCode returns the capital node with lat and lng. Is there any service among ws.geonames.org's services that could help me?
I tried with cities web service but I was not able to find correct params.

thanks
marc



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

Hi Fabrizio

The search service does this.

You can search for 'Capital, Italy' :
http://ws.geonames.org/search?q=capital,italy

or also for 'Capital' with the countrycode :
http://ws.geonames.org/search?q=capital&country=it

And to do it really right you could/should add the featureCode PPLC :

http://ws.geonames.org/search?q=capital&country=it&featureCode=PPLC

otherwise you might end up with some other city that has capital somewhere in its name like any city in Austrlia in the 'Australian Capital Territory'.

Cheers

Marc

[WWW]
mcjennis



Joined: 06/04/2007 23:37:04
Messages: 14
Offline

Cool, but after a quick trial both GB and UK return:

<geonames style="MEDIUM">
<totalResultsCount>3</totalResultsCount>

<geoname>
<name>London</name>
<lat>51.5</lat>
<lng>-0.1166667</lng>
<geonameId>2643743</geonameId>
<countryCode>GB</countryCode>
<countryName>United Kingdom</countryName>
<fcl>P</fcl>
<fcode>PPLC</fcode>
</geoname>

<geoname>
<name>Saint Helier</name>
<lat>49.1833333</lat>
<lng>-2.1</lng>
<geonameId>3042091</geonameId>
<countryCode>JE</countryCode>
<countryName>Jersey</countryName>
<fcl>P</fcl>
<fcode>PPLC</fcode>
</geoname>

<geoname>
<name>St Peter Port</name>
<lat>49.4561111</lat>
<lng>-2.5408333</lng>
<geonameId>3042287</geonameId>
<countryCode>GG</countryCode>
<countryName>Guernsey</countryName>
<fcl>P</fcl>
<fcode>PPLC</fcode>
</geoname>
</geonames>

It must be an error.

Thanks a lot
geotree


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

Same for French overseas territories :
as they have a country code, I think they should be stored as A.PCLIX (section of independent political entity) and linked to appropriate continent :

Guadeloupe (GP) and Martinique (MQ) to North America

Guyane (GF) to South America

Réunion (RE) and Mayotte (YT) to Africa

Saint-Pierre et Miquelon (PM)
Wallis et Futuna (WF)
Polynésie Francaise (PF)
Nouvelle Calédonie (NC) to Oceania

Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html
[WWW]
mcjennis



Joined: 06/04/2007 23:37:04
Messages: 14
Offline

Ohhhhh...
I'm sorry! I am feeling so ignorant! But I really didn't know anything about Crown dependency, shame on me...

But in wikipedia is written that each island has its own ISO code, hasn't it?

Crown dependencies are possessions of the British Crown, as opposed to overseas territories or colonies of the United Kingdom. They comprise the Channel Island bailiwicks of Jersey and Guernsey and the Isle of Man in the Irish Sea.

None forms part of the United Kingdom, being independently administrated jurisdictions, nor do they form part of the European Union. All three Crown dependencies are members of the British-Irish Council. From 2005, each Crown dependency has a Chief Minister as head of government. However, as they are possessions of the British Crown they are not sovereign nations in their own right, and the power to pass legislation affecting the islands rests ultimately with the British Parliament.

These Crown dependencies, together with the United Kingdom, are collectively known as the British Islands. They are treated as part of the United Kingdom for British nationality law purposes. However they maintain local controls over housing and employment which apply to British citizens without specified connections to that dependency (as well as to non-British citizens).

Each Island has its own separate international vehicle registration (GBG – Guernsey, GBA – Alderney, GBJ – Jersey, GBM – Isle of Man), internet domain (.gg – Guernsey, .je – Jersey, .im – Isle of Man), and ISO 3166-2 codes, first reserved on behalf of the Universal Postal Union (GGY – Guernsey, JEY – Jersey, IMN – Isle of Man) and then added officially by the International Organization for Standardization on March 29, 2006. 
marc



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

Guernsey, Jersey and Isle of Man have received their own ISO country codes some months back (spring 2006).
The question is how should we at GeoNames model these dependencies and how should the web services behave?

The search service returns places from Jersey and Guernsey as we have set the secondary countrycode (cc2) to 'GB', because users have asked us to return places from these islands even when explicitly searching with the country code 'GB'.
Should we change this and remove the secondary country code?

What is sure is that we have to find a conistent way of dealing with dependencies.

Cheers

Marc

[WWW]
marc



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

Shaun has found a similar problem in this thread :
http://forum.geonames.org/gforum/posts/list/570.page

Many of the countries he mentions are US dependencies like 'American Samoa' etc.

Cheers

Marc

[WWW]
Shaun Madison



Joined: 15/08/2007 07:50:16
Messages: 5
Offline

My thinking goes along the lines of the ISO 3166-2 codes where there are regional division entries for dependant states within the main country code (e.g. US) as well as entries under their own ISO 3166-1 code (e.g. AS [American Samoa]) - given that you are working your way to converting the GeoNames ADM1 codes to using the 31666-2 codes this would fit well.

Thus one should add a suitable PCL(?) entry for each ISO 3166-1 code that is used in the countryfield in GeoNames. (e.g. add one for AS)

The remaining issue is how do you link all the AS (P)lace entries into into the 'US' country code space without duplicating any (P)lace entry to satisfy the needs of those looking for 'all American places'

I'm note up to speed on the exact use of the cc2 field but maybe the answer lies in using this?

Regarding the issue of Wales, Scotland, England & N.Ireland in the GB country code space - these could logically be added as regional divisions of some sort. If you added them as ADM1's you'd have to bump all the existing ADM1s down to ADM2 (this would then be like BD Bangladesh in ISO 3166-2 terms), but that might not be easy to justify?!

Looking forward to your thoughts ...

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