Mapping in GeoServer with SLD and CSS

75 %
25 %
Information about Mapping in GeoServer with SLD and CSS
Technology

Published on September 24, 2014

Author: geosolutions

Source: slideshare.net

Description

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 compact-ness 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 labelling 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 fast, appealing, informative and readable maps.

Advanced cartographic map rendering in GeoServer Ing. Andrea Aime, GeoSolutions FOSS4G 2014, Portland 8th-13th September 2014

Overview Who we are Example map Raster styling Scale dependent rules Hatches, patterns and dashes Point Symbology Labeling Transformations Cross layer filtering FOSS4G 2014, Portland 8th-13th September 2014 2

GeoSolutions Founded in Italy in late 2006 Expertise •Image Processing, GeoSpatial Data Fusion •Java, Java Enterprise, C++, Python •JPEG2000, JPIP, Advanced 2D visualization Supporting/Developing FOSS4G projects GeoTools, GeoServer GeoBatch, GeoNetwork Clients Public Agencies Private Companies http://www.geo-solutions.it FOSS4G 2014, Portland 8th-13th September 2014 3

Introduction FOSS4G 2014, Portland 8th-13th September 2014

SLD vs CSS Styled Layer Descriptor OGC standard XML based, verbose, hard to hand edit Only showing relevant bits of the SLD GeoCSS CSS with extensions for map rendering Simple, Compact, designed for human beings Not a standard (several incompatible variants for mapping) Showing the full style, it’s that short FOSS4G 2014, Portland 8th-13th September 2014 5

Example map FOSS4G 2014, Portland 8th-13th September 2014 6

Example map FOSS4G 2014, Portland 8th-13th September 2014 7

Example map FOSS4G 2014, Portland 8th-13th September 2014 8

Example map FOSS4G 2014, Portland 8th-13th September 2014 9

Example map FOSS4G 2014, Portland 8th-13th September 2014 10

Raster styling FOSS4G 2014, Portland 8th-13th September 2014

A DEM and a color map SRTM from USGS Standard color map Just avoid the nodata values with opacity=0 FOSS4G 2014, Portland 8th-13th September 2014 12

A DEM and a color map Same as before, in CSS Solid intervals FOSS4G 2014, Portland 8th-13th September 2014 13

Hatches, patterns, dashes and plates FOSS4G 2014, Portland 8th-13th September 2014

Filling with patterns FOSS4G 2014, Portland 8th-13th September 2014 15

Filling with TTF fonts FOSS4G 2014, Portland 8th-13th September 2014 16

Hatches FOSS4G 2014, Portland 8th-13th September 2014 17

Hatches FOSS4G 2014, Portland 8th-13th September 2014 shape://vertiline shape://horline shape://slash shape://backslash shape://plus shape://times 18

Dashes FOSS4G 2014, Portland 8th-13th September 2014 19

Dashes FOSS4G 2014, Portland 8th-13th September 2014 20

Plates FOSS4G 2014, Portland 8th-13th September 2014

Plates CSS way FOSS4G 2014, Portland 8th-13th September 2014 22

Point Symbology 23 FOSS4G 2014, Portland 8th-13th September 2014

Point symbols •600 loc for 6 different points types •Painful… FOSS4G 2014, Portland 8th-13th September 2014 24

Point symbols •70 lines total •Power of cascading … 25 FOSS4G 2014, Portland 8th-13th September 2014

Dynamic symbolizers FOSS4G 2014, Portland 8th-13th September 2014 26

Dynamic symbolizers CSS way •Down to 15 lines FOSS4G 2014, Portland 8th-13th September 2014 27

Labeling FOSS4G 2014, Portland 8th-13th September 2014

Line labels FOSS4G 2014, Portland 8th-13th September 2014 29

Line labels (and more) CSS way FOSS4G 2014, Portland 8th-13th September 2014 30

Point labels FOSS4G 2014, Portland 8th-13th September 2014 31

Polygon labels 32 FOSS4G 2014, Portland 8th-13th September 2014

Label Obstacles FOSS4G 2014, Portland 8th-13th September 2014 33

Scale dependent rules FOSS4G 2014, Portland 8th-13th September 2014

Scale dependent rules Too often forgotten or little used, yet very important: Hide layers when too zoomed in (raster/vector example) Progressively show details Add more expensive rendering when there are less features Key to any high performance / good looking map FOSS4G 2014, Portland 8th-13th September 2014 35

Example FOSS4G 2014, Portland 8th-13th September 2014 36

Hide as you zoom in Add a MinScaleDenominator to the rule This will make the layer disappear at 1:75000 (towards 1:1) FOSS4G 2014, Portland 8th-13th September 2014 37

Alternative rendering Simple rendering at low scale (up to 1:2000) More complex rendering when zoomed in (1:1999 and above) FOSS4G 2014, Portland 8th-13th September 2014 38

Alternative rendering FOSS4G 2014, Portland 8th-13th September 2014 39

Alternative rendering, CSS way FOSS4G 2014, Portland 8th-13th September 2014 40

Transformations FOSS4G 2014, Portland 8th-13th September 2014

Geometry transformations FOSS4G 2014, Portland 8th-13th September 2014 42

Geometry transformations CSS way FOSS4G 2014, Portland 8th-13th September 2014 43

Rendering tx: isolines •No CSS support yet FOSS4G 2014, Portland 8th-13th September 2014 44

Rendering tx: point extraction FOSS4G 2014, Portland 8th-13th September 2014 45

Rendering tx: dynamic color map FOSS4G 2014, Portland 8th-13th September 2014 QGIS palettes GDAL pam stats Input raster Dynamic ColorMap Map! 46

Wind barbs FOSS4G 2014, Portland 8th-13th September 2014 windbarbs://$(value)[m/s]?emisphere=(n/s) windbarbs://15 [m/s]?emisphere=n 47

The End Questions? andrea.aime@geo-solutions.it simone.giannecchini@geo-solutions.it FOSS4G 2014, Portland 8th-13th September 2014 48

Add a comment

Related presentations

Related pages

Mapping in GeoServer with SLD and CSS — Andrea Aime on Vimeo

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 ...
Read more

Mapping in GeoServer with SLD and CSS | FOSS4G 2014

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 ...
Read more

Estilos CSS en GeoServer - MappingGIS

El módulo CSS para GeoServer añade un editor de estilos alternativo a GeoServer que utiliza un lenguaje derivado de CSS en lugar de SLD. Te será muy ...
Read more

Mapping in GeoServer with SLD and CSS - Monde Geospatial

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 ...
Read more

CSS styling extension for GeoServer - Boundless

SLD Extensions in GeoServer; SLD Tips and ... CSS Styling¶ The CSS extension adds an alternative style editor to GeoServer that ... OpenLayers Web Mapping ...
Read more

GeoServer Archives - Page 2 of 3 - Monde Geospatial ...

Monde Geospatial – Geomatics | GIS| Remote sensing| GPS | Surveying | ArcGIS | QGIS Geospatial videos, news, ... Mapping in GeoServer with SLD and CSS.
Read more

GeoServer

The following products are kindly supporting open source projects like GeoServer. GeoServer Beginner's Guide, ...
Read more

GeoServer User Manual — GeoServer 2.5.x User Manual

GeoServer User Manual¶ GeoServer is an open source software server written in Java that allows ... Mapping File; Application Schema ... SLD Extensions in ...
Read more

GeoServer User Manual — GeoServer 2.9.x User Manual

GeoServer User Manual¶ GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. Designed for ...
Read more