Hi,
I'm using GeoServer 2.0.2 together with the CSS plugin (nightly build
downloaded 8th of august). I've deployed this in Tomcat 6.0.29 under
Windows.
I'm trying to style a road network based on the scale of the map, so
that some road types are only shown when zoomed in, etc.
Here's the outline of the CSS (stripped the details since I'm guessing
they aren't relevant):
/* @title 5011 - motorvag */
[KKOD = 5011] {
...
}
/* @title motorvag-text */
[KKOD = 5011][@scale<3000000] {
label: [VAGNR1];
...
}
/* @title 5213 - allman vag */
[KKOD = 5213][@scale<2000000] {
...
}
/* @title allman vag-text */
[KKOD = 5213][@scale<500000] {
label: [VAGNR1];
...
}
What I want to accomplish is:
* KKOD 5011 should always be shown
* Labels for KKOD 5011 should be shown if scale is less than 3,000,000
* KKOD 5213 should be should if scale is less than 2,000,000
* Labels for KKOD 5213 should be shown if scale is less than 500,000
But this CSS is turned into an SLD which shows *all* roads, regardless
of KKOD, at scales lower than 2,000,000 but rendered as if they had
KKOD 5213. I think the problematic SLD rule that is generated is:
<sld:Rule>
<sld:Title>5213 - allman vag </sld:Title>
<sld:MaxScaleDenominator>2000000.0</sld:MaxScaleDenominator>
<sld:LineSymbolizer>
<sld:Stroke>
<sld:CssParameter name="stroke">#DDD8C7</sld:CssParameter>
</sld:Stroke>
</sld:LineSymbolizer>
</sld:Rule>
For some reason, the KKOD conditional I specified in the CSS isn't in the SLD.
Is this a bug, or am I misunderstanding how the CSS selectors are
supposed to work? How should I go about accomplishing the desired
results I describe above?
I really like the CSS way of designing, since it's so much more
compact than the annoyingly verbose SLD, but this issue really
prevents me from switching to CSS.
Best regards,
Per Liedman
--
Per Liedman
Software Engineer
Kartena AB
per.liedman@anonymised.com
http://www.kartena.se
031 - 77 44 397