You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Yong Wook Kim

Jong Lee

Rob Kooper

Todd Nicholson

Maxwell Burnette

Chen Wang

GeoServer

  • an open source software server written in Java that allows users to share and edit geospatial data. Designed for interoperability, it publishes data from any major spatial data source using open standards.
  • serves data using standard protocols established by the Open Geospatial Consortium

Geoserver Services

services are the primary way of supplying geospatial information

  • Web Map Service (WMS)
  • Web Feature Service (WFS)
  • Web Coverage Service (WCS)
  • Web Processing Service (WPS)
  • Web Map Tiling Service (WMTS)
  • Catalog Services for the Web (CSW)

Web Map Service (WMS)

  • supports requests for map images (and other formats) generated from geographical data.
  • provides a standard interface for requesting a geospatial map image.
  • clients can request images from multiple WMS servers, and then combine them into a single view for the user.
  • images can all be overlaid on one another as they actually would be in reality.
  • GeoServer supports WMS 1.1.1, the most widely used version of WMS, as well as WMS 1.3.0.
  • PNG, PNG8, JPEG, JPEG-PNG, JPEG-PNG8, GIF, TIFF, TIFF8, GeoTIFF, GeoTIFF8, SVG, PDF, GeoRSS, KML, KMZ, OpenLayers, UTFGrid
  • Example
    • https://<geoserver_url>/geoserver/incore/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&tiled=true&name=tiledLayer&STYLES=&LAYERS=<layer_name>&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=-90%2C34.98046875%2C-89.82421875%2C35.15625

Web Feature Service (WFS)

  • supports requests for geographical feature data (with vector geometry and attributes).
  • defines the framework for providing access to, and supporting transactions on, discrete geographic features
  • users have access to the source spatial and attribute data in a manner that allows them to interrogate, style, edit (create, update, and delete), and download individual features.
  • requests
    • GetCapabilities
      • request to a WFS server for a list of the operations and services, or capabilities, supported by that server
    • DescribeFeatureType
      • requests information about an individual feature type before requesting the actual data.
      • request a list of features and attributes for the given feature type, or list the feature types available.
    • GetFeature
      • returns a selection of features from the data source
      • output formats: GML2, GML3, Shapefile, JSON, JSONP, CSV
    • examples
      • Filtering for selection
        • https://<geoserver_url>/geoserver/<workspace>/ows?service=WFS&version=1.0.0&request=GetCapabilities&CQL_FILTER=<field_name>=%27<value>%27
      • Output as Json Format
        • https://<geoserver_url>/geoserver/<workspace>/ows?service=WFS&version=1.0.0&request=GetCapabilities&CQL_FILTER=<field_name>=%27<value>%27&outputFormat=JSON
      • Output as Shapefile
        • https://<geoserver_url>/geoserver/<workspace>/ows?service=WFS&version=1.0.0&request=GetCapabilities&CQL_FILTER=<field_name>=%27<value>%27&outputFormat=shape-zip

Web Coverage Service (WCS)

  • supports requests for coverage data (rasters)
  • provides a standard interface
    • how to request the raster source of a geospatial image.
    • return an image only used as an image
  • results can be used for complex modeling and analysis
    • contains more information.
  • allows more complex querying
    • can extract just the portion of the coverage.
    • output formats
      • JPEG, GIF, PNG, Tiff, BMP
      • GeoTiff, GTopo30, ArcGrid, Gzipped ArcGrid
  • requests
    • GetCapabilities
      • request a list of what operations and services (“capabilities”) are being offered
    • DescribeCoverage
      • request additional information about a Coverage
      • returns information about
      • crs, the metadata, the domain, the range and the formats.
    • GetCoverage
      • requests the actual spatial data.
      • can retrieve subsets of coverages
      • result can be either the coverage itself or a reference to it.
      • most powerful thing is an ability to subset domains (height and time) and ranges.
      • can also do resampling, encode in different data formats, and return the resulting file in different ways
  • examples
    • GetCapabilities
      • https://<geoserver_url>/geoserver/<workspace>/ows?service=WCS&version=2.0.0&request=GetCapabilities
    • DescribeCoverage
      • http://<geoserver_url>/geoserver/<workspace>/ows?service=WCS&version=2.0.0&request=DescribeCoverage&coverageId=<coverage_id>
    • GetCoverage
      • http://<geoserver_url>/geoserver/<workspace>/ows?service=WCS&version=2.0.0&request=GetCoverage&coverageId=<coverage_id>

Web Processing Service (WPS)

  • an OGC service for the publishing of geospatial processes, algorithms, and calculations
  • available as an extension for executing operation for data processing and geospatial analysis.
  • results of a process can be stored as a new layer in the GeoServer catalog.
  • WPS acts as a full remote geospatial analysis tool, capable of reading and writing data from and to GeoServer.
  • https://docs.geoserver.org/stable/en/user/services/wps/index.html
  • requests
    • GetCapabilities
    • http://<geoserver_url>/geoserver/ows?service=WPS&version=1.0.0&request=GetCapabilities
    • DescribeProcess
    • Execute

