Why not ask your question on the new OpenStreetMap Community Forum?


I am using Overpass api to query Building data from OpenStreetMap. the query string is like this

(way[building](bbox);node(w););out body;

This works really fine (the bounding box is specified by Openlayers).

Now i want to improve it, such that only 10 buildings are returned by the query, to speed up the process. For this i used the query

(way[building](bbox);node(w););out 10;

but doing this returns only 10 nodes like here

What i want is 10 buildings.

asked 04 Mar '13, 05:13

amritkarma's gravatar image

accept rate: 11%

Updated Sep 2014 due to new available features

(11 Sep '14, 13:21) mmd

I'm sorry, this is not feasible yet. I'll add it to the list of suggested features.

permanent link

answered 04 Mar '13, 07:07

Roland%20Olbricht's gravatar image

Roland Olbricht
accept rate: 35%

In the meantime this is now possible by using the new geometry feature:

out geom meta 10;

It will display exactly 10 buildings.

Note that there's a small rendering issue in overpass turbo at this time, as only the boundary box is shown. However, as the geometry feature is rather new, I'm sure the rendering will be ok pretty soon. This has no impact on the query itself, though.

Try on Overpass Turbo: http://overpass-turbo.eu/s/50g

permanent link

answered 11 Sep '14, 13:20

mmd's gravatar image

accept rate: 37%

edited 11 Sep '14, 13:30

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



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:


question asked: 04 Mar '13, 05:13

question was seen: 4,521 times

last updated: 11 Sep '14, 13:30

powered by OSQA