GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
city and zip info - - basic question  XML
Forum Index -> General
Author Message
newtonpage



Joined: 20/11/2009 08:09:57
Messages: 2
Offline

Basic questions from a newbie:

If I submit a valid country code and state/ province, can geonames return a list of cities? Then, if I supply valid country code and state/ province AND this city, can I get a list of zip codes?

Is this available through the documented webservice?

marc



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

You can certainly do this.

Marc

[WWW]
newtonpage



Joined: 20/11/2009 08:09:57
Messages: 2
Offline

Thank you for the reply

I am very impressed with the geonames service and appreciate the work done here but I find the documentation a little thin - - and BTW, I would be happy to contribute code examples and other How-To's once I get my arms around this.

So - - Given country and state / province, I would like to do the following:

1) obtain a list of named cities for this country and state / province pair.
Having obtained this, I would then make certain the city is correctly entered.

2) once I have a valid a city, if the user enters zip / postal (this field is optional), I would then like to obtain a list of zip / postal codes for that city and make certain that the city - zip pair is valid.

3) alternatively, if the user enters zip / postal first, and then city, I would like to submit country and zip / postal and then check the city.

timely help would be greatly appreciated and I reiterate my offer to help - - and this includes creation of graphics if needed.

I have tried many variations using the geonames functions with no luck.

thanks so much

S
marc



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

1) use the search function with adminCode and country parameters
2) use the postal code search with the placeName and country. I wouldn't use the admin as it may not be filled in all countries
3) again use the postal code search

In general I would not force the validation, I would more use it as a suggest or warning that the combination may be wrong. It may happen that new postal codes are not yet in the database. For a forced validation it is better to use the regular expression of the postal code format.

Marc

[WWW]
arathi



Joined: 17/06/2010 12:48:59
Messages: 1
Offline

is it possible to get the list of states when i enter city name in US?
how to do that?
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team