I'm running Nominatim 2.2.0 on my server, and just finished importing planet data. When I do a reverse geocode lookup from my personal laptop as follows:

http://my-ip-address/nominatim/reverse?format=xml&lat=51.507020&lon=-0.100571&zoom=18&addressdetails=1

It works perfectly. But when I run the exact same thing on my server (that's running Nominatim) with curl:

curl http://my-ip-address/nominatim/reverse?format=xml&lat=51.507020&lon=-0.100571&zoom=18&addressdetails=1

or

curl http://localhost/nominatim/reverse?format=xml&lat=51.507020&lon=-0.100571&zoom=18&addressdetails=1

I get "unable to geocode" error. The only difference is that it works when I use my personal laptop (or query remotely) but doesn't work when I do it on a localhost (or query from the same server/computer that's running Nominatim/PostgreSQL).

When I look through my apache log, I get the following:

[Wed Mar 12 11:27:14 2014] [error] [client my-ip-address] PHP Notice:  Undefined index: lat in /postgres/OpenStreetMaps/Nominatim-2.2.0/website/reverse.php on line 57
[Wed Mar 12 11:27:14 2014] [error] [client my-ip-address] PHP Notice:  Undefined index: lon in /postgres/OpenStreetMaps/Nominatim-2.2.0/website/reverse.php on line 57

What could be wrong here? Thanks in advance!

asked 12 Mar '14, 18:41

baekacaek's gravatar image

baekacaek
176121317
accept rate: 0%

edited 12 Mar '14, 18:43

1

Just to be clear - are you using the same "curl" command on your laptop, or are you comparing a request made through a web browser on your laptop with a request made through curl on the server?

(12 Mar '14, 20:01) Frederik Ramm ♦

On my laptop, I'm using a normal browser. Just to be sure curl is working correctly on my server, I tried different websites and it seems to be OK.

(12 Mar '14, 21:07) baekacaek

Figured out the problem! Turns out some parameters were being escaped for whatever reason. Works when I do

curl 'http://my-ip-address/nominatim/reverse?format=xml&lat=51.507020&lon=-0.100571&zoom=18&addressdetails=1'

with the ' ' around the URL

permanent link

answered 12 Mar '14, 23:48

baekacaek's gravatar image

baekacaek
176121317
accept rate: 0%

Yes, the character & has a special meaning for the shell.

(13 Mar '14, 07:42) scai ♦
Your answer
toggle preview

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:

×560
×73

question asked: 12 Mar '14, 18:41

question was seen: 2,964 times

last updated: 13 Mar '14, 07:42

powered by OSQA