Intro to GeoServer
Introduction to GeoServer
Introduction to GeoServer
Outline
1. Installing GeoServer
2. GeoServer web interface
3. Overview
4. Working with data
5. Styling
6. Web map output
Introduction to GeoServer
Introduction to GeoServer
What is GeoServer?
GeoServer is an open source software server written in Java that allows users to shareand edit geospatial data
Introduction to GeoServer
Introduction to GeoServer
Section 1: Installing
GeoServer is a core component of OpenGeo Suite.
Introduction to GeoServer
Introduction to GeoServer
Installation
Introduction to GeoServer
Introduction to GeoServer
Installation
Introduction to GeoServer
Introduction to GeoServer
Dashboard
Central location for launching applications and resources.
Introduction to GeoServer
Introduction to GeoServer
Section 2: GeoServer web interface
Manage GeoServer graphically.
Introduction to GeoServer
Introduction to GeoServer
Tour of the interface
http://localhost:8080/geoserver/
Introduction to GeoServer
Introduction to GeoServer
Authentication
Default credentials: admin / geoserver
• Robust security system
• Ability to create custom user accounts and roles
Introduction to GeoServer
Introduction to GeoServer
Authentication
Introduction to GeoServer
Introduction to GeoServer
Layer Preview
View published layers with minimal clicks
Introduction to GeoServer
Introduction to GeoServer
Layer Preview
View published layers with minimal clicks
Introduction to GeoServer
Introduction to GeoServer
Logs
View application logs inside the application itself
Introduction to GeoServer
Introduction to GeoServer
Bonus exercises
• What is the filesystem path to the GeoServer data directory?
• What version of Java is GeoServer using?
Introduction to GeoServer
Introduction to GeoServer
Loading your first data set
Introduction to GeoServer
Introduction to GeoServer
Loading your first data set
Introduction to GeoServer
Introduction to GeoServer
Loading your first data set
Introduction to GeoServer
Introduction to GeoServer
Loading your first data set
Introduction to GeoServer
Introduction to GeoServer
Loading your first data set
Introduction to GeoServer
Introduction to GeoServer
Loading your first data set
Introduction to GeoServer
Introduction to GeoServer
Section 3: Overview
Basic concepts related to GeoServer and web mapping, including OGC protocolsand useful terminology.
Introduction to GeoServer
Introduction to GeoServer
Web servers
http://example.com/some/path/page.html http://example.com/some/path/image.jpg http://example.com/some/path/archive.ziphttp://example.com/some/path/data.xml
Introduction to GeoServer
Introduction to GeoServer
Web mapping servers
Like a web server, but designed specifically for conveying geospatial content.
Introduction to GeoServer
Introduction to GeoServer
Data sources
Lots of options
• Files (Shapefile, GeoTIFF, MrSID, ArcGrid, JPEG2000, GDAL formats)
• Databases (PostGIS, ArcSDE, Oracle Spatial, DB2, SQL Server)
Introduction to GeoServer
Introduction to GeoServer
OGC protocols
• Web Map Service (WMS)
• Web Feature Service (WFS)
• Web Coverage Service (WCS)
• Web Processing Service (WPS)
• ...and more
Introduction to GeoServer
Introduction to GeoServer
Web Map Service
Also known as the "map image"
Introduction to GeoServer
Introduction to GeoServer
Web Map Service
Example GetMap request:
http://demo.boundlessgeo.com/geoserver/wms?service=wms&version=1.3.0&request=GetMap&layers=osm:osm&styles=&srs=EPSG:900913&bbox=-13744070,6170985,-13720028,6191021&format=image/png&width=600&height=500
Introduction to GeoServer
Introduction to GeoServer
Web Map Service
Introduction to GeoServer
Introduction to GeoServer
Web Map Service
Example GetCapabilities request:
http://demo.boundlessgeo.com/geoserver/wms?service=WMS&version=1.3.0&request=GetCapabilities
Introduction to GeoServer
Introduction to GeoServer
Web Feature Service
Also known as the "map source code"
Introduction to GeoServer
Introduction to GeoServer
Web Feature Service
Example GetFeature request:
http://demo.boundlessgeo.com/geoserver/wfs?service=wfs&version=1.1.0&request=GetFeature&typename=topp:states&featureid=states.39
Introduction to GeoServer
Introduction to GeoServer
Web Feature Service
Introduction to GeoServer
Introduction to GeoServer
Web Feature Service
Example GetCapabilities request:
http://demo.boundlessgeo.com/geoserver/wfs?service=WFS&version=2.0.0&request=GetCapabilities
Introduction to GeoServer
Introduction to GeoServer
Other OGC protocols
• Web Coverage Service
◦ Like Web Feature Service (WFS)
• Web Processing Service
◦ Analysis!
Introduction to GeoServer
Introduction to GeoServer
GeoServer concepts: Workspace
Notional container for grouping similar data together
Introduction to GeoServer
Introduction to GeoServer
GeoServer concepts: Store
A container of geographic data (a file/database)
Introduction to GeoServer
Introduction to GeoServer
GeoServer concepts: Layer
A collection of geospatial features or a coverage
Introduction to GeoServer
Introduction to GeoServer
GeoServer concepts: Layer group
A collection of layers (WMS only)
Introduction to GeoServer
Introduction to GeoServer
GeoServer concepts
Introduction to GeoServer
Introduction to GeoServer
GeoServer concepts: Style
Visualization directive for rendering geographic data
Introduction to GeoServer
Introduction to GeoServer
Section 4: Working with Data
Load and manage data in GeoServer
Introduction to GeoServer
Introduction to GeoServer
Adding a workspace
Introduction to GeoServer
Introduction to GeoServer
Adding a workspace
Introduction to GeoServer
Introduction to GeoServer
Adding a workspace
Introduction to GeoServer
Introduction to GeoServer
Publishing a shapefile
Introduction to GeoServer
Introduction to GeoServer
Publishing a shapefile
Introduction to GeoServer
Introduction to GeoServer
Publishing a shapefile
Introduction to GeoServer
Introduction to GeoServer
Publishing a shapefile
Introduction to GeoServer
Introduction to GeoServer
Publishing a shapefile
Introduction to GeoServer
Introduction to GeoServer
Publishing a GeoTIFF
Introduction to GeoServer
Introduction to GeoServer
Publishing a GeoTIFF
Introduction to GeoServer
Introduction to GeoServer
Publishing a GeoTIFF
Introduction to GeoServer
Introduction to GeoServer
Publishing a GeoTIFF
Introduction to GeoServer
Introduction to GeoServer
Publishing a GeoTIFF
Introduction to GeoServer
Introduction to GeoServer
Loading multiple layers
Using the Layer Importer
Introduction to GeoServer
Introduction to GeoServer
Loading multiple layers
Introduction to GeoServer
Introduction to GeoServer
Loading multiple layers
Introduction to GeoServer
Introduction to GeoServer
Bonus: PostGIS and Layer Importer
Load in PostGIS and then publish in GeoServer, all in one step!
Introduction to GeoServer
Introduction to GeoServer
Other ways of loading data
• Directory of shapefiles
• REST API
Introduction to GeoServer
Introduction to GeoServer
Creating a layer group
Introduction to GeoServer
Introduction to GeoServer
Creating a layer group
Introduction to GeoServer
Introduction to GeoServer
Creating a layer group
Introduction to GeoServer
Introduction to GeoServer
Creating a layer group
Introduction to GeoServer
Introduction to GeoServer
Section 5: Styling
GeoServer can render geospatial data as images and return them for viewing ina browser. However, additional information, in the form of a style, needs to beapplied to data in order to visualize it.
Introduction to GeoServer
Introduction to GeoServer
Viewing an SLD
Introduction to GeoServer
Introduction to GeoServer
SLD structure
• Header
◦ FeatureTypeStyles
▪ Rules
▪ Symbolizers
Introduction to GeoServer
Introduction to GeoServer
Simple SLD...
<FeatureTypeStyle><Rule>
<PointSymbolizer><Graphic>
<Mark><WellKnownName>circle</WellKnownName><Fill>
<CssParameter name="fill">#FF0000</CssParameter></Fill>
</Mark><Size>6</Size>
</Graphic></PointSymbolizer>
</Rule></FeatureTypeStyle>
...
Introduction to GeoServer
Introduction to GeoServer
Simple SLD
Introduction to GeoServer
Introduction to GeoServer
Another SLD example<Rule>
<Name>SmallPop</Name><Title>1 to 50000</Title><ogc:Filter>
<ogc:PropertyIsLessThan><ogc:PropertyName>pop</ogc:PropertyName><ogc:Literal>50000</ogc:Literal>
</ogc:PropertyIsLessThan></ogc:Filter><PointSymbolizer>
<Graphic><Mark>
<WellKnownName>circle</WellKnownName><Fill>
<CssParameter name="fill">#0033CC</CssParameter></Fill>
</Mark><Size>8</Size>
</Graphic></PointSymbolizer>
</Rule>
Introduction to GeoServer
Introduction to GeoServer
Another SLD
Introduction to GeoServer
Introduction to GeoServer
Functions in SLD
Use functions to simplify output.
<Size><ogc:Function name="Categorize">
<ogc:PropertyName>pop</ogc:PropertyName><ogc:Literal>8</ogc:Literal><ogc:Literal>50000</ogc:Literal><ogc:Literal>16</ogc:Literal><ogc:Literal>100000</ogc:Literal><ogc:Literal>20</ogc:Literal>
</ogc:Function></Size>
Introduction to GeoServer
Introduction to GeoServer
Functions in SLD
Introduction to GeoServer
Introduction to GeoServer
YSLD
• Improving on SLD
• Based on YAML syntax
• Native rendering
Introduction to GeoServer
Introduction to GeoServer
Benefits of YSLD
Easier to read
SLD:
<CssParameter name="fill">#FF0000</CssParameter>
YSLD:
fill-color: '#FF0000'
Introduction to GeoServer
Introduction to GeoServer
Benefits of YSLD
More compact
<Rule><PointSymbolizer>
<Graphic><Mark>
<WellKnownName>circle</WellKnownName><Fill>
<CssParameter name="fill">#FF0000</CssParameter></Fill><Stroke>
<CssParameter name="stroke">#000000</CssParameter><CssParameter name="stroke-width">2</CssParameter>
</Stroke></Mark><Size>8</Size>
</Graphic></PointSymbolizer>
</Rule>
Introduction to GeoServer
Introduction to GeoServer
Benefits of YSLD
More compact
rules:- symbolizers:
- point:size: 8symbols:- mark:
shape: circlefill-color: '#FF0000'stroke-color: '#000000'stroke-width: 2
Introduction to GeoServer
Introduction to GeoServer
Benefits of YSLD
More flexible syntax
Valid:
<Fill>...</Fill><Stroke>...</Stroke>
Invalid:
<Stroke>...</Stroke><Fill>...</Fill>
Introduction to GeoServer
Introduction to GeoServer
Benefits of YSLD
More flexible syntax
Both valid:
fill-color: '#FF0000'stroke-color: '#000000'
stroke-color: '#000000'fill-color: '#FF0000'
Introduction to GeoServer
Introduction to GeoServer
Benefits of YSLD
Contains variables for reusable code
define: &variableshape: circlefill-color: '#FF0000'stroke-color: '#000000'
rules:- name: rule1
scale: [35000,max]symbolizers:- point:
size: 6symbols:- mark:
<<: *variablestroke-width: 2
Introduction to GeoServer
Introduction to GeoServer
Benefits of YSLD
Direct match with SLD
SLD ↔ YSLD ↔ SLD
Introduction to GeoServer
Introduction to GeoServer
Simple YSLDtitle: Simple Pointfeature-styles:- rules:
- scale: [min, max]symbolizers:- point:
size: 6symbols:- mark:
shape: circlefill-color: '#FF0000'
Introduction to GeoServer
Introduction to GeoServer
Simple YSLD
Introduction to GeoServer
Introduction to GeoServer
Another YSLDtitle: Attribute-based pointfeature-styles:- rules:
- name: SmallPoptitle: 1 to 50000filter: ${pop < '50000'}scale: [min, max]symbolizers:- point:
size: 8symbols:- mark:
shape: circlefill-color: '#0033CC'
Introduction to GeoServer
Introduction to GeoServer
Another YSLD
Introduction to GeoServer
Introduction to GeoServer
Functions in YSLDtitle: Attribute-based pointfeature-styles:- name: name
rules:- name: Population
title: Population with three categoriesscale: [min, max]symbolizers:- point:
size: ${Categorize(pop,'8','50000','16','100000','20')}symbols:- mark:
shape: circlefill-color: '#0033CC'
Introduction to GeoServer
Introduction to GeoServer
Viewing an existing style
Introduction to GeoServer
Introduction to GeoServer
Viewing an existing style
Introduction to GeoServer
Introduction to GeoServer
Viewing an existing style
Introduction to GeoServer
Introduction to GeoServer
Editing an existing style
Introduction to GeoServer
Introduction to GeoServer
Editing an existing style
Introduction to GeoServer
Introduction to GeoServer
Loading new styles
Introduction to GeoServer
Introduction to GeoServer
Loading new styles
Introduction to GeoServer
Introduction to GeoServer
Loading new styles
Introduction to GeoServer
Introduction to GeoServer
Associating styles with layers
Introduction to GeoServer
Introduction to GeoServer
Associating styles with layers
Introduction to GeoServer
Introduction to GeoServer
Error in the ocean
Why doesn't the ocean layer display?
Introduction to GeoServer
Introduction to GeoServer
External graphics
Note the graphic in the style:
name: 'Ocean'title: 'Ocean: Graphic fill'feature-styles:- rules:
- scale: [min, max]symbolizers:- polygon:
fill-graphic:size: 16symbols:- external:
url: oceantile.pngformat: image/png
Introduction to GeoServer
Introduction to GeoServer
External graphics
Images can be placed in the data directory
Introduction to GeoServer
Introduction to GeoServer
External graphics
Introduction to GeoServer
Introduction to GeoServer
Revisiting the layer group
Introduction to GeoServer
Introduction to GeoServer
Graphical styling: QGIS
Introduction to GeoServer
Introduction to GeoServer
Graphical styling: uDig
Introduction to GeoServer
Introduction to GeoServer
Section 6: Web map
Open html/map.html in a browser
Introduction to GeoServer
Introduction to GeoServer
Web map output
Introduction to GeoServer
Introduction to GeoServer
Web map output
Embed a map in web page
Introduction to GeoServer
Introduction to GeoServer
For more information
Webhttp://geoserver.org
Docshttp://docs.geoserver.org
Mailing listshttps://lists.sourceforge.net/lists/listinfo/geoserver-usershttps://lists.sourceforge.net/lists/listinfo/geoserver-devel
Bug trackerhttps://osgeo-org.atlassian.net/projects/GEOS/
Introduction to GeoServer
Introduction to GeoServer
Introduction to GeoServer
Questions? / Thanks!
Introduction to GeoServer
Introduction to GeoServer
Introduction to GeoServer
Introduction to GeoServer