[Mapcss] Associating overpass result sets with MapCSS, was: Re: Example for "set"

Bjoern Hassler bjohas+mw at gmail.com
Fri May 12 15:08:46 UTC 2017


Hi both,

many thanks - so basically a set helps to refer back to a complicated
selector? I.e. it helps to simplify MapCSS like this

way[a_set_of_some_long_and_very_complex_selectors] {
>    set needs_fixing;
> }
> way.needs_fixing[something_else] {
> }
> way.needs_fixing[something_else_1] {
> }
> way.needs_fixing[something_else_2] {
> }


Aun, can you say a little  more about "set tag=value"? I assume these are
css tags? What's the purpose?

Btw. my interest was originally because of this question:
https://wiki.openstreetmap.org/wiki/Talk:Overpass_turbo/MapCSS#Different_styles_for_different_result_sets
- i.e. the possibility of associating overpass api result sets with certain
MapCSS styles.

(I'll add these clarifications to the MapCSS wiki page as well.)

Thanks!
Björn

On 12 May 2017 at 15:29, Aun Johnsen <lists at gimnechiske.org> wrote:

> Bjørn
>
> I have used { set .minor_road } a lot in a paint style I use in JOSM, and
> I have plans for the same in Mapnik via pgmapcss, but until now have not
> have had opportunity to actually test it with pgmacss
>
> Quick example:
> way[highway=trunk] {
>     color:  red;
>     set .trunk_road;
> }
> way.trunk_road {
>     width:   10;
> }
>
> I hope pgmapcss accepts { set tag=value; } as I can see its uses in a
> rendering, (setting default values where values are missing, etc), but this
> is for obvious reasons discouraged in an editor such as JOSM.
>
> Aun Johnsen
>
> On May 11, 2017, at 21:05, Bjoern Hassler <bjohas+mw at gmail.com> wrote:
>
> Hello all,
>
> Would somebody be able to give an example, ideally in overpass-turbo, for
> the following:
>
>  Declarations may also be used to set the value of certain tags on an
> object:
>  { set tag=value; }   /* set a tag */
>  { set tag; }         /* set a tag to 'yes' */
>
> and
>
>  You can set tags beginning with a full-stop to simulate classes:
>  { set .minor_road; }
>  You can then use the .minor_road test (as above) in the selector:
>  way.minor_road
>
> It's not really clear to me how these work. See also here
> https://wiki.openstreetmap.org/wiki/Talk:MapCSS/0.2#Example_for_.22set.22
> if you prefer to answer on the wiki!
>
> Many thanks!
> Bjoern
> _______________________________________________
> Mapcss mailing list
> Mapcss at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/mapcss
>
>
>
> _______________________________________________
> Mapcss mailing list
> Mapcss at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/mapcss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/mapcss/attachments/20170512/10c01cb7/attachment.html>


More information about the Mapcss mailing list