GeoNames Home
|
Postal Codes
|
Download / Webservice
|
About
GeoNames Forum
Search
Recent Topics
Back to home page
Register
/
Login
Retrieve all state or province codes for a country
Forum Index
->
General
Author
Message
18/01/2012 15:11:28
Subject:
Retrieve all state or province codes for a country
lifebio
Joined: 18/01/2012 14:46:41
Messages: 1
Offline
I am working on integrating the web services into our application. So far pretty good. I have 1 question tho:
I am using this service like:
http://api.geonames.org/search?country=US&featureCode=ADM1&style=SHORT&username=<xxxx>
but would like to get the state code(abbreviation) returned. I see the code in the admin1_code (and the alternatename “abbr”) field in the db. The need is to have the states/provinces/etc for the country. So for the US, I would have all 50 states+.
If I use the web service like this:
http://api.geonames.org/search?country=US&featureCode=ADM1&style=FULL&username=<xxx>
I get the abbreviation, but that is far too big a payload to process.
Is there something I am missing or a parameter or a different service to call?
Any assistance would be appreciated.
21/01/2012 07:50:42
Subject:
Re:Retrieve all state or province codes for a country
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
you can set the desired out put language to the pseudo-language 'abbr'.
http://api.geonames.org/search?country=US&featureCode=ADM1&style1=SHORT&username=xxx&lang=abbr
Best Regards
Marc
Forum Index
->
General
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