Web Map Tiling Service (WMTS)

  • an OGC standard currently undergoing ratification
  • Geoserver has the ability to proxy a remote Web Map Tile Service (WMTS)
  • Loading a remote WMTS is useful for many reasons.
  • If you don’t manage or have access to the remote WMTS, you can now manage its output as if it were local.
  • Even if you don’t have any control on the remote WMTS, you can use GeoServer features to treat its output (watermarking, decoration, printing, etc).

Catalog Services for the Web (CSW)

  • supports retrieving and displaying items from the GeoServer catalog using the CSW service
  • requests
    • GetCapabilities
    • GetRecords
    • GetRecordById
    • GetDomain
    • DescribeRecord
  • examples
    • GetCapabilities
      • https://<geoserver_url>/geoserver/ows?service=csw&version=2.0.2&request=GetCapabilities
    • GetRecords
      • https://<geoserver_url>/geoserver/ows?service=CSW&version=2.0.2&request=GetRecords&typeNames=gmd:MD_Metadata&resultType=results&elementSetName=full&outputSchema=http://www.isotc211.org/2005/gmd
    • GetRecordById
      • https://<geoserver_url>/geoserver/ows?service=CSW&version=2.0.2&request=GetRecordById&elementsetname=summary&id=<dataset_id>&typeNames=gmd:MD_Metadata&resultType=results&elementSetName=full&outputSchema=http://www.isotc211.org/2005/gmd
    • GetDomain
      • https://<geoserver_url>/geoserver/ows?service=csw&version=2.0.2&request=GetDomain&propertyName=Title
    • DescribeRecord
      • https://<geoserver_url>/geoserver/ows?service=CSW&version=2.0.2&request=DescribeRecord&typeName=gmd:MD_Metadata

Basic manipulation using Python

Gsconfig-py3

  • https://pypi.org/project/gsconfig/
  • python3 library for manipulating a GeoServer instance via the GeoServer RESTConfig API
  • installation
    • Pip
      • pip install gscofig-py3
    • Manual installation


git clone git@github.com:boundlessgeo/gsconfig.git
cd gsconfig
python setup.py develop
  • catalog
    • Set up catalog
from geoserver.catalog import Catalog
cat = Catalog("http://geoserver_url/geoserver/rest/", "admin", "geoserver")
note /rest/ at the end of the url
  • workspace
# get all the workspaces
cat.get_workspaces()

#filter which workspace to return
cat.get_workspace(“any workspace name”)

#filter which stores to return
cat.get_store(“store name”, “workspace name”)
  • upload shapefile
# construct geoserver catalog
cat = Catalog(gs_url, gs_user, gs_pw)

# set workspace, if the workspace is not there, it has to be created
worksp = cat.get_workspace(gs_workspace)

# create the list object related to shapefile (including shp, prj, shx, dbf)
shapefile_plus_sidecars = gs_util.shapefile_and_friends(filename)

# upload shapefile
ft = cat.create_featurestore(filename, shapefile_plus_sidecars, worksp)
  • upload raster
# construct geoserver catalog
cat = Catalog(gs_url, gs_user, gs_pw)

# set workspace, if the workspace is not there, it has to be created
worksp = cat.get_workspace(gs_workspace)

# upload raster data 
cat.create_coveragestore(out_name, in_tif, worksp)


GeoPackage

GeoPackage

  • https://www.geopackage.org/
  • The GeoPackageEncoding Standard describes a set of conventions for storing the following within an SQLite database:
    • vector features
    • tile matrix sets of imagery and raster maps at various scales
    • attributes (non-spatial data)
    • Extensions
  • OGCGeoPackagespecification1.0.1 published inyear 2015
  • Latestversion1.3.0inyear2020 (https://www.geopackage.org/spec130/index.html)

Implementations

  • GDAL
    • VectorFeatures and Tiles (raster) since v2.0
  • QGIS
    • VectorFeatures (read/write) since 2.10.1
    • Tiles(read)since2.18
  • Geoserver
    • GeoPacakge plugin
    • Handle both Vector Features and Tiles
  • ESRIArcGIS
    • Vector features (since ArcGIS 10.2.2)
    • Tiles (since ArcGIS 10.3
  • GeoTools
    • Vector Features and Tiles (raster) since 11.0
    • Recently added GeoPackageR-Trees
  • NGAopen sourcelib
  • https://www.geopackage.org/implementations.html

A Quick Comparison

ESRI Shapefile

GeoPackage

Multiple files (.shp, .shx, .dbf, .prj)

Single file

Limitation because of DBF (10 ch length for column names)

No limitations like DBF

1 Shapefile has1 FeatureType (Road.shp has “road” featuretype)

1 GeoPackage could have multiple Feature Types

Can’t contain Raster data

It contains raster data and other attribute tables

Galveston buildings shapefile (40.7 MB)

Galveston buildings geopackage (3.66 MB)

Using PostGIS in Geoserver

Max will perform benchmarking test for the performance.
If the data is static, it could be a good option.
It doesn't save the shapefile in geoserver's data_dir so it can save some disk space.

Note


  • No labels