To get a unique merged bounding box (bbox) from multiple relations returned by your Overpass QL query, you need to:
The Overpass API returns each relation with a bounds field if you use out bb;. The bounds field contains the min/max latitude and longitude for that relation.
Example of a relation with a bbox:
json
To merge all bboxes into one, you need to find the minimum and maximum latitude and longitude across all relations.
minlat among all relations.minlon among all relations.maxlat among all relations.maxlon among all relations.If you want to do this programmatically (e.g., in Python):
python
The output will be a tuple like:
(48.8556, 2.3512, 48.8616, 2.3592)
This is your merged bbox.
If you want to do this directly in Overpass QL, you can use the union statement and then request the bbox of the union:
ql
This will return a single bbox for the union of all relations and their members.
Summary:
This Chat is read-only. Login to resume chatting.