This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

How to select multiple ways by id using Overpass API?

3

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%


3 Answers:

2

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;

answered 22 Jul '18, 14:16

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 10 Apr '23, 11:48

0

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

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

0

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

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

answered 10 Apr '23, 08:03

Mappist's gravatar image

Mappist
11114
accept rate: 0%

edited 10 Apr '23, 08:04