Skip to content
Snippets Groups Projects

MapServer REST API Resources

This section describes the REST configuration API.

It is in process of writing... Nevertheless, you could refer to the GeoServer Rest API documentation cause MRA was designed to offer compatibility with this model. You will also find few docstrings by reading the code, especially the module server.py which defines the URL mapping infrastructure and HTTP methods used by the REST API.

Workspaces

A workspace is a grouping of data stores and coverage stores.

A data store is a source of spatial data that is vector based. It can be a file such as a shapefile or a database such as PostGIS. A data store contains one or more feature types which are vector based spatial resource. In cases of a shapefile, the feature type is unique and corresponds to the data store. In cases of a PostGIS database, feature types corresponds to tables.

A coverage store is a source of spatial data that is raster based. In current version, it can only be a GeoTIFF file. For this format file, the coverage is unique and corresponds to the coverage store.

Resource Description
GET workspaces Returns a list containing workspaces.
POST workspaces Creates a new workspace.
GET workspaces/{ws} Returns the given workspace.
GET workspaces/{ws}/datastores Returns a list containing data stores in the given workspace.
POST workspaces/{ws}/datastores Creates a new data store.
GET workspaces/{ws}/datastores/{ds} Returns data store {ds}.
PUT workspaces/{ws}/datastores/{ds} Modifies data store {ds}.
DELETE workspaces/{ws}/datastores/{ds} Deletes data store {ds}.
PUT workspaces/{ws}/datastores/{ds}/file.{extension} Uploads a vector data file from a local source.
GET workspaces/{ws}/datastores/{ds}/featuretypes Returns a list containing all feature types in selected data store.
POST workspaces/{ws}/datastores/{ds}/featuretypes Creates a new feature type. It creates the associated layer by default.
GET workspaces/{ws}/datastores/{ds}/featuretypes/{ft} Returns feature type {ft}.
PUT workspaces/{ws}/datastores/{ds}/featuretypes/{ft} Modifies feature type {ft}.
DELETE workspaces/{ws}/datastores/{ds}/featuretypes/{ft} Delete feture type {ft}.
GET workspaces/{ws}/coveragestores Returns a list containing coverage stores in the given workspace.
POST workspaces/{ws}/coveragetores Creates a new coverage store.
GET workspaces/{ws}/coveragestores/{cs} Returns coverage store {cs}.
PUT workspaces/{ws}/coveragestores/{cs} Modifies coverage store {ds}.
DELETE workspaces/{ws}/coveragestores/{cs} Deletes coverage store {ds}.
PUT workspaces/{ws}/coveragestores/{cs}/file.{extension} Uploads a raster data file from a local source.
GET workspaces/{ws}/coveragestores/{cs}/coverages Returns a list containing all coverages in selected coverage store.
POST workspaces/{ws}/coveragestores/{cs}/coverages Creates a new coverage. It creates the associated layer by default.
GET workspaces/{ws}/coveragestores/{cs}/coverages/{c} Returns coverage {c}.
PUT workspaces/{ws}/coveragestores/{cs}/coverages/{c} Modifies coverage {c}.
DELETE workspaces/{ws}/coveragestores/{cs}/coverages/{c} Deletes coverage {c}.

Styles

A style describes how a resource (a feature type or a coverage) should be symbolized or rendered by a Web Map Service. Styles are specified with SLD.

Resource Description
GET styles Returns a list containing all SLD styles.
POST styles Creates a new SLD style.
GET styles/{s} Returns style {s}.
PUT styles/{s} Modifies style {s}.
DELETE styles/{s} Deletes style {s}.

Layers

A layer is a data resource that could be published by a OGC Web Service. So a layer is the combination of data (feature type or coverage) plus styling (in case of OGC:WMS).

Resource Description
GET layers Returns a list containing all layers.
POST layers Creates a new layer.
GET layers/{l} Returns layer {l}.
PUT layers/{l} Modifies layer {l}.
DELETE layers/{l} Deletes layer {l}.
GET layers/{l}/styles Returns a list containing all styles associated to layer {l}.
DELETE layers/{l}/styles/{s} Removes style {s} from layer {l}.
GET layers/{l}/fields Returns a list containing all fields associated to layer {l}.

Layer groups

A layergroup is a grouping of layers and styles that can be accessed as a single layer in a OGC:WMS GetMap request.

Resource Description
GET layergroups Returns a list containing all existing layer groups.
POST layergroups Creates a new layer group.
GET layergroups/{lg} Returns layer group {lg}.
PUT layergroups/{lg} Modifies layer group {lg}.
DELETE layergroups/{lg} Delete layer group {lg}.

OGC Web Services

Controls the settings of OWS services (available for OGC:WMS, OGC:WFS and OGC:WCS).

Resource Description
GET service/[wms,wfs,wcs]/setting Returns the status of the main OGC service.
PUT service/[wms,wfs,wcs]/setting Enables or disables the main OGC service.

Fonts

Configures available fonts.

Resource Description
GET fonts Returns the list of available fonts.
PUT fonts Uploads fonts from a local source.