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

4
1

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

amritkarma
684212941
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
6.7k36489
accept rate: 36%

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

way({{bbox}})[building];
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

mmd
5.7k15388
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

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
×290
×252
×122
×23

question asked: 04 Mar '13, 05:13

question was seen: 4,762 times

last updated: 11 Sep '14, 13:30

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