GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Trying to lookup cities by country, but country is among results  XML
Forum Index -> General
Author Message
brinch



Joined: 22/09/2014 23:54:41
Messages: 1
Offline

Hi

I'm trying to retrieve a list of cities by country code, like this:

http://ws.geonames.org/search?style=short&country=TH&username=demo

I get all cities in Thailand as expected, but one of the results is Thailand itself:

...
<geoname>
<toponymName>Kingdom of Thailand</toponymName>
<name>Thailand</name>
<lat>15.5</lat>
<lng>101</lng>
<geonameId>1605651</geonameId>
<countryCode>TH</countryCode>
<fcl>A</fcl>
<fcode>PCLI</fcode>
</geoname>
...

How can I remove this from the results?

Thanks!
barryhunter


[Avatar]

Joined: 13/09/2006 21:25:40
Messages: 27
Offline

Can post filter by fcode,
http://www.geonames.org/export/codes.html
to remove ones you not interested in.

Or could perhaps use the cities paramater, to limit to top cities.
http://www.geonames.org/export/geonames-search.html

Or even the featureCode paramater, and then list the types of feature codes you do want. Probably the PPL* ones.

--
- www.nearby.org.uk - www.geograph.org.uk -
[WWW]
hunters



Joined: 15/10/2014 05:45:04
Messages: 1
Offline

http://www.geonames.org/export/geonames-search.html

Or even the featureCode paramater, and then list the types of feature codes you do want. Probably the PPL* ones.

Hunting storehunting gear Price!Thousands Of Hunting Equipment list such as hunting scopes,Rifle Scopes,Red dot sights,Night Vision and more On Sales.
[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team