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

Is it possible to declare the variable area and store a bounding box in it?

The following works fine: id-query {{nominatimArea:Netherlands}} into="area"

and then i can ask for it with: area-query from="area"

However bbox-query s="51.92" w="4.79" n="52.31" e="5.64" into="area"

and then ask for it with: area-query from="area" gives an empty result.

Is it possible store a bounding box in a variable? And if so, what's the correct code for it?

asked 28 Jan '16, 00:30

Steijn's gravatar image

Steijn
61569
accept rate: 0%


It is possible in Overpass Turbo, using the custom shortcut syntax:

http://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Queries#Custom_Shortcuts

But this feature is coming from Overpass Turbo and won't work on queries sent directly to Overpass API, only on queries made using the Turbo interface.

Depending on what you are retrieving, it may also work to set the bounding box on the osm-script element.

Something like (untested): <osm-script bbox="1,2,3,4" output="json">, it will then apply to all queries in the script.

Another solution would be to use a script written in another language (like Python or Ruby or ...) to generate your Overpass script from a template.

permanent link

answered 28 Jan '16, 13:21

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

edited 28 Jan '16, 13:39

Hi,

thank you for your response. :)

I decided to keep it simple and repeat the bounding box in each query. But thanks anyway as I now realise there is a difference between Overpass Turbo and Overpass API.

(02 Feb '16, 23:55) Steijn
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

question asked: 28 Jan '16, 00:30

question was seen: 3,741 times

last updated: 02 Feb '16, 23:56

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