GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
geonameId for country code  XML
Forum Index -> General
Author Message
gonfi



Joined: 17/02/2011 20:30:43
Messages: 11
Offline

(it's probably a common question but a search did not help me)

i have an administrative code (eg iso country code) and would like to make queries. but first i need to convert it into a geonames-specific geonameId.

a) can't some services (like neighbours, which is for countries only anyway) take well known administrative codes directly?

b) what's the ws to use for converting CH to 2658434? using the search service and q=2658434 ? hrm... sounds a bit fuzzy to me

marc



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

a) We could accept an additional optional parameter 'country' for the neighbour service. This could be done easily. Is there anything else you would require?

b) http://api.geonames.org/search?country=CH&username=demo&featureCode=PCLI

[WWW]
gonfi



Joined: 17/02/2011 20:30:43
Messages: 11
Offline

thank you for your help.

me, i would welcome that functionality from a) to make my userland code simpler, shorter, faster. as it is now i either generate useless traffic to your geo servers and spend more time for fetching the data i want, or must implement a bit more caching logic.

>> Is there anything else you would require?

since i'm just getting started with your api i don't know ... maybe all other users need to look up the internal geo id anyway for all the other services. i would like it if i could just work with existing 3166 or fips or nuts codes wherever they exist.
marc



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

the neighbour service now supports the parameter 'country':
http://api.geonames.org/neighbours?country=CH&username=demo

Marc

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