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

In a city-sized area, I'm looking for buildings that have more levels than 12. I know that those are tagged with building:levels (untagged buildings are not interesting in this case). I have been trying to get them from Overpass Turbo, but AFAIK there's no way to say "find value > 12", and matching way["building:levels"~"^[234][0-9]$"]; times out (and only matches 20-49 anyway).

Is this the right tool? If so, how should I do this? If not - should I perhaps get an OSM extract and process it as XML with some other tool?

asked 26 Feb '16, 10:18

Piskvor's gravatar image

accept rate: 37%

@mmd: While fiddling with the OpT query, I have found a working solution - I had a typo in there :(

(26 Feb '16, 11:29) Piskvor

BTW: Here's a link to the respective feature request: https://github.com/drolbr/Overpass-API/issues/78

(26 Feb '16, 11:36) mmd

I have found a way to hack around this in Overpass Turbo. Apparently, it's not possible to directly compare numbers, but it's possible to use regex - match "100-499" or match "20-99" or match "13-19". It's still not foolproof (fortunately, this key is unitless), but works with buildings up to 499 floors:

// gather results
  // 100-499
  // 20-99
  // 13-19
// print results
out body;
out skel qt;

(Yes, I'm aware that with regex, I now have two problems ;))

permanent link

answered 26 Feb '16, 11:33

Piskvor's gravatar image

accept rate: 37%

edited 26 Feb '16, 12:14


way (if:number(t["building:levels"])>10)  ({{bbox}}); (._;>;); out;

Based on Overpass API/Overpass API by Example: Buildings that are taller than they are wide

permanent link

answered 14 Jan '22, 08:37

Marc's gravatar image

accept rate: 0%

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: 26 Feb '16, 10:18

question was seen: 3,318 times

last updated: 14 Jan '22, 08:37

powered by OSQA