Publishing maps to OGC API - Maps
OGC API - Maps provides geospatial data as web maps.
To add data to pygeoapi, you can use the dataset example in Configuration as a baseline and modify accordingly.
Providers
pygeoapi core feature providers are listed below, along with a matrix of supported query parameters.
Provider |
bbox |
width/height |
---|---|---|
✅ |
✅ |
|
✅ |
✅ |
Below are specific connection examples based on supported providers.
Connection examples
MapScript
MapScript (see website) is MapServer’s scripting interface to map rendering.
To publish a map via MapScript, the path to data is required, as well as the layer type (options.type). To style the data, set options.style. If no style is specified, the layer will be rendered with defaults.
MapServer layer types (options.type):
MS_LAYER_POINT
MS_LAYER_LINE
MS_LAYER_POLYGON
MS_LAYER_RASTER
Currently supported style files (options.style):
OGC Styled Layer Descriptor (SLD)
MapServer CLASS includes (i.e. file snippets with CLASS definitions)
providers:
- type: map
name: MapScript
data: /path/to/data.shp
options:
type: MS_LAYER_POINT
layer: foo_name
style: ./foo.sld
format:
name: png
mimetype: image/png
Projections are supported through EPSG codes (options.projection):
options:
type: MS_LAYER_POINT
layer: foo_name
projection: 32631
This parameter is optional, defaulting to WGS84 (4236).
This provider also supports tile indexing, which lets MapScript create a mosaic on the fly, piecing together a set of files. In order to enable it, set options.tileindex to True and set the location of the index file on the data path.
providers:
- type: map
name: MapScript
data: /data/index.shp
options:
type: MS_LAYER_RASTER
tileindex: True
layer: index
format:
name: png
mimetype: image/png
The options.tileindex parameter is optional, defaulting to False.
WMSFacade
To publish a WMS via pygeoapi, the WMS base URL (data) and layer name (options.layer) is required. An optional style name can be defined via options.style.
providers:
- type: map
name: WMSFacade
data: https://demo.mapserver.org/cgi-bin/msautotest
options:
layer: world_latlong
style: default
version: 1.3.0
format:
name: png
mimetype: image/png
Data visualization examples
list all collections
overview of dataset
map (default format)
map with bbox subset
map with bbox and temporal subset
map with bbox and bbox-crs