Hi,
those that have followed the CSS discussion lately know that I'm
working on a CSS -> Style translation mode that won't ensure
the rules are all exclusive to each other, but will make the
rendering engine match the first encountered SLD rule and bail
out instead.

This translaction mode is a lot less expensive, as we don't have
to run the symbolic expression evaluation engine that figures
out if a rule filter covers (fully or in part) another rule filter
(rendering
it useless to emit).
The difference is not small, on complex styles driving different bits
of the styling against different variables we are talking about
a couple seconds for the fast mode vs several minutes (sometimes
hours) for the expensive one.

The downside of the fast mode is that it's going to generate in the
output rules that obviously will never be matched, because the
ones before are going to catch all the features.
As an example, say you have something as simple as:

@scale < 10000 {
  stroke-width: 10;
}

@scale > 10000 {
  stroke-width: 5;
}

* {
  stroke: blue;
}

In the equivalent SLD you should get only two rules, blue 10px for scale <
10000,
blue 5px for scale > 10000, but in the simple mode you'll also get a last
rule, without a filter and scale dependency, that is blue 1px.
This is because in this translation mode no effort is made to see if a
certain
rule is covered by others already emitted, or not.

Now, in terms of map rendering nothing changes, in terms of legend
generation
it does instead, we get an extra symbol in the output that should not be
there.

Now, what I have now is a programmatic switch to control which
translation mode to use, but I don't think it's going to cut it, I believe
it's better
to have a way to drive which mode is used from the css instead by using
a directive.

Stealing a page from LESS (a css preprocessor) we could have:

@translate: exclusive;

@scale < 10000 {
  stroke-width: 10;
}

@scale > 10000 {
  stroke-width: 5;
}

* {
  stroke: blue;
}

The @translate values would be:
* exclusive (generate fully exclusive rules, take the time to evaluate the
coverages)
* simple (fast translation mode, includes generating rules that are never
going to actually match a feature)
* flat

The tool would default to exclusive, as I believe most of the styles are
not that complicated, and
people still expect to have good legends showing up, one would just change
the translation mode
to "simple" mode for those styles that take forever to translate.

Flat is a last minute addition. After a few discussions with people getting
started with GeoCSS,
and seeing the ySLD effort, it's clear some people are getting confused by
cascading and
the need to mix all rules, quoting one discussion "isn't the responsibility
of the writer to
ensure the rules are exclusive?" (answer: no, to leverage cascading you
definitely
do not want to have them be exclusive).

So... adding a simple "flat" mode in which the css rules are just
translated 1-1 to SLD, without
any effort to combine them, seems a very simple way to give that audience
some
simpler syntax but keep on thinking in SLD terms (also simple code wise, we
just skip
the power set expansion and voilà, done).

Opinions?

Cheers
Andrea

PS: for those that know LESS, yes, it would be nice to have variable,
mixins, imports and
nested rules. All very nice... in time :-)


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Please, notice that GeoSolutions will be closed for seasonal holidays
from December the 24th to January the 6th
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to