Provincial GIS Server API

Version 1.0 (GeoServer / OGC Services)

Table of Contents


1. Introduction

This document describes how to integrate Provincial GIS data hosted on a GIS Server instance into external web and desktop applications. GeoServer is an open‑source server that implements industry‑standard OGC (Open Geospatial Consortium) protocols: WMS (Web Map Service), WFS (Web Feature Service), WCS (Web Coverage Service), and WMTS (Web Map Tile Service). These protocols allow any OGC‑compliant client – from web mapping libraries to desktop GIS software – to access and display geospatial data.

By following this guide, developers will be able to:

All endpoints are based on the provincial GeoServer instance at https://gis.ecotp.gov.za/geoserver/ecpg/wms.

2. Base URL and Service Endpoints

The base URL for all OGC services is:

https://gis.ecotp.gov.za/geoserver/ecpg/wms

Individual service endpoints are accessed by appending the service name and version:

ServiceTypical Endpoint (with required parameters)
WMShttps://gis.ecotp.gov.za/geoserver/ecpg/wms?service=WMS&version=1.3.0&request=...
WFShttps://gis.ecotp.gov.za/geoserver/ecpg/wfs?service=WFS&version=2.0.0&request=...
WCShttps://gis.ecotp.gov.za/geoserver/ecpg/wcs?service=WCS&version=2.0.1&request=...
WMTShttps://gis.ecotp.gov.za/geoserver/ecpg/gwc/service/wmts?request=GetCapabilities
RESThttps://gis.ecotp.gov.za/geoserver/ecpg/rest/... (admin)

Note: GeoServer also supports tiled WMS via GeoWebCache, which can be accessed through the same WMS endpoint with additional tiled=true parameter or through dedicated WMTS.

3. Authentication

Access to public data layers may be unrestricted. However, some layers (e.g., sensitive cadastral information) require authentication.

If authentication is required, use HTTP Basic Authentication with a username and password provided by the Provincial GIS department.

Example with curl:

curl -u username:password "https://gis.ecotp.gov.za/geoserver/ecpg/wfs?service=WFS&version=2.0.0&request=GetCapabilities"

Alternatively, an API key may be passed as a query parameter or header. Consult the specific layer metadata for requirements.

4. Discovering Available Data

Before accessing data, you need to know which layers are available and their properties. GeoServer provides GetCapabilities documents for each service.

WMS GetCapabilities

Request the WMS capabilities to get a list of all vector and raster layers that can be displayed as maps.

URL:

GET https://gis.ecotp.gov.za/geoserver/ecpg/wms?service=WMS&version=1.3.0&request=GetCapabilities

Response: XML document describing:

Key element: <Layer> – each layer has a <Name> that you will use in subsequent requests (e.g., province:parcels).

WFS GetCapabilities

For vector feature access, request the WFS capabilities.

URL:

GET https://gis.ecotp.gov.za/geoserver/ecpg/wfs?service=WFS&version=2.0.0&request=GetCapabilities

Response: XML describing feature types (layers) and their attribute schemas. The <Name> (e.g., province:roads) is used in WFS requests.

WCS GetCapabilities

For raster coverages (elevation, satellite imagery, etc.):

URL:

GET https://gis.ecotp.gov.za/geoserver/ecpg/wcs?service=WCS&version=2.0.1&request=GetCapabilities

Response: XML with coverage offerings and their formats.

5. Accessing Map Images (WMS)

WMS is used to retrieve georeferenced map images (PNG, JPEG, etc.) for display in web or desktop applications.

GetMap Request

Mandatory parameters:

Example GetMap URL:

https://gis.ecotp.gov.za/geoserver/ecpg/wms?service=WMS&version=1.3.0&request=GetMap
&layers=province:parcels&styles=&bbox=-124,48,-122,49&width=800&height=600
&format=image/png&crs=EPSG:4326

Response: The requested image (PNG, JPEG, etc.).

WMS Layer in OpenLayers

import Map from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile';
import TileWMS from 'ol/source/TileWMS';

const parcels = new TileLayer({
  source: new TileWMS({
    url: 'https://gis.ecotp.gov.za/geoserver/ecpg/wms',
    params: {
      'LAYERS': 'province:parcels',
      'TILED': true
    },
    serverType: 'geoserver'
  })
});

const map = new Map({
  target: 'map',
  layers: [parcels],
  view: new View({
    projection: 'EPSG:3857',
    center: [-13600000, 6400000],
    zoom: 8
  })
});

Adding WMS to QGIS

  1. Open QGIS.
  2. Go to LayerAdd LayerAdd WMS/WMTS Layer.
  3. Click New to create a new connection.
  4. Set Name (e.g., "Provincial GIS") and URL to https://gis.ecotp.gov.za/geoserver/ecpg/wms?.
  5. Click OK, then Connect.
  6. Select desired layers from the list and click Add.

Adding WMS to ArcGIS Pro

  1. Open ArcGIS Pro
  2. On the Insert Tab in the project groupconnectionsServer.
  3. Click New WMS Server to create a new connection.The Add WMS Server Connection dialog box appears
  4. Type the Server URL: Server URL: https://gis.ecotp.gov.za/geoserver/ecpg/wms?
  5. Click OK
  6. Select desired layers from the list and click Add.

6. Accessing Vector Features (WFS)

WFS allows you to query and download actual geometry and attribute data in formats like GML, GeoJSON, Shapefile, etc.

GetFeature Request

Mandatory parameters:

Optional parameters:

Example GetFeature URL (GeoJSON):

