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

Hi there,

I have a problem to understand how the API works.

These two lines work well:

wget -c"node[waterway=wreck][bbox=-27,29,44,72]" -O EU_Wrecks-1.osm
wget -c"node[historic=wreck][bbox=-27,29,44,72]" -O EU_Wrecks-2.osm

But when I try to combine them it doesn't:

wget -c"node[waterway|historic=wreck][bbox=-27,29,44,72]" -O EU_Wrecks.osm

Any hints for me? Tnx...

PS: Seems it worked once:

asked 26 Apr '17, 13:51

MeriMapper's gravatar image

accept rate: 0%

edited 26 Apr '17, 16:57

Rather than "node[waterway|historic=wreck]" you need to do something like "(node["waterway"="wreck"];node["historic"="wreck"];);"

Also note that the wizard of can be very helpful for figuring out what works

permanent link

answered 26 Apr '17, 14:29

Hjart's gravatar image

accept rate: 18%

Thanks for your answer!

I tried wget -c"(node["waterway"="wreck"];node["historic"="wreck"];);[bbox=-27,29,44,72]" -O EU_Wrecks.osm and got ERROR 400: Bad Request.

When I send only the http part in my broser I get:

Error in ["(node["waterway"="wreck"];node["historic"="wreck"];)]: Error: Query must start with 'node', 'way', 'relation', or '*'

Tested with dozends of variants with or without brackets, quotes, ... :-P

(26 Apr '17, 17:15) MeriMapper

In the Overpass Turbo wizard mentioned above I wrote "type:node & (waterway=wreck | historic=wreck)", which it then translates to QL code.

(when tested from inside JOSM the result is a bit different)

What I'm not at all sure about here is how to transform the result into something that will fit into a commandline string like yours

(26 Apr '17, 19:11) Hjart

The Overpass server implements an XAPI compatibility layer. I don't know it well, it may not support the combined query.

You can use the Overpass QL to do the query though, I think Hjart has written their answer in the QL. Here's the query in Overpass Turbo:

(Click "Run" to see the output)

Under "Export" there is a link "raw data directly from Overpass API" that is suitable for use with wget.

The query language is documented here:

permanent link

answered 26 Apr '17, 17:50

maxerickson's gravatar image

accept rate: 32%

edited 26 Apr '17, 17:51

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 26 Apr '17, 13:51

question was seen: 3,498 times

last updated: 26 Apr '17, 19:16

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