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

How can I select multiple ways by their OSM id using the overpass API?

[out:json];way(104178011);way(18916837);out tags;

The above query only includes the data about the second way. Link.

asked 31 Jul '15, 16:07

CrazyDave2345's gravatar image

CrazyDave2345
55447
accept rate: 0%


For those arriving here via an internet search, this is a quicker way to do it now:

 [out:json];way(id:104178011,18916837);out tags;
permanent link

answered 22 Jul '18, 14:16

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 10 Apr '23, 11:48

Found it for myself this way: [out:json];way(104178011);out tags;way(18916837);out tags;

permanent link

answered 31 Jul '15, 16:36

CrazyDave2345's gravatar image

CrazyDave2345
55447
accept rate: 0%

2

Another solution is to use a union, using parentheses:

(way(104178011);way(18916837););

Not important for simple output, but unions are useful for more complicated scripts.

(31 Jul '15, 17:59) maxerickson

@macerickson Yeah its more formal and stuff.

(31 Jul '15, 22:16) CrazyDave2345

To get the result shown in UI, run this query:

[out:json];
way(id:104178011,18916837);
out body;
>;
out skel qt;
permanent link

answered 10 Apr '23, 08:03

Mappist's gravatar image

Mappist
11114
accept rate: 0%

edited 10 Apr '23, 08:04

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:

×85
×65

question asked: 31 Jul '15, 16:07

question was seen: 17,861 times

last updated: 10 Apr '23, 11:48

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