https://gis.ecotp.gov.za/geoserver/ecpg/wfs?service=WFS&version=2.0.0&request=GetFeature
&typeNames=province:parcels&bbox=-124,48,-122,49&outputFormat=application/json
&maxFeatures=100

Response: GeoJSON FeatureCollection.

Filtering with CQL

GeoServer supports CQL (Common Query Language) for flexible filtering. Use the cql_filter parameter.

Example: Find parcels with area > 5000 and owner name containing "Smith"

&cql_filter=area > 5000 AND owner LIKE '%Smith%'

URL encoding is required.

Fetching Features with JavaScript (Fetch API)

const url = 'https://gis.ecotp.gov.za/geoserver/ecpg/wfs?service=WFS&version=2.0.0' +
            '&request=GetFeature&typeNames=province:parcels' +
            '&bbox=-124,48,-122,49&outputFormat=application/json&maxFeatures=50';

fetch(url)
  .then(response => response.json())
  .then(data => {
    console.log('Received', data.features.length, 'features');
    // process GeoJSON
  });

WFS Layer in QGIS

  1. In QGIS, go to LayerAdd LayerAdd WFS Layer.
  2. Click New and enter:
    • Name: Provincial WFS
    • URL: https://gis.ecotp.gov.za/geoserver/ecpg/wfs
  3. Click OK, then Connect.
  4. Select a feature type (e.g., province:parcels), choose desired format (e.g., GeoJSON), and click Add.
  5. Optionally, apply a filter by clicking Build query to use CQL.

Adding WMF to ArcGIS Pro

  1. Open ArcGIS Pro
  2. On the Insert Tab in the project groupconnectionsServer.
  3. Click New WFS Server to create a new connection.The Add WFS Server Connection dialog box appears
  4. Type the Server URL: Server URL: https://gis.ecotp.gov.za/geoserver/ecpg/wfs?
  5. Click OK
  6. Select desired layers from the list and click Add.

7. Accessing Raster Data (WCS)

WCS provides access to raw raster data (coverages) such as digital elevation models, land cover grids, etc. Data can be downloaded in formats like GeoTIFF.

GetCoverage Request

Mandatory parameters:

Optional parameters:

Example GetCoverage URL (GeoTIFF):

https://gis.ecotp.gov.za/geoserver/ecpg/wcs?service=WCS&version=2.0.1&request=GetCoverage
&coverageId=province:dem&format=image/tiff&subset=Lat(48,49)&subset=Long(-124,-122)

Response: Binary GeoTIFF file.

8. Tiled Services (WMTS)

For high‑performance web mapping, GeoServer includes GeoWebCache, which provides tiles in WMTS and other formats. WMTS offers static tiles (vector or raster) at predefined zoom levels.

WMTS GetTile

Mandatory parameters:

Alternatively, use the simplified XYZ template often used by web maps:

https://gis.ecotp.gov.za/geoserver/ecpg/gwc/service/wmts?layer=province:parcels&style=&tilematrixset=EPSG:900913&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TileMatrix={z}&TileCol={x}&TileRow={y}

Example: WMTS in Leaflet (with TileLayer)

L.tileLayer('https://gis.ecotp.gov.za/geoserver/ecpg/gwc/service/wmts?' +
            'layer=province:parcels&style=&tilematrixset=EPSG:900913' +
            '&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png' +
            '&TileMatrix={z}&TileCol={x}&TileRow={y}', {
  maxZoom: 18,
  attribution: 'Provincial GIS'
}).addTo(map);

For vector tiles (MVT), set Format=application/vnd.mapbox-vector-tile and use a library like Mapbox GL JS or OpenLayers.

9. GeoServer REST API (Optional)

GeoServer provides a RESTful API for administrative tasks such as creating workspaces, uploading data, and managing styles. This API is not intended for general data access, but may be used by advanced integrators for automation.

Base URL: https://gis.ecotp.gov.za/geoserver/ecpg/rest/

Authentication is required (usually HTTP Basic). For full documentation, see the GeoServer REST API reference.

Example: Get list of workspaces:

curl -u username:password https://gis.ecotp.gov.za/geoserver/ecpg/rest/workspaces.json

10. Error Handling

GeoServer returns standard OGC exception reports in XML or JSON (depending on format requested). HTTP status codes indicate the nature of the error:

Example WFS Exception (XML):

<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows" version="2.0.0">
  <ows:Exception exceptionCode="InvalidParameterValue" locator="typeNames">
    <ows:ExceptionText>Unknown feature type 'province:nonexistent'</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

In JSON outputFormat, the exception may be returned as a JSON object with "ows:ExceptionReport".

11. Best Practices and Limitations

12. Appendix

Supported Coordinate Reference Systems

Common EPSG codes available:

See layer metadata for native CRS.

Common WMS/WFS Parameters

ParameterDescription
versionService version (WMS:1.3.0, WFS:2.0.0, WCS:2.0.1)
requestOperation (GetMap, GetFeature, GetCoverage, GetCapabilities)
layers (WMS) / typeNames (WFS)Layer(s) to query
bboxBounding box (minx,miny,maxx,maxy) in CRS coordinates
crs (WMS) / srsName (WFS)Output coordinate reference system
format / outputFormatResponse format (image/png, application/json, shape‑zip, etc.)
width / heightImage dimensions (WMS only)
cql_filterCQL filter expression (WFS)
maxFeaturesMaximum number of features to return (WFS)

Glossary

Change Log

VersionDateChanges
1.020256-02-18Initial GeoServer‑focused release.

For further assistance, contact Langalethu.Majola@ecotp.gov.za or visit the Provincial GIS Developer Portal.