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

I was just trying to style an Overpass Turbo result by highlighting all buildings that contain a buildings:levels tag. I tried a query along:

[out:json][timeout:25];
// gather results
(
  nwr[building]({{bbox}});
  nwr[building]["building:levels"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

{{style:
  node, way, relation {color:green;}
  node["building:levels"], way["building:levels"], relation["building:levels"]{color:red;}
}}

According to our wiki in MapCSS tags containing other characters than letters and underscore should be enclosed in quotes. When I try to run above query, though, Overpass Turbo says the style definition got an error.

Is there a way to style non-letter tags in Overpass Turbo?

asked 02 Sep '20, 08:44

TZorn's gravatar image

TZorn
12.3k764225
accept rate: 15%

For the avoidance of doubt - the language used by Overpass Turbo and MapCSS are two completely different things.

(02 Sep '20, 10:26) SomeoneElse ♦

Not according to Overpass Turbo itself. In its help section it epxlicitly refers to MapCSS and links to the wiki page https://wiki.openstreetmap.org/wiki/Overpass_turbo/MapCSS. That page in turn refers to the general MapCSS wiki page: https://wiki.openstreetmap.org/wiki/MapCSS

(02 Sep '20, 10:30) TZorn

Removing the quotes completely for the style definition works for me:

[out:json][timeout:25];
// gather results
(
  nwr[building]({{bbox}});
  nwr[building]["building:levels"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

{{style:
  node, way, relation {color:green;}
  node[building:levels], way[building:levels], relation[building:levels]{color:red;}
}}

According to the documentation this is not allowed, though.

permanent link

answered 02 Sep '20, 09:19

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

I'm probably never going to use a query like this but would someone please take the time to correct the documentation.

Many thanks,

(02 Sep '20, 10:07) AlaskaDave

I'll be damned. I'm pretty sure I had tried that already. But you are right, it does work.

(02 Sep '20, 10:24) TZorn
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:

×228
×65
×1

question asked: 02 Sep '20, 08:44

question was seen: 964 times

last updated: 02 Sep '20, 10:30

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