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: 4501
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]
slcorbett



Joined: 06/07/2026 13:49:35
Messages: 1
Offline

Hi both,

Thank you for this question and response, it does help clarify the database search issue. However, I would like to flag that there may still be an underlying data issue. West Ilsley is a PPL rather than a PPLA; while this is reflected on the interface it looks like it may be incorrectly labelled in the downloads. Does this mean it has been fixed in the database but the downloads have not been updated?

Best wishes,
Sybilla
 
Forum Index -> Administrative Divisions
Go to:   
Powered by JForum 2.1.5 © JForum Team