GeoNames Home
|
Postal Codes
|
Download / Webservice
|
About
GeoNames Forum
Search
Recent Topics
Back to home page
Register
/
Login
Query capitals of first-order administrative division
Forum Index
->
Administrative Divisions
Author
Message
13/09/2024 21:47:59
Subject:
Query capitals of first-order administrative division
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.
12/12/2024 19:58:58
Subject:
Re:Query capitals of first-order administrative division
marc
Joined: 08/12/2005 07:39:47
Messages: 4457
Online
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
Forum Index
->
Administrative Divisions
Go to:
Select a forum
Forum in English
-------------
General
Administrative Divisions
FAQ - frequently asked questions
Postal Codes
Discussion of GeoNames Toponyms
Forum in other language
-------------
Forum in Deutsch
Powered by
JForum 2.1.5
©
JForum Team
info@geonames.org
GeoNames Home
Postal Codes
Download / Webservice
Forum
About