Overpass: define bbox by set

Is it at all possible to define bbox for query as “a bbox that contains all elements of a set”?

What I really want to do at the moment is:

  1. get all the waterways with name=Liwka in Poland into a set named, say .myWaterWay

  2. get a bbox, containing all the elements of the set .myWaterWay

  3. get all the waterways in the above bbox

This would get me all the waterways around Liwka, that I could load into JOSM, select all the waterways named "Liwka" plus all the waterways that should be named "Liwka", but somehow they have no name in OSM, and do something to them (like, create a waterway relation).

Liwka is, of course, just an example, I’m looking for a way to simplify creating waterway relations correctly.

Bounding boxes need to be provided as values, i.e. it is not possible at this time to have some kind of parameter here. Breaking it up in two queries would of course be possible, I guess that’s not what you wanted.

However, the next Overpass version will come with a new complete statement, which could be useful here.

See https://github.com/drolbr/Overpass-API/issues/95#issuecomment-66907630, example 1 - which starts with one river and downloads all upstream waterways.

This would be even better for waterways.

You probably know that you can do it in two steps in JOSM.
First download the data for step 1 with the overpass api, next press 1 to “zoom to data”, next use overpass api
to download all waterways.

No, can I?
So far I’ve used Overpass in JOSM with predefinedd searchArea only.

Yes, just use query wizzard with

  1. waterway=* and name=Liwka in Poland
    for the first and simply
  2. waterway=*
    for the 2nd query. Now the bbox of the zoom area is used.

Gee, it works and it’s exactly what I wanted :smiley:
Thanks!