Details
Description
Trying to convert this style with scale dependencies:
[PERSONS < 2000000] {
fill : #4DFF4D;
}
[PERSONS >= 2000000] [PERSONS < 4000000] {
fill: #FF4D4D;
}
[PERSONS >= 4000000] {
fill: #4D4DFF;
}
* {
stroke: black;
stroke-width: 0.2;
fill-opacity: 0.8;
font-family: "Times New Roman";
font-size: 14;
}
[@scale > 40000000] {
label: [STATE_ABBR];
}
[@scale < 40000000] {
label: [STATE_NAME];
}
I'm getting quite a bit of duplicated rules, but also colors that look like:
<sld:CssParameter name="fill"> <ogc:Literal>java.awt.Color[r=128,g=128,b=128]</ogc:Literal> </sld:CssParameter>
My guess is that the code building the style is setting in a java.awt.Color instead of a string or something like that... maybe it's a bug in the encoder, but it's a little odd that the first symbolizers have the colors properly translated, just the last ones have this issue
Issue Links
- depends upon
-
GEOT-3036
Default fill parameters use Color object instead of hex string
-
I've noticed this before; it seems to happen only on the fills for TextSymbolizers, so I suspect a bug in the GeoTools encoder. If you add a
Then the SLD should have regular hex codes instead of java.awt.Color...
As for the duplicated rules, well, it used to be worse
Eliminating repetition for rules that don't change between scale levels is something I'd like to do in the future, but as long as you don't need a legend it shouldn't cause any visible problems at rendering time, so it is a little lower on the priority list than some other issues with the CSS converter.