advanced cartographic map rendering in geoserver

49
Advanced cartographic map rendering in GeoServer Ing. Andrea Aime, GeoSolutions Ing. Alessio Fabiani, GeoSolutions FOSS4G 2013, Nottingham 17 th -22 th September 2013

Upload: geosolutions

Post on 11-May-2015

2.105 views

Category:

Technology


1 download

DESCRIPTION

Various software can style maps and generate a proper SLD document for OGC-compliant WMS. However the styling allowed by the graphical tools is often limited and not adequate for good cartographic output. This presentation will provide hints, examples and enough information to master SLD in order to create beautiful maps with GeoServer.

TRANSCRIPT

Page 1: Advanced Cartographic Map Rendering In GeoServer

Advanced cartographic map rendering in GeoServer

Ing. Andrea Aime, GeoSolutions

Ing. Alessio Fabiani, GeoSolutions

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 2: Advanced Cartographic Map Rendering In GeoServer

Overview

Who we are

Example map

Raster styling

Scale dependent rules

Hatches, patterns and dashes

Point Symbology

Labeling

Transformations

Cross layer filtering

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 3: Advanced Cartographic Map Rendering In GeoServer

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 2013, Nottingham 17th-22th September 2013

Page 4: Advanced Cartographic Map Rendering In GeoServer

Introduction

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 5: Advanced Cartographic Map Rendering In GeoServer

SLD vs CSS

Styled Layer Descriptor

OGC standard

XML based, verbose, hard to hand edit

Only showing relevant bits of the SLD

Cascading Style Sheets

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 2013, Nottingham 17th-22th September 2013

Page 6: Advanced Cartographic Map Rendering In GeoServer

Example map

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 7: Advanced Cartographic Map Rendering In GeoServer

Example map

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 8: Advanced Cartographic Map Rendering In GeoServer

Example map

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 9: Advanced Cartographic Map Rendering In GeoServer

Example map

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 10: Advanced Cartographic Map Rendering In GeoServer

Example map

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 11: Advanced Cartographic Map Rendering In GeoServer

Raster styling

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 12: Advanced Cartographic Map Rendering In GeoServer

A DEM and a color map

SRTM from USGS

Standard color map

Just avoid the nodata values with opacity=0

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 13: Advanced Cartographic Map Rendering In GeoServer

A DEM and a color map

Same as before, in CSS

Solid intervals

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 14: Advanced Cartographic Map Rendering In GeoServer

Scale dependent rules

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 15: Advanced Cartographic Map Rendering In GeoServer

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 2013, Nottingham 17th-22th September 2013

Page 16: Advanced Cartographic Map Rendering In GeoServer

Example

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 17: Advanced Cartographic Map Rendering In GeoServer

Hide as you zoom in

Add a MinScaleDenominator to the rule

This will make the layer disappear at 1:75000 (towards 1:1)

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 18: Advanced Cartographic Map Rendering In GeoServer

Alternative rendering

Simple rendering at low scale (up to 1:2000)

More complex rendering when zoomed in (1:1999 and above)

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 19: Advanced Cartographic Map Rendering In GeoServer

Alternative rendering

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 20: Advanced Cartographic Map Rendering In GeoServer

Alternative rendering, CSS way

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 21: Advanced Cartographic Map Rendering In GeoServer

Hatches, patterns, dashes and plates

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 22: Advanced Cartographic Map Rendering In GeoServer

Filling with patterns

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 23: Advanced Cartographic Map Rendering In GeoServer

Filling with TTF fonts

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 24: Advanced Cartographic Map Rendering In GeoServer

Hatches

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 25: Advanced Cartographic Map Rendering In GeoServer

Hatches

vertiline

slash

plus times

backslash

horline

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 26: Advanced Cartographic Map Rendering In GeoServer

Dashes

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 27: Advanced Cartographic Map Rendering In GeoServer

Dashes

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 28: Advanced Cartographic Map Rendering In GeoServer

Plates

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 29: Advanced Cartographic Map Rendering In GeoServer

Plates CSS way

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 30: Advanced Cartographic Map Rendering In GeoServer

Point Symbology

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 31: Advanced Cartographic Map Rendering In GeoServer

Point symbols

• 600 loc for 6 different points types

• Painful…

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 32: Advanced Cartographic Map Rendering In GeoServer

Point symbols

• 70 lines total • Power of cascading

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 33: Advanced Cartographic Map Rendering In GeoServer

Prepare data

alter table pointlm add column image varchar;

update pointlm set image = 'shop_supermarket.p.16.png' where MTFCC =

'C3081' and (FULLNAME like '%Shopping%' or FULLNAME like '%Mall%');

update pointlm set image = 'peak.png' where MTFCC = 'C3022'

update pointlm set image = 'amenity_prison.p.20.png' where MTFCC =

'K1236';

update pointlm set image = 'museum.p.16.png' where MTFCC = 'K2165';

update pointlm set image = 'airport.p.16.png' where MTFCC = 'K2451';

update pointlm set image = 'school.png' where MTFCC = 'K2543';

update pointlm set image = 'christian3.p.14.png' where MTFCC =

'K2582';

update pointlm set image = 'gate2.png' where MTFCC = 'K3066';

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 34: Advanced Cartographic Map Rendering In GeoServer

Dynamic symbolizers

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 35: Advanced Cartographic Map Rendering In GeoServer

Dynamic symbolizers CSS way

FOSS4G 2013, Nottingham 17th-22th September 2013

• Down to 15 lines

Page 36: Advanced Cartographic Map Rendering In GeoServer

Labeling

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 37: Advanced Cartographic Map Rendering In GeoServer

Line labels

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 38: Advanced Cartographic Map Rendering In GeoServer

Line labels (and more) CSS way

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 39: Advanced Cartographic Map Rendering In GeoServer

Point labels

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 40: Advanced Cartographic Map Rendering In GeoServer

Polygon labels

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 41: Advanced Cartographic Map Rendering In GeoServer

Label Obstacles

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 42: Advanced Cartographic Map Rendering In GeoServer

Transformations

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 43: Advanced Cartographic Map Rendering In GeoServer

Geometry transformations

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 44: Advanced Cartographic Map Rendering In GeoServer

Geometry transformations CSS way

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 45: Advanced Cartographic Map Rendering In GeoServer

Geometry transformations

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 46: Advanced Cartographic Map Rendering In GeoServer

Rendering transformations

FOSS4G 2013, Nottingham 17th-22th September 2013

• No CSS support yet

Page 47: Advanced Cartographic Map Rendering In GeoServer

Rendering transformations

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 48: Advanced Cartographic Map Rendering In GeoServer

Get it all

In a few days you will be able to find:

Full data, styles and configuration, ready to use

Get the slides

Be on the lookout:

http://geo-solutions.blogspot.com/

FOSS4G 2013, Nottingham 17th-22th September 2013

Page 49: Advanced Cartographic Map Rendering In GeoServer

The End

Questions? [email protected]

[email protected]

FOSS4G 2013, Nottingham 17th-22th September 2013