NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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

++++

 this is the error message sending with terminal:

 [root@gps]# wget http://nominatim.openstreetmap.org/reverse?format=xml&limit=1&addressdetails=1&zoom=18&email=&lat=-0.24136&lon=98.48281
 [1] 16844
 [2] 16845
 [3] 16846
 [4] 16847
 [5] 16848
 [6] 16849
 [2]   Done                    limit=1
 [3]   Done                    addressdetails=1
 [4]   Done                    zoom=18
 [5]-  Done                    email=
 [root@bitacoragps bitacoragps]# --2015-09-15 23:35:14--  http://nominatim.openstreetmap.org/reverse?format=xml
 Resolving nominatim.openstreetmap.org... 128.40.45.204
 Connecting to nominatim.openstreetmap.org|128.40.45.204|:80... failed: Connection refused.

asked 15 Sep '15, 22:37

HugoAlejo's gravatar image

HugoAlejo
11112
accept rate: 0%

edited 17 Sep '15, 06:07

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

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.

(17 Sep '15, 06:07) aseerel4c26 ♦

You have to quote the URL because it contains special characters such as &. Try this instead:

wget "http://nominatim.openstreetmap.org/reverse?format=xml&limit=1&addressdetails=1&zoom=18&email=&lat=-0.24136&lon=98.48281"

Some background information: As you can see in your output, wget actually only tries to open http://nominatim.openstreetmap.org/reverse?format=xml (everything before the first &) due to the fact that your shell interprets & in a special way. It assumes the program and all of its arguments end at right before the & and puts it into the background (that's what the & is for). That's why you are seeing the [1] 16844, [2] 16845 and so on which are the PIDs of the programs put into the background. And this URL wget is trying to retrieve won't ever give you an useful response.

permanent link

answered 16 Sep '15, 08:04

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

edited 16 Sep '15, 08:41

oh, yes, indeed! thanks, I missed that.

(17 Sep '15, 06:01) aseerel4c26 ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689
×293
×85
×6

question asked: 15 Sep '15, 22:37

question was seen: 5,322 times

last updated: 27 Nov '18, 20:54

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum