Logo TIB AV-Portal Logo TIB AV-Portal

Creating Stunning Maps in GeoServer: mastering SLD and CSS styles

Video in TIB AV-Portal: Creating Stunning Maps in GeoServer: mastering SLD and CSS styles

Formal Metadata

Creating Stunning Maps in GeoServer: mastering SLD and CSS styles
Title of Series
Part Number
Number of Parts
CC Attribution 3.0 Germany:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Release Date

Content Metadata

Subject Area
Various software can style maps and generate a proper SLD document for OGC compliant WMS like GeoServer to use. However, in most occasions, the styling allowed by the graphical tools is pretty limited and not good enough to achieve good looking, readable and efficient cartographic output. For those that like to write their own styles CSS also represents a nice alternatives thanks to its compactness and expressiveness. Several topics will be covered, providing examples in both SLD and CSS for each, including: mastering multi-scale styling, using GeoServer extensions to build common hatch patterns, line styling beyond the basics, such as cased lines, controlling symbols along a line and the way they repeat, leveraging TTF symbol fonts and SVGs to generate good looking point thematic maps, using the full power of GeoServer label lay-outing tools to build pleasant, informative maps on both point, polygon and line layers, including adding road plates around labels, leverage the labeling subsystem conflict resolution engine to avoid overlaps in stand alone point symbology, blending charts into a map, dynamically transform data during rendering to get more explicative maps without the need to pre-process a large amount of views. The presentation aims to provide the attendees with enough information to master SLD/CSS documents and most of GeoServer extensions to generate appealing, informative, readable maps that can be quickly rendered on screen. Andrea Aime (GeoSolutions)
Keywords GeoSolutions
non-existence Graph files mapping Meeting/Interview
standards Slides presentation mapping Open Source time zone Java Enterprise geometric visualization Rendering Conversation compactness cover standards hard server Imaging Java clients bits CSS category Computer animation intrusion detection systems data fusion box Windows extent
presentation Sequel Development gaps interactive symbolic van product elements simplex editors sum triangle web Context mapping polygons expression interactive symbolic lines Symbolic Types category Computer animation editors family Results
point complex lines time time zone branch Mass sun computational fraction Types different sum monster classes data types management mapping point lines equivalence Symbolic Symbolic Types means Computer animation triangle classes
point unit lines point SLAM lines functions Average rules powerful CSS Symbolic CAN-bus inclusion category means Computer animation Rolling classes sum management
man inclusion Computer animation Forum code part Symbolic PDF
default geometric bottom words Computer animation mapping polygons organization default
polygons category Pointer Computer animation width files 3rd
fibonacci series sin patched images symbolic maximal lines shape fields icons image Sonderzeichen Computer animation spacetime
area modules rules CAP scale sin time Development law mid coordination bits sun van product Computer animation Em's level sum form systems
rules control Super maximal variance bits part sun fields Symbolic number MKS-System Computer animation Void's level sum PDF flux Chi-Quadrat-Verteilung
category Pointer Computer animation case configuration life bits model fields spacetime classes
point Types Propagation Computer animation width lines URN Rolling lines sum simulation
point dots bits proposition lines Symbolic mining category Computer animation rates case terms URN circle simulation sum
point control point 3rd attributes lines Continuation Arm Emulation local clustering configuration Computer animation configuration Partial band sum WAN
man curve pixel mapping lines time displacement neural network sets bits lines sun Emulation Computer animation Meeting/Interview case single Now position systems tasks
point rules polygons time displacement polygons inner sets coma maximal part van particle goods Computer animation convex hull sum Internet cookies
point polygons font control mapping SLAM polygons 3rd van independent set Computer animation configuration URN Forum unite data types
point Zoom's mapping decision time 3rd web sign category inference sign Computer animation configuration level level unite position Partial pressure systems
man standards email unit mapping Regular Expressions mapping concentrations cover expression coma Ext Airy Functions clients dem Coloured particle Computer animation case functions Now singularities absolute values
Transformers 3rd maximal gute Transformers lasers Types geometric Pointer configuration Computer animation contrast URN vertical contrast extent geometric
man sources screens hard Slides information Transformers Coloured Congruences processes Computer animation different Snake Rendering Display level alpha multiple
Runden time DoS rules local clustering single Types orders configuration Computer animation classes category alpha sort systems extent
modes font files information width time zone argument matchings translation Transformers parity Computer animation configuration mix Rendering level input curves category Cats kernel
rules email Zoom's branch rules information image Computer animation lies editors input editors data types
Regular Expressions constraints server moment experts symbolic lines translation ease of use geometric Spring Computer animation raster classes
modules presentation states time interactive analysis water rules versions category Erweiterung Meeting/Interview normal Right conditions
standards Actions Blocks First-Order expression Databases Mass clients rules Indexable double rates Meeting/Interview memory case Display parametric sort
Computer animation
ch file into the next graph
will tell us how to Princeton and maps with just over kilobit afternoon everybody well I don't know if they're maps are going to be starting to assuring and talk about the existence of the so just
my employer where a company based in Italy would support your several and all the open source technologies to in
particularly going to make a presentation about some styling examples both in Italy and CSS and so these our old friend the uh is or is not just a standard these XML-based very valuable the harm that landed at about a lot of people are the window that and editing actually even if it really wasn't meant to be and everything I know we and and then for those slides and I'll show only the relevant bits because the for this debate then we have g of CSS uses sensors or is not Carter CSS it's not just our own on approach at CSS uh the cover success is driven by the market maker property names if you look at it uh reduces sensors remember idea so the property names instead so it's meant to be born and to be translated incompatible with this so the it's a simple common but elegant and what not it's not a standard and you just heard about it conversations is different
and so just as features so and then you just as his family of what was about present that has a very complex syntax because the symbolization triggered by key properties assigned from using stroke only gonna have a line symbolizes for use feeling when I have a polygon symbolizes and so we have some contact expression and the filtering thanks to this sequel simplex uh the cascading keeps complex finding quite compact and we have an interactive editor for productive style elements so you just type your style and then we apply you see the result on the map and you keep on doing so some examples
of all in line and polygon
styling so points failing in the CSS we have a selector which is star this is because inducer we typically build the 1 style for 1 layer it's not to 1 side for a base map so star means match every feature and then I'm gonna use a triangle is the symbol and inside the mark I wanted it the feeling of the market to be modeled you see you don't nesting there is a new feature that i'm writing right now it's stuck in in a branch of my computer by it's gonna land the soon I hope for just over that the equivalent in SLD is that monster over there if I have a complex
point map and I have 1 symbol pair per class and maybe I have a labeling for the things that I wanted to to display and so on in so the I have to prepare 1 filter and that made me you may look like that and gives as he was secretly you 1 and full name like shopping and then maybe have a mass denominator and then by I know the time pointing to a particular symbol for this map uh well a slightly more complicated 1 and 600 lines of x amount for 6 different point types there's a lot of repetition it's annoying
if I do the same in CSS I can actually show that almost the full style over there by specify only
once the basic market property is like size and so on and then I specify for everything uh the labeling so I'm linking label to the full name property and I'm according the labels between the started below the point and it's gonna be aerial and so on and so on and then and then I'm going to play with the overrides that and the nice thing about cascading is that i've defined what common a common ruling identical that doesn't mean that we match everything and then I just specify the right singular rules so I'm saying yes even gives he is 2081 and full is like shopping or full name is like more than user and item so I'm down from 600 lines 270 lines so it's possible to use yeah
Fons's market is is not user has been possible and use of a forum part while
use just a particular syntax for this symbol name PDF columns let's let's the formal name and then the next code that you can find On much are much depicted
at the bottom we have a more complex marks like the wind barbs and I have a syntax saying something like yeah it's going to be a we mark the default 115 meters per 2nd and then if I wanted to have 2 peaks on 1 side or the other I can't specify the
m is fear because of the word middle mythological organization says in the north there should be a one-sided the assault should be on your side basically someone who can read these kind of map will tell me if this might be a lot of salt just by looking at it I don't know filling polygons
solid feeling is sort of like a that is super simple think so great
feeling outlined black stroke with 0 . 5 that's how we do it in a new in CSS oilfield property of struck property and with in a the it's a bit longer it's not so crazy the only thing that might drive you crazy is having to specify chorusing next coded as opposed to just say like gray sewing as we have a name of course that we don't even to leave here
a well I have an example feeling with the repeating images of so that's the graveyard symbols from OpenStreetMap actually assigned tiny icon is it already has some space around the cross and so on I just have to say OK so the field is gonna be and then you are well I'm pointing to the image of what I want to repeat over and over and over and and that's the in the CSS and so the are actually looking at similar In this respect of course success is more compact I
have some special marks for filling with the patches uh so on-line reminds slash backslash last stonings they get repeated over and over and over and they give you the illusion that there are many lines in fact it's a tonal like that will spend a small payments
so that's an example feeling with hatch marks the so that's a all production area around the river and then there you can see how we specify the scale dependency compared to the counter CSS we use a skill minute not z-index well why the Coase because of the does that and because user is not cost the true serving time secondo developments whatever
coordinator for the system of whatever scale so we like to be a bit more form in that respect and also because sometimes together you get subtopic custom gridset that you have to serving form my legal reasons like you have to provide a wide 1 thousand module 5 thousand 110 thousand 120 thousand and this caves are fixed by the law so you end up with the times of levels not winning so what if any the
levels just my number is a bit too much constraining anyway so that's how I specified that the symbol and then i have that called field which is random superclass saying OK inside the field use this problem the horror and the size of a besides control variance departure is the smaller the size the denser the part
I can also feel low with the PDF market using that same before so in
this case the picking up the cross from the Winding's formed and like yeah he there you can also see how 1 does repeating the filling in the CSS so we don't have to the tags but we just repeat the the property that triggers then the feeling something 1st feeling that color and
then which is a very light between and then on top of it field with the other classes and then I have that Gt graphical modeling option that basically space is a bit about the cross is so that they are not smashed together in the filling the for life I have
1 simple example here so strong in their industry with 5 and you get this really
simple if you wanted to have better raise their stash this point types supplying like that a line over there which is adopted you gonna use propagation that isn't just wanna say to so to speak so
bend down to pick something up to pick something that except itself and I get my mine put dotted lines of course I can do whatever repetition 1 so I I could say repetition rate 10 of 4 2 for and I would again like the line itself so and you just
have you can mix and match marks and that she is so In this case on doing something a bit more complicated I have it became a symbol of a circle that space in such a way but he mixes with another the best line so I'm basically saying OK stroke the the baseline is that so it would be dead in the line and then simple circle to repeat the circle and then this proposition rain extend 14 formalized in 618 for their point and then a use dash offset which is a property that moves the the beginning of repetition so by saying the sentence saying I'm of starting at the beginning with 0 here but keeping the this then I'm skipping 4 of these and then applying this then faces and the rest of the petition is just a way to shift to 1 of the dictionary is to coordinate of the tool the so that they match to get in terms of labeling we
have 1 medium band options because those are labeling is hard and and getting the labeling the the way you want requires some work and a lot of control some examples
here so these are point labels we want the label to be below the points and we wanted to have all wrapping so if the label is too long I don't want it to be very very large I wanted to drop on the next line and eventually the next line and so on some challenges over OK autograph 100
pixels this is an example of flying labels in CSS instead
of labeling roads this kind of the most difficult task normally it requires quite a bit of work so I'm playing with a priority to make sure that these labels are have a high priority that we they will show up on on top of all the labels in case of grouping the labels because what this is typically a problem with the world labeling each segment is normally as a separate feature but I do want to label their old 15 times so enabling grouping to that user what OK take all the segments with the same label put them together as a single line and label dot line the set of all sets phone line to have a curved label like Boston drive over their displacement to allow the system to move the label along the line in case the natural position in the middle of the line is busy with them and all the labels and the repetition I have a very very long line just to make sure that people don't have to search across the map defined in the label the
labels this is pretty much the same as point labels not putting so I have a little rather have a max displacement just like before 1 thing that we have induced over this goodness of fit so the problem is I have a label it might be very long
and I have a polygon would be very small part of the particles level so do I actually labelled the polygon are not available would be like 20 times bigger than the than the polygraph play label that was the normal behavior will be you know we don't label that because the label is way too big Our settings are such that the label must be can be up to 3 times as big a as big as the polygon but he complied with the goodness of fit and say no it doesn't fit the 90 %
inside so if the label is thinking the polygon it will be the only if it's exceeding the polygon it will not if you just want to make sure you just put 1 and a label would be drawn only if the if it fits a fully inside the
policy we have a way to control label obstacles so sometimes certaine points in the maps are to be considered obstacles like you don't want to label to call the then you want the point show up like in this 1 and so you can model them as a label obstacles using this vendor option so that they will never be covered by the label we
also have the operated pretty laid out to support so user is doing on the fly let level placement which has to be fast which also means we have to take some quick decisions and sometimes they're not that the best decisions so a you can tell just a ratio of 0 point layer that contains that up to a position of every label that you want to place because you put them there
manually or you have another system that to whatever time it took to to place them you can this true when the option able to conflict solution that allow partial label special labels are labels that are partly inside the map and partly outside industry can never know what happens on the other side so if you if you have a Europe please relays laid out labels you can enable this to properties and that's how IGN inference is doing their own web maps they spend quality time laid laying out of the labels and they don't want to separate the most mess with that roster signing presses
finding is that while the usual chloramine so when when you style rosters when when there are certain not containing colors but they contain digital additional the log of the concentration of a pollutant whatever so in this case you apply Koroma 1 caller from particle quantity of sustainable it so you might want to have some some visible
0 it's possible now to put 2 expressions singular maps so that you can now that i from the client to what color you will get the so we
have support for a constant current In contrast enhancement on the fly as well and we have a few extensions there compared to their basic assumes to contrast-enhanced conveys the owner of the minimum and maximum values that you provide
transformations so we have 2 types of transformations and use of and we have the geometry transformations where you take the the origin of geometry and you apply and offset the extract the vertices of it's just taking the geometry and doing something with or we can
have the rendering information and and religion were not supported in CSS but we do know it's taking the entire later in applying a process on the fly to paint something different so I have minus them map on the back and I'm on the fly extracting contour lines to display contour lines so we have support
for congruent color many and composer Jean
and governance keep over this because I'm running out of
time we have support for that augmenting which is the ability to to tell us OK underpasses below the normal rules which are below the overpasses and so on and you can be in the a of this system of this
type to depict this crazy road and rail crossing somewhat in Germany
what's new in just over 2 9 into 10 well in in just over 2 9 we added an option to disable the cascading so you can add other active on top of the of the file to disable cascading because some people were getting confused by the fact that that that will likely and that the mixing of so if someone wants to have something more similar to us so the but with a otitis assumed that's the way we
have our we had the support for that information that's going 10
on working in a branch right now to add support for the nested the rules so is true are actually equivalent but this 1 is more compact because it's using nested rules so we have a new
style editor images of up to 10 which is gonna unified experience that we use you know I'll have with the CSS editor or for all languages so you just go in and user style and edit your son and you have a preview in there with CSS support and what not and
what if you don't like to just write on side but you want to to to point and click during the the constraint before the spring I started the hacking some suppose class to improve how you JS is exporting its will be I found a few things to fix and at the very least some basic science are going to come through to come through you server in a usable way so there's a parallel work and exporting labels and the sure how far higher than they are in them physically looking for sponsoring 4 lines are large undertakings such as that of tribute to that even the symbology and stuff like that which is what status implies an expert which are not of available at the moment and that's going to be a large and that's
thank thank you very questions on the other hand how is the documentation support for years this is of this state there's there's plenty of it the conditions for the assessment yes all if you poll well among manipulated to it right now but if you go to the official documentation of jews are you going to their extension modules and you will find extensive support for CSS all the property is how cascading works how you can disable it and there's also a CSS to cook a book like this will be 1 without of examples you thanks for
the presentation is there and you can convert my existing as the styles in any way similar to manage analysis the same answer as only the provided before due to cascading there's no way to take care of flatter so the mother has no interaction between rules in going back however since I just added that uh we just added that support to disable cascading 1 could actually rights included now to go back from a so the 2 1 norm cascading version of CSS this just gonna take time and and water among Christians the 1st is that
possibility to use parametric gesture rates to try to fly and the discovery of thinking about it right there was once a discussion about making fun of so usually it's not possible like in standard so the first order sit do not think about leaving us expression support and I'm trying to remember like there was a discussion and probably past floating around to support about so that people could get the history from the database and I think it's going to but I have a very good memories about it so I would have to double check it's probably like you you might want to try to 7 to 9 and see that works but yeah maybe you have right what about digital indexes then averaging the impression that did this styles where the upper layer data layer it yes and what do they invest in case you have that work across various because you could have something in
in there right away layer and solving wrote this yes yes you do absolutely so there is a active that you add the which is a sorting rule of any of the if you put the tools sub-sequence layers in the same sort or 3 or 10 provide that they are in the same block there is nothing in the middle which is not in the same group then they will sort out uh across layers so that's how I got the roads and trails tools in the display of a lot but you have to put them side by side that's 1 of the problem with double the mass the client can only decided they're all of them and if they don't they don't end up a putting those layers back-to-back let's the and it was just the thank you for not it's thank you once again the