Skip to main content

OGC services

Every table with a geometry column is automatically exposed as a layer through the Open Geospatial Consortium (OGC) standards WMS (Web Map Service) and WFS (Web Feature Service). This means you can view and edit your data directly in desktop GIS clients like QGIS, or render maps in web applications with OpenLayers, Leaflet or MapLibre — no extra configuration needed.

  • WMS renders your data as map images (PNG/JPEG) on the server, styled with the classes, styles and labels you have configured.
  • WFS serves the actual vector features (geometries and attributes) and supports transactions (WFS-T), so features can be inserted, updated and deleted through the standard.

Endpoints

The services are exposed per schema. There are two sets of endpoints, depending on how the client authenticates:

Token-authenticated — for applications that send an Authorization: Bearer header:

https://api.centia.io/api/v4/ows/schema/{schema}
https://api.centia.io/api/v4/wfs/schema/{schema}

Anonymous / HTTP Basic — for clients that cannot send a bearer token (e.g. desktop GIS). The database name is part of the URL:

https://api.centia.io/api/v4/ows/schema/{schema}/database/{database}
https://api.centia.io/api/v4/wfs/schema/{schema}/database/{database}

The /ows endpoint is a combined read-only endpoint serving WMS, WFS and UTFGRID requests. The /wfs endpoint additionally accepts XML-encoded POST requests for GetFeature and WFS-T transactions.

Both WFS endpoints accept an optional srs path segment to reproject the output to a specific EPSG code, and an optional timeSlice segment (ISO date) for versioned layers:

https://api.centia.io/api/v4/wfs/schema/{schema}/srs/{srs}
Authentication and privileges

Which layers a service exposes — and whether they can be read or written — follows the privileges of the authenticated user. Anonymous requests are served with the privileges of the default (public) sub-user, so layers readable by the default user are readable without credentials. Protected layers are challenged with HTTP Basic auth on the anonymous endpoints.

WMS

WMS renders map images on the server. Versions 1.1.0 and 1.3.0 are supported (with 1.3.0, use the CRS parameter instead of SRS). Start with GetCapabilities to see the available layers:

GetCapabilities
GET https://api.centia.io/api/v4/ows/schema/rockhall?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetCapabilities HTTP/1.1
Authorization: Bearer abc123

Request a rendered map image with GetMap. Layers are named schema.table:

GetMap
GET https://api.centia.io/api/v4/ows/schema/rockhall?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&LAYERS=rockhall.venues&STYLES=&SRS=EPSG:3857&BBOX=1204164,7485240,1259200,7534200&WIDTH=1024&HEIGHT=768&FORMAT=image/png&TRANSPARENT=true HTTP/1.1
Authorization: Bearer abc123

The rendering — colors, symbols, scale visibility and labels — is controlled through the Layer API.

WFS

WFS versions 1.0.0 and 1.1.0 are supported with the operations GetCapabilities, DescribeFeatureType and GetFeature.

GetCapabilities
GET https://api.centia.io/api/v4/wfs/schema/rockhall?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities HTTP/1.1
Authorization: Bearer abc123
GetFeature
GET https://api.centia.io/api/v4/wfs/schema/rockhall?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=venues&MAXFEATURES=100&SRSNAME=EPSG:4326 HTTP/1.1
Authorization: Bearer abc123

GetFeature supports the query parameters TYPENAME (comma-separated table names), BBOX (minx,miny,maxx,maxy), FILTER (OGC Filter Encoding XML), SRSNAME, MAXFEATURES and OUTPUTFORMAT.

Transactions (WFS-T)

XML-encoded GetFeature and Transaction requests are sent with POST to the WFS endpoint. Transactions require write privilege on the table:

Insert a feature
POST https://api.centia.io/api/v4/wfs/schema/rockhall HTTP/1.1
Content-Type: application/xml
Authorization: Bearer abc123

<wfs:Transaction version="1.1.0" service="WFS"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:rockhall="http://api.centia.io">
<wfs:Insert>
<rockhall:venues>
<rockhall:name>Whisky a Go Go</rockhall:name>
<rockhall:the_geom>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>-118.331,34.090</gml:coordinates>
</gml:Point>
</rockhall:the_geom>
</rockhall:venues>
</wfs:Insert>
</wfs:Transaction>

Connecting from QGIS

Use the anonymous/HTTP Basic endpoints when adding a WMS or WFS connection in QGIS:

  1. In QGIS, choose Layer → Add Layer → Add WMS/WMTS Layer… (or Add WFS Layer…).
  2. Create a new connection with the URL https://api.centia.io/api/v4/ows/schema/{schema}/database/{database} (WMS) or https://api.centia.io/api/v4/wfs/schema/{schema}/database/{database} (WFS).
  3. If the layers are not publicly readable, enter a sub-user's name and password as Basic authentication.
  4. Connect and add the layers to your project.