GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Perform exact match with city, state and country  XML
Forum Index -> General
Author Message
vinny



Joined: 20/08/2013 16:56:00
Messages: 5
Offline

Hello,

I am trying to perform an exact match based on the city, state (region) and country so that I will get only one result back. (Greenwich,Connecticut,US)
However, I finding difficulties in setting the region or the state in my search query. I am using the name_equals for the city name and country to pass the country code.

Can some one please help me to pass the state(region) correctly to get the result?

Thanks
marc



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

you need to pass the adminCode(x) parameters:

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

[WWW]
vinny



Joined: 20/08/2013 16:56:00
Messages: 5
Offline

Hi Marc,

Thanks a lot for your response. Yes the adminCode param worked. However, I find it very easy with US states since the admincode for state are same as the states short names. However, internationally, I am finding issue since the admin code looks more like an internal id number like 07 etc.

Is there any best practice I can pass the admin code as the state short name or the full state name rather than passing in a code like 07?

Thanks
Vinny
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team