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

How would you add bounds for the frame that you run your overpass query on? Aka export the bounds into the xml raw data file

(this question was posted to that answer to another question before)

asked 22 Sep '15, 21:40

brettbarkley's gravatar image

brettbarkley
16111
accept rate: 0%

converted 23 Sep '15, 06:10

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

note: I have moved your question into a new question entry as it seems not to be tightly related with the original question at the older entry.

(23 Sep '15, 06:11) aseerel4c26 ♦

Could you please explain your question/problem a bit more? I fail to fully understand it. What do you mean by "bounds"?

(23 Sep '15, 06:12) aseerel4c26 ♦

I guess he looks for a way for saving the bounding box from the Overpass query also to the output file.

(23 Sep '15, 07:35) scai ♦

Assuming you're using the overpass turbo wizard, you will not get any kind of bounding box information in your Overpass API result.

Although this is not really documented, a feature called global bounding box might come in handy in your case: it will add that bounding box detail to your response you didn't get so far. Simply add [bbox:{{bbox}}] to your query like demonstrated in the following query: http://overpass-turbo.eu/s/bC5

Bounding box details are now automatically added to the Overpass response:

  "bounds": {
    "minlat": 41.8926,
    "minlon": 12.4936,
    "maxlat": 41.8932,
    "maxlon": 12.4953
  },

If you're using XML output mode instead, Overpass API will produce a slightly different format:

 <bounds minlat="41.8912" minlon="12.4922" maxlat="41.8954" maxlon="12.499"/>
permanent link

answered 23 Sep '15, 08:30

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

edited 23 Sep '15, 18:32

1

Thanks! That is what I was looking for!

(28 Sep '15, 18:19) brettbarkley

@brettbarkley: Please mark this answer as accepted if it solves your problem.

(28 Sep '15, 19:14) aseerel4c26 ♦

Hi @mmd, can you show a direct URL that only outputs the BBOX (in JSON, text or any format)? I try with your bC5 example and not see bounds. Using the out bb example of Out-Syntax the result is mixed with all other details.... Suppose that I need to retrieve only the BBOX of an administrative-area relation like GB-WNM.

(21 Aug '18, 11:11) ppKrauss
Your answer
toggle preview

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:

×483
×315
×9

question asked: 22 Sep '15, 21:40

question was seen: 4,521 times

last updated: 21 Aug '18, 11:26

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