Wednesday, 16 August 2017

Geoserver CSS plugin - combining styles



I'm currently trying to write some SLD styles using the CSS plugin in geoserver. The problem is that the plugin merges single rules into complexed ones, ie. the following code generates 5 rules instead of 3 and the layer isn't rendering correctly. It all works ok when I use only one type of key, like define styles only for boundary or only for highway. I've found THIS, but I don't know how to understand it. Any ideas? Please help.


[highway = 'primary'][@scale<4000000]{
stroke: black;
width: 1px;
}

[boundary = 'administrative'] [admin_level = 2]{
stroke: #B19AC2;
stroke-width: 2px;
}


[boundary = 'administrative'] [admin_level = 4]{
stroke: #B19AC2;
stroke-width: 1px;
stroke-dasharray: 3 2;
}

gives this:


    


Default Styler

Default Styler





admin_level
2



boundary
administrative


highway
primary




4000000.0


#B19AC2
2








admin_level
4


boundary
administrative



highway
primary



4000000.0


#B19AC2

3.0 2.0








admin_level

4


boundary
administrative


highway
primary





admin_level
2


boundary
administrative



highway
primary



highway
primary




4000000.0









boundary
administrative


admin_level
2



4000000.0



#B19AC2
2








admin_level
2


boundary
administrative


highway

primary



4000000.0


#B19AC2
2








admin_level
4



boundary
administrative



4000000.0


#B19AC2
3.0 2.0








admin_level
4



boundary
administrative


highway
primary




4000000.0


#B19AC2
3.0 2.0



first







No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...