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

Hello,

my own nomination server works well. In Chrome I get my JSON output:

[
    {
        "place_id": "6781110",
        "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
        "osm_type": "way",
        "osm_id": "35776867",
        "boundingbox": [
            "52.5531628",
            "52.5534904",
            "13.3737733",
            "13.3743485"
        ],
        "lat": "52.55333255",
        "lon": "13.3739065743598",
        "display_name": "20, Gottschedstraße, Gesundbrunnen, Mitte, Berlin, 13357, Deutschland",
        "class": "building",
        "type": "yes",
        "importance": 0.101
    }
]

but in my linux bash I get with: curl -H "Content-type: text/html; charset=UTF-8" http://sgwtest.ddns.net/nominatim/search.php?q=13357+gottschedstraße+20&format=json

I get only the HTML-part like:

<!DOCTYPE html> <html lang="en"> <head>
    <title>OpenStreetMap Nominatim: Search</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <base href="/nominatim/" />
    <link href="nominatim.xml" rel="search" title="Nominatim Search" type="application/opensearchdescription+xml" />
    <link href="css/leaflet.css" rel="stylesheet" />
    <link href="css/bootstrap-theme.min.css" rel="stylesheet" />
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/common.css" rel="stylesheet" type="text/css" />
    <link href="css/search.css" rel="stylesheet" type="text/css" /> </head>

But why? In chrome it works very well, why not with curl

asked 19 Nov '16, 22:24

hevilp's gravatar image

hevilp
31558
accept rate: 0%


If you have really entered the curl command as written, then your shell has cut off everything after the first & which on Unix is traditionally a way to end a command and send it to the background. You have to add quotes around the URL, like so:

curl "http://sgwtest.ddns.net/nominatim/search.php?q=13357+gottschedstraße+20&format=json"
permanent link

answered 19 Nov '16, 23:46

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

this helped, thank you!

(20 Nov '16, 08:53) hevilp

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
×3

question asked: 19 Nov '16, 22:24

question was seen: 5,337 times

last updated: 20 Nov '16, 08:53

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