[Mapcss] Nesting Selectors

Aun Johnsen lists at gimnechiske.org
Sat Apr 28 07:57:57 BST 2012


Trying to write complicated rendering rules I am for this to simplify, and
reduce the number of rules. It will make maintenance much simpler too

Aun Johnsen
user Skippern
sent from Android
On Apr 28, 2012 3:51 AM, "Komяpa" <me at komzpa.net> wrote:

> Hi!
>
> > This would allow an object to be checked for the existence of a highway
> tag (for example) exactly once
>
> I'm not sure that it's the thing worth implementing.
> All this stuff can be guessed by engine on stylesheet parse time,
> considering you support "exit" statement. I still think it's a hack,
> and for me (in both komap / kothic js) stylesheet gets compiled into
> native python/js code, so it's fast anyway.
>
> If you want to omit a lot of consecutive checks, you can make a
> bitfield cache for the most popular rules. So, on parse time:
>
>  - determine the most popular (8/16/32/64 - unsure of architecture)
> rules, number these as 2^i;
>  - for each {style} block in sheet, remove rules that went to cache
> and add a single integer that will store a sum of cached rendering
> rules numbers (say "style_rules");
>  - on rendering time, as a first pass do all cached checks and store
> in a single integer as a sum of passed checks (say "obj_rules");
>  - later, on doing checks against each {} block, do a check for
> ((obj_rules AND style_rules) EQ style_rules).
>
> kinda that. If you do decomposition right ([amenity=telephone] is two
> rules, [amenity][amenity=telephime]), you'll gain some speeds without
> bringing ugly non-css into mapcss, and even on stylesheets written not
> in your way.
>
> --
> Darafei "Komяpa" Praliaskouski
> OSM BY Team - http://openstreetmap.by/
> xmpp:me at komzpa.net mailto:me at komzpa.net
>
> _______________________________________________
> Mapcss mailing list
> Mapcss at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/mapcss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/mapcss/attachments/20120428/82e13d42/attachment.html>


More information about the Mapcss mailing list