Hi, i'm try to use the reverse geocode provider: http://nominatim.openstreetmap.org/reverse?lat=-0.24136&lon=-80.48281 i can do that with my browser, but when i make the same request from my server (opengts server) i receive an error. I think the error is because the web server detect this is not a browser and refused connection. how can i use this web services with my server? please your help ++++
asked 15 Sep '15, 22:37 HugoAlejo aseerel4c26 ♦ |
You have to quote the URL because it contains special characters such as
Some background information: As you can see in your output, wget actually only tries to open answered 16 Sep '15, 08:04 scai ♦ oh, yes, indeed! thanks, I missed that.
(17 Sep '15, 06:01)
aseerel4c26 ♦
|
Scai has found the issue here, but this is still relevant in general: Chances are quite good, that you are guessing right (maybe due to a missing identification of your client). Please check and obey the services usage policy which you are using. In this case: Nominatim.openstreetmap.org/Usage_policy. This is important because we are just a project living on donations which cannot handle every load. :-)
If you just send some requests the default user agent identification may be tolerable, but please change it if those are many requests (I do not know your server software). I think it should be something like this (nominatim's email parameter filled in (and/or a new user agent):
wget "http://nominatim.openstreetmap.org/reverse?format=xml&limit=1&addressdetails=1&zoom=18&email=HugoA@example.com&lat=-0.24136&lon=98.48281" --user-agent=HugoAOpenGTS
Note, that I am no server admin, but setting a good user agent and ensuring to not do too many requests per time frame would be a first try.