GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Query capitals of first-order administrative division  XML
Forum Index -> Administrative Divisions
Author Message
Andre



Joined: 07/09/2024 15:35:00
Messages: 1
Offline

Hi, first of all I would like to thank the Geonames team for the good data provided.

The last couple of days I was trying to query the administrative regions of some countries and their capitals.

If I understood this right I use a query like the following to get the capital of England for instance:

SELECT * FROM geoname
WHERE country_code LIKE 'GB'
AND admin1_code LIKE 'ENG'
AND fcode LIKE 'PPLA';

Result: West Ilsley (geonameid: 11747336)

Obviously this is wrong! The correct result should be 'London'.

Am I doing anything wrong? Is there another way to query the regional capitals?

Any help would be much appreciated. Thanks.
marc



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

Hi Andre

London is not only a PPLA but also the capital and thus PPLC.
The more relevant feature code prevails.
Search for PPLA and PPLC and PPLG , sort in this order and use the first result.

Best Regards

Marc

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