Mapping in GeoServer with SLD and CSS
-
Upload
geosolutions -
Category
Technology
-
view
1.008 -
download
6
description
Transcript of Mapping in GeoServer with SLD and CSS
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