Document 6516854

Transcription

Document 6516854
Workshop plan
Open Source Geospatial India
• Topics covered
Developing Web Mapping
Applications using GeoServer
- GeoServer introduction
- Vector data, WMS and WFS
• How
Santosh Gaikwad,
Salim Ali Centre For Ornithology And Natural History (SACON),
- Alternate quick theoretical introductions with
practical sessions
Hyderabad
santosh@wetlandsofindia.org
GeoServer is...
What is GeoServer
• Java based, platform independent, server
side software
• What does it do:
- take you data and publish it on a network
- with a strong emphasis on OGC standards
(WMS, WFS, WCS)
OGC protocols introduction
• WMS (Web Map Service) + SLD
(Styled Layer Descriptor)
- turn raw data into nice maps, query
them, make legends
• WFS (Web Feature Service)
- describe and serve raw vector data
OGC protocols compliance
• GeoServer is:
- WMS 1.1.1 compliant
- WFS 1.0 and 1.1 reference implementation
- WCS 1.0 compliant,
compliant, and soon to become WCS
1.1 reference implementation as well
• WCS (Web Coverage Service)
- describe and serve raw raster data
1
Shapefile
GML
VPF
WFS 1.0
Vector files
PostGIS
DB2
Oracle
MySql
WFS 1.1
Crude vector
data
WMS
1.1
DBMS
ArcSDE
WFS
Styled
maps
Servers
WCS
1.0
GeoTIFF
ArcGrid
GTopo30
Img+world
Mosaic
Pyramid Raster files
Crude raster
data
Shapefile.zip
GML2
GML2.gz
GML3
GeoRSS
GeoJSON
PNG, GIF
JPEG
TIFF
GeoTIFF
SVG, PDF
KML/KMZ
The vector basics
GeoTIFF
ArcGrid
GTopo30
Img+World
1.6.4
Vector data
• Shapefiles, PostGIS, Oracle
locator/spatial, DB2,
ArcSDE, ...
• OGC Simple Feature
- One or more geometries
- One or more descriptive
attributes
- A Coordinate Reference System
(or Spatial Reference System)
GeoServer vector lingo
• DataStore
- connection to a data provider (shapefile, DBMS)
• FeatureType
- description of a set of features sharing common
structure
- some extra information to make WFS and WMS
happy (bounds, default style, caching,
metadata)
The data directory
• A directory containing
- your GeoServer configuration
- your styles
- your custom CRS may contain your data
too (if file based)
Web Map Service
2
WMS block diagram
Style (SLD)
GetMap
GetFeatureInfo
WMS 1.1
Raw data
A GetMap request
Draws a map:
PNG,GIF
JPEG, GeoTiff
OpenLayers
KML
Returns feature
information
(attribute values
GetLegendGraphics
GetCapabilities
Draws a map
legend
What can we do,
what layers we
know about
• http://localhost:8080/geoserver/wms?
- request=GetMap&
service=WMS&
=WMS&version
version=1.1
=1.1
request=GetMap&service
- &layers=topp:tasmania_water_bodies,
layers=topp:tasmania_water_bodies,
- &styles=polygon,line
styles=polygon,line
- &bbox=145.043768,
bbox=145.043768,--43.5520475,148.426752
00000002,00000002,-40.7242665
- &width=800&
height=627
=627
width=800&height
- &srs=EPSG:4326
srs=EPSG:4326
Allows for reprojection
- &format=image/png
ormat=image/png
The output format
Layer stack
(the actual
map definition)
Geographic
bounds and
image size
(KML, GetFeatureInfo
output customization)
Formats
• Listed in the WMS capabilities document
- Images: image/gif, image/png, image/jpeg, Vector files: image/svg+xml, application/pdf Google Earth integration: kml
- Interactive: application/openplayers
• Relatively easy to develop more output
formats
Styles
• Styled Layer Descriptor
- An XML document driving map generation,
allows for attribute and scale dependent styling A Google Maps like style can be thousands of
lines long
• SLD file creation
- GeoServer has a very simple style generator Use uDig or gvSig to generate SLD files - No
easy to use editor with full support for SLD
styles
WFS block diagram
What can we do,
what layers we
know about
GetCapabilities
Web Feature Service
DescribeFeatureType
WFS 1.0
Raw data
GetFeature
Transaction
Describes
the
feature type set of
attributes (for
other programs to
use)
Extracts data
based on a query
Modifies data
3
GetFeature
• Retrieves data in GML or compressed
shapefile format
- Specify which attributes
- Specify a filter
• Request is specified with an XML format •
Intended to be used by another program (a
client like uDig), not directly by a human
Transaction
• Allows to add, delete and update features
• Being a transaction, either all of the
modification in the transaction succeed, or
none will be applied
• Again, XML document to make a request.
Better used with a client.
4