Author |
Message |
22/12/2006 22:58:31
|
Anonymous
|
ok this works fine:
http://ws.geonames.org/postalCodeSearchJSON?postalcode=91126&maxRows=1&country=DE
but it don't delivers admin1-3 like in your "Postal Code Search" in the menu above
Place Code Country Admin1 Admin2 Admin3
1 Schwabach 91126 Germany Bayern Mittelfranken Kreisfreie Stadt Schwabach
|
|
|
24/12/2006 10:51:30
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4416
Offline
|
Hi
With the parameter style=FULL or style=FULL you get more information :
http://ws.geonames.org/postalCodeSearchJSON?postalcode=91126&maxRows=1&country=DE&formatted=tr&style=lONG
admin3 however is missing, it will be added in the next couple of days.
Happy Holidays
Marc
|
|
|
|
13/02/2007 22:19:11
|
dpc_map
Joined: 07/02/2007 04:02:37
Messages: 16
Offline
|
Can adminCode1 be included in the webservice postal code search? For example:
http://ws.geonames.org/postalCodeSearchJSON?placename=Albany&maxRows=10&country=US&adminCode1=NY&formatted=tr&style=LONG
doesn't limit the search to NY. I notice on the www.geonames.org postal code search page that I can enter "Albany, NY" and get back postal codes limited to NY, so perhaps there is some backend processing going on to filter the results of the query.
Also, for the geonames search webservice I can specify "name_equals". Is there something equivalent for postal searches?
Thank you.
Dan
|
|
|
14/02/2007 13:06:13
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4416
Offline
|
Hi Dan
adminCode1 is now a valid search parameter.
The equivalent to name_equals is the brand new placename_equals :
http://ws.geonames.org/postalCodeSearchJSON?placename_equals=Albany&maxRows=10&country=US
Marc
Edit : missing "h" for http added.
|
|
|
|
14/02/2007 17:40:57
|
dpc_map
Joined: 07/02/2007 04:02:37
Messages: 16
Offline
|
Marc,
Thank you for the quick response and enhancements. The addition of the adminCode1 and placename_equals works great.
In the link you provided with your reply, the "h" is missing from the "http". Can you correct that for future visitors to this thread?
Thanks for your help.
Dan
|
|
|
16/02/2007 22:37:36
|
dpc_map
Joined: 07/02/2007 04:02:37
Messages: 16
Offline
|
The following query returns two locations:
http://ws.geonames.org/postalCodeSearchJSON?placename_equals=bathurst&maxRows=10&country=CA
The first is what I expected; the second location has Bathurst in its placename, but the placename isn't exactly Bathurst. So does placename_equals match exactly or look for the string in the placename? I'd like to be able to specify an exact match.
Thank you.
Dan
|
|
|
17/02/2007 16:21:56
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4416
Offline
|
You are right the first implementation was not correct. Should be fixed now. Can you give it a test?
Marc
|
|
|
|
17/02/2007 20:34:19
|
dpc_map
Joined: 07/02/2007 04:02:37
Messages: 16
Offline
|
Marc,
The placename_equals is now matching exactly. Thank you for fixing this.
I've come across another problem with placename_equals. It doesn't take names with "spaces". I want to return the postal code for Pleasant Valley, NY.
I've tried
http://ws.geonames.org/postalCodeSearchJSON?placename_equals=pleasant+valley&maxRows=10&country=US&adminCode1=NY
and
http://ws.geonames.org/postalCodeSearchJSON?placename_equals=pleasant%20valley&maxRows=10&country=US&adminCode1=NY
I thought that "+" or "%20" are the proper url_encodings for a "space".
Am I encoding this wrong?
Thank you for your help.
Dan
|
|
|
17/02/2007 22:15:50
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4416
Offline
|
Hi Dan
I wasn't an encoding problem. It was a problem on the server side. Instead of searching for a place called "Pleasant Valley" it was searching for a place with the two names "Pleasant" and "Valley". A place with these two names does not exist and the search didn't find anything.
Cheers
Marc
|
|
|
|
18/02/2007 05:55:24
|
dpc_map
Joined: 07/02/2007 04:02:37
Messages: 16
Offline
|
Marc,
Thank you for fixing the server problem.
Cheers,
Dan
|
|
|
|