GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
How to use same query as in a web page  XML
Forum Index -> Postal Codes
Author Message

Joined: 11/10/2017 18:52:32
Messages: 2

I tried to find a city by postal code here:
And it works great.
Then I try to do the same using API with query:
And its not works, 0 results! What am I doing wrong?

Joined: 08/12/2005 07:39:47
Messages: 4166


The search on the www page falls back to the postalcode search if it does not find anything in the gazetteer.
The postalcode search api is this:

The gazetteer dataset and the postalcode dataset are not yet fully integrated. Only a few country have the complete postalcodes already in the gazetteer data.

Best Regards



Joined: 11/10/2017 18:52:32
Messages: 2

Ok, thanks for your response. I tried search by postal code and its works now. But there another question.
I need to save location data into database so use for id`s geonamesId. But postal code not return geoname id, only search method can do that. So now each time when user wants to find city by postal code its 2 steps:
1. User types Country+postalcode and use postalCodeSearch method.
2. I getting data from response and do second query and search method with country+placeName+adminName.

In the result I have city name, region name and geonameId. But there couple problems exists. Some data can be lost, because search method not always return same result as postal code search. And 2 queries works slower than one.

So maybe exists some method that can give possibility to find city name by country+postalCode and will return placeName, adminName and geonameId?
Forum Index -> Postal Codes
Go to:   
Powered by JForum 2.1.5 © JForum Team