bpaluzzi
Joined: 08/08/2011 10:44:14
Messages: 10
Offline
|
Is there any difference in the data being searched by these two functions?
I'm currently using postalCodeLookup, but I think my application would be better served by using the postalCodeSearch -- postalCodeLookup has weird results when you try to pass a non-numeric postal code (for example, to the US), while postalCodeSearch correctly returns zero results.
For example, try the following:
http://api.geonames.org/postalCodeLookupJSON?postalcode=15601&country=US&maxRows=1&username=demo
http://api.geonames.org/postalCodeSearchJSON?postalcode=15601&country=US&isReduced=true&maxRows=1&username=demo
They both return the same result (with slight differences in order)
Now try the following:
http://api.geonames.org/postalCodeLookupJSON?postalcode=test&country=US&maxRows=1&username=demo
http://api.geonames.org/postalCodeSearchJSON?postalcode=test&country=US&isReduced=true&maxRows=1&username=demo
Here, the results are wildly different.
I guess my actual question is -- other than the weird non-numeric behavior, is there any material differences between the postalCodeLookup and postalCodeSearch endpoints?
Cheers,
Brandon
|