intro to geoserver

220
Intro to GeoServer Introduction to GeoServer

Upload: trinhthuy

Post on 03-Jan-2017

249 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intro to GeoServer

Intro to GeoServer

Introduction to GeoServer

www.princexml.com
Prince - Non-commercial License
This document was created with Prince, a great way of getting web content onto paper.
Page 2: Intro to GeoServer

Introduction to GeoServer

Page 3: Intro 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

Page 4: Intro to GeoServer

Introduction to GeoServer

Page 5: Intro 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

Page 6: Intro to GeoServer

Introduction to GeoServer

Page 7: Intro to GeoServer

Section 1: Installing

GeoServer is a core component of OpenGeo Suite.

Introduction to GeoServer

Page 8: Intro to GeoServer

Introduction to GeoServer

Page 9: Intro to GeoServer

Installation

Introduction to GeoServer

Page 10: Intro to GeoServer

Introduction to GeoServer

Page 11: Intro to GeoServer

Installation

Introduction to GeoServer

Page 12: Intro to GeoServer

Introduction to GeoServer

Page 13: Intro to GeoServer

Dashboard

Central location for launching applications and resources.

Introduction to GeoServer

Page 14: Intro to GeoServer

Introduction to GeoServer

Page 15: Intro to GeoServer

Section 2: GeoServer web interface

Manage GeoServer graphically.

Introduction to GeoServer

Page 16: Intro to GeoServer

Introduction to GeoServer

Page 17: Intro to GeoServer

Tour of the interface

http://localhost:8080/geoserver/

Introduction to GeoServer

Page 18: Intro to GeoServer

Introduction to GeoServer

Page 19: Intro to GeoServer

Authentication

Default credentials: admin / geoserver

• Robust security system

• Ability to create custom user accounts and roles

Introduction to GeoServer

Page 20: Intro to GeoServer

Introduction to GeoServer

Page 21: Intro to GeoServer

Authentication

Introduction to GeoServer

Page 22: Intro to GeoServer

Introduction to GeoServer

Page 23: Intro to GeoServer

Layer Preview

View published layers with minimal clicks

Introduction to GeoServer

Page 24: Intro to GeoServer

Introduction to GeoServer

Page 25: Intro to GeoServer

Layer Preview

View published layers with minimal clicks

Introduction to GeoServer

Page 26: Intro to GeoServer

Introduction to GeoServer

Page 27: Intro to GeoServer

Logs

View application logs inside the application itself

Introduction to GeoServer

Page 28: Intro to GeoServer

Introduction to GeoServer

Page 29: Intro to GeoServer

Bonus exercises

• What is the filesystem path to the GeoServer data directory?

• What version of Java is GeoServer using?

Introduction to GeoServer

Page 30: Intro to GeoServer

Introduction to GeoServer

Page 31: Intro to GeoServer

Loading your first data set

Introduction to GeoServer

Page 32: Intro to GeoServer

Introduction to GeoServer

Page 33: Intro to GeoServer

Loading your first data set

Introduction to GeoServer

Page 34: Intro to GeoServer

Introduction to GeoServer

Page 35: Intro to GeoServer

Loading your first data set

Introduction to GeoServer

Page 36: Intro to GeoServer

Introduction to GeoServer

Page 37: Intro to GeoServer

Loading your first data set

Introduction to GeoServer

Page 38: Intro to GeoServer

Introduction to GeoServer

Page 39: Intro to GeoServer

Loading your first data set

Introduction to GeoServer

Page 40: Intro to GeoServer

Introduction to GeoServer

Page 41: Intro to GeoServer

Loading your first data set

Introduction to GeoServer

Page 42: Intro to GeoServer

Introduction to GeoServer

Page 43: Intro to GeoServer

Section 3: Overview

Basic concepts related to GeoServer and web mapping, including OGC protocolsand useful terminology.

Introduction to GeoServer

Page 44: Intro to GeoServer

Introduction to GeoServer

Page 45: Intro 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

Page 46: Intro to GeoServer

Introduction to GeoServer

Page 47: Intro to GeoServer

Web mapping servers

Like a web server, but designed specifically for conveying geospatial content.

Introduction to GeoServer

Page 48: Intro to GeoServer

Introduction to GeoServer

Page 49: Intro 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

Page 50: Intro to GeoServer

Introduction to GeoServer

Page 51: Intro 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

Page 52: Intro to GeoServer

Introduction to GeoServer

Page 53: Intro to GeoServer

Web Map Service

Also known as the "map image"

Introduction to GeoServer

Page 54: Intro to GeoServer

Introduction to GeoServer

Page 55: Intro 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

Page 56: Intro to GeoServer

Introduction to GeoServer

Page 57: Intro to GeoServer

Web Map Service

Introduction to GeoServer

Page 58: Intro to GeoServer

Introduction to GeoServer

Page 59: Intro 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

Page 60: Intro to GeoServer

Introduction to GeoServer

Page 61: Intro to GeoServer

Web Feature Service

Also known as the "map source code"

Introduction to GeoServer

Page 62: Intro to GeoServer

Introduction to GeoServer

Page 63: Intro 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

Page 64: Intro to GeoServer

Introduction to GeoServer

Page 65: Intro to GeoServer

Web Feature Service

Introduction to GeoServer

Page 66: Intro to GeoServer

Introduction to GeoServer

Page 67: Intro 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

Page 68: Intro to GeoServer

Introduction to GeoServer

Page 69: Intro to GeoServer

Other OGC protocols

• Web Coverage Service

◦ Like Web Feature Service (WFS)

• Web Processing Service

◦ Analysis!

Introduction to GeoServer

Page 70: Intro to GeoServer

Introduction to GeoServer

Page 71: Intro to GeoServer

GeoServer concepts: Workspace

Notional container for grouping similar data together

Introduction to GeoServer

Page 72: Intro to GeoServer

Introduction to GeoServer

Page 73: Intro to GeoServer

GeoServer concepts: Store

A container of geographic data (a file/database)

Introduction to GeoServer

Page 74: Intro to GeoServer

Introduction to GeoServer

Page 75: Intro to GeoServer

GeoServer concepts: Layer

A collection of geospatial features or a coverage

Introduction to GeoServer

Page 76: Intro to GeoServer

Introduction to GeoServer

Page 77: Intro to GeoServer

GeoServer concepts: Layer group

A collection of layers (WMS only)

Introduction to GeoServer

Page 78: Intro to GeoServer

Introduction to GeoServer

Page 79: Intro to GeoServer

GeoServer concepts

Introduction to GeoServer

Page 80: Intro to GeoServer

Introduction to GeoServer

Page 81: Intro to GeoServer

GeoServer concepts: Style

Visualization directive for rendering geographic data

Introduction to GeoServer

Page 82: Intro to GeoServer

Introduction to GeoServer

Page 83: Intro to GeoServer

Section 4: Working with Data

Load and manage data in GeoServer

Introduction to GeoServer

Page 84: Intro to GeoServer

Introduction to GeoServer

Page 85: Intro to GeoServer

Adding a workspace

Introduction to GeoServer

Page 86: Intro to GeoServer

Introduction to GeoServer

Page 87: Intro to GeoServer

Adding a workspace

Introduction to GeoServer

Page 88: Intro to GeoServer

Introduction to GeoServer

Page 89: Intro to GeoServer

Adding a workspace

Introduction to GeoServer

Page 90: Intro to GeoServer

Introduction to GeoServer

Page 91: Intro to GeoServer

Publishing a shapefile

Introduction to GeoServer

Page 92: Intro to GeoServer

Introduction to GeoServer

Page 93: Intro to GeoServer

Publishing a shapefile

Introduction to GeoServer

Page 94: Intro to GeoServer

Introduction to GeoServer

Page 95: Intro to GeoServer

Publishing a shapefile

Introduction to GeoServer

Page 96: Intro to GeoServer

Introduction to GeoServer

Page 97: Intro to GeoServer

Publishing a shapefile

Introduction to GeoServer

Page 98: Intro to GeoServer

Introduction to GeoServer

Page 99: Intro to GeoServer

Publishing a shapefile

Introduction to GeoServer

Page 100: Intro to GeoServer

Introduction to GeoServer

Page 101: Intro to GeoServer

Publishing a GeoTIFF

Introduction to GeoServer

Page 102: Intro to GeoServer

Introduction to GeoServer

Page 103: Intro to GeoServer

Publishing a GeoTIFF

Introduction to GeoServer

Page 104: Intro to GeoServer

Introduction to GeoServer

Page 105: Intro to GeoServer

Publishing a GeoTIFF

Introduction to GeoServer

Page 106: Intro to GeoServer

Introduction to GeoServer

Page 107: Intro to GeoServer

Publishing a GeoTIFF

Introduction to GeoServer

Page 108: Intro to GeoServer

Introduction to GeoServer

Page 109: Intro to GeoServer

Publishing a GeoTIFF

Introduction to GeoServer

Page 110: Intro to GeoServer

Introduction to GeoServer

Page 111: Intro to GeoServer

Loading multiple layers

Using the Layer Importer

Introduction to GeoServer

Page 112: Intro to GeoServer

Introduction to GeoServer

Page 113: Intro to GeoServer

Loading multiple layers

Introduction to GeoServer

Page 114: Intro to GeoServer

Introduction to GeoServer

Page 115: Intro to GeoServer

Loading multiple layers

Introduction to GeoServer

Page 116: Intro to GeoServer

Introduction to GeoServer

Page 117: Intro to GeoServer

Bonus: PostGIS and Layer Importer

Load in PostGIS and then publish in GeoServer, all in one step!

Introduction to GeoServer

Page 118: Intro to GeoServer

Introduction to GeoServer

Page 119: Intro to GeoServer

Other ways of loading data

• Directory of shapefiles

• REST API

Introduction to GeoServer

Page 120: Intro to GeoServer

Introduction to GeoServer

Page 121: Intro to GeoServer

Creating a layer group

Introduction to GeoServer

Page 122: Intro to GeoServer

Introduction to GeoServer

Page 123: Intro to GeoServer

Creating a layer group

Introduction to GeoServer

Page 124: Intro to GeoServer

Introduction to GeoServer

Page 125: Intro to GeoServer

Creating a layer group

Introduction to GeoServer

Page 126: Intro to GeoServer

Introduction to GeoServer

Page 127: Intro to GeoServer

Creating a layer group

Introduction to GeoServer

Page 128: Intro to GeoServer

Introduction to GeoServer

Page 129: Intro 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

Page 130: Intro to GeoServer

Introduction to GeoServer

Page 131: Intro to GeoServer

Viewing an SLD

Introduction to GeoServer

Page 132: Intro to GeoServer

Introduction to GeoServer

Page 133: Intro to GeoServer

SLD structure

• Header

◦ FeatureTypeStyles

▪ Rules

▪ Symbolizers

Introduction to GeoServer

Page 134: Intro to GeoServer

Introduction to GeoServer

Page 135: Intro 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

Page 136: Intro to GeoServer

Introduction to GeoServer

Page 137: Intro to GeoServer

Simple SLD

Introduction to GeoServer

Page 138: Intro to GeoServer

Introduction to GeoServer

Page 139: Intro 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

Page 140: Intro to GeoServer

Introduction to GeoServer

Page 141: Intro to GeoServer

Another SLD

Introduction to GeoServer

Page 142: Intro to GeoServer

Introduction to GeoServer

Page 143: Intro 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

Page 144: Intro to GeoServer

Introduction to GeoServer

Page 145: Intro to GeoServer

Functions in SLD

Introduction to GeoServer

Page 146: Intro to GeoServer

Introduction to GeoServer

Page 147: Intro to GeoServer

YSLD

• Improving on SLD

• Based on YAML syntax

• Native rendering

Introduction to GeoServer

Page 148: Intro to GeoServer

Introduction to GeoServer

Page 149: Intro to GeoServer

Benefits of YSLD

Easier to read

SLD:

<CssParameter name="fill">#FF0000</CssParameter>

YSLD:

fill-color: '#FF0000'

Introduction to GeoServer

Page 150: Intro to GeoServer

Introduction to GeoServer

Page 151: Intro 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

Page 152: Intro to GeoServer

Introduction to GeoServer

Page 153: Intro 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

Page 154: Intro to GeoServer

Introduction to GeoServer

Page 155: Intro to GeoServer

Benefits of YSLD

More flexible syntax

Valid:

<Fill>...</Fill><Stroke>...</Stroke>

Invalid:

<Stroke>...</Stroke><Fill>...</Fill>

Introduction to GeoServer

Page 156: Intro to GeoServer

Introduction to GeoServer

Page 157: Intro 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

Page 158: Intro to GeoServer

Introduction to GeoServer

Page 159: Intro 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

Page 160: Intro to GeoServer

Introduction to GeoServer

Page 161: Intro to GeoServer

Benefits of YSLD

Direct match with SLD

SLD ↔ YSLD ↔ SLD

Introduction to GeoServer

Page 162: Intro to GeoServer

Introduction to GeoServer

Page 163: Intro to GeoServer

Simple YSLDtitle: Simple Pointfeature-styles:- rules:

- scale: [min, max]symbolizers:- point:

size: 6symbols:- mark:

shape: circlefill-color: '#FF0000'

Introduction to GeoServer

Page 164: Intro to GeoServer

Introduction to GeoServer

Page 165: Intro to GeoServer

Simple YSLD

Introduction to GeoServer

Page 166: Intro to GeoServer

Introduction to GeoServer

Page 167: Intro 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

Page 168: Intro to GeoServer

Introduction to GeoServer

Page 169: Intro to GeoServer

Another YSLD

Introduction to GeoServer

Page 170: Intro to GeoServer

Introduction to GeoServer

Page 171: Intro 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

Page 172: Intro to GeoServer

Introduction to GeoServer

Page 173: Intro to GeoServer

Viewing an existing style

Introduction to GeoServer

Page 174: Intro to GeoServer

Introduction to GeoServer

Page 175: Intro to GeoServer

Viewing an existing style

Introduction to GeoServer

Page 176: Intro to GeoServer

Introduction to GeoServer

Page 177: Intro to GeoServer

Viewing an existing style

Introduction to GeoServer

Page 178: Intro to GeoServer

Introduction to GeoServer

Page 179: Intro to GeoServer

Editing an existing style

Introduction to GeoServer

Page 180: Intro to GeoServer

Introduction to GeoServer

Page 181: Intro to GeoServer

Editing an existing style

Introduction to GeoServer

Page 182: Intro to GeoServer

Introduction to GeoServer

Page 183: Intro to GeoServer

Loading new styles

Introduction to GeoServer

Page 184: Intro to GeoServer

Introduction to GeoServer

Page 185: Intro to GeoServer

Loading new styles

Introduction to GeoServer

Page 186: Intro to GeoServer

Introduction to GeoServer

Page 187: Intro to GeoServer

Loading new styles

Introduction to GeoServer

Page 188: Intro to GeoServer

Introduction to GeoServer

Page 189: Intro to GeoServer

Associating styles with layers

Introduction to GeoServer

Page 190: Intro to GeoServer

Introduction to GeoServer

Page 191: Intro to GeoServer

Associating styles with layers

Introduction to GeoServer

Page 192: Intro to GeoServer

Introduction to GeoServer

Page 193: Intro to GeoServer

Error in the ocean

Why doesn't the ocean layer display?

Introduction to GeoServer

Page 194: Intro to GeoServer

Introduction to GeoServer

Page 195: Intro 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

Page 196: Intro to GeoServer

Introduction to GeoServer

Page 197: Intro to GeoServer

External graphics

Images can be placed in the data directory

Introduction to GeoServer

Page 198: Intro to GeoServer

Introduction to GeoServer

Page 199: Intro to GeoServer

External graphics

Introduction to GeoServer

Page 200: Intro to GeoServer

Introduction to GeoServer

Page 201: Intro to GeoServer

Revisiting the layer group

Introduction to GeoServer

Page 202: Intro to GeoServer

Introduction to GeoServer

Page 203: Intro to GeoServer

Graphical styling: QGIS

Introduction to GeoServer

Page 204: Intro to GeoServer

Introduction to GeoServer

Page 205: Intro to GeoServer

Graphical styling: uDig

Introduction to GeoServer

Page 206: Intro to GeoServer

Introduction to GeoServer

Page 207: Intro to GeoServer

Section 6: Web map

Open html/map.html in a browser

Introduction to GeoServer

Page 208: Intro to GeoServer

Introduction to GeoServer

Page 209: Intro to GeoServer

Web map output

Introduction to GeoServer

Page 210: Intro to GeoServer

Introduction to GeoServer

Page 211: Intro to GeoServer

Web map output

Embed a map in web page

Introduction to GeoServer

Page 212: Intro to GeoServer

Introduction to GeoServer

Page 213: Intro 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

Page 214: Intro to GeoServer

Introduction to GeoServer

Page 215: Intro to GeoServer

For more information

http://boundlessgeo.com

Introduction to GeoServer

Page 216: Intro to GeoServer

Introduction to GeoServer

Page 217: Intro to GeoServer

Questions? / Thanks!

Introduction to GeoServer

Page 218: Intro to GeoServer

Introduction to GeoServer

Page 219: Intro to GeoServer

Introduction to GeoServer

Page 220: Intro to GeoServer

Introduction to GeoServer