Skip to content

OGC Endpoints

Sanson implements OGC API — Features at the root URL. These endpoints are compatible with QGIS, ArcGIS, FME, and any OGC-compliant client.

Landing page

GET /

Returns the API entry point with links to conformance, collections, and the OpenAPI spec.

json
{
  "title": "Sanson",
  "description": "An open source geospatial server — OGC API Features compliant",
  "links": [
    { "href": "/", "rel": "self", "type": "application/json" },
    { "href": "/conformance", "rel": "conformance", "type": "application/json" },
    { "href": "/collections", "rel": "data", "type": "application/json" },
    {
      "href": "/api",
      "rel": "service-desc",
      "type": "application/vnd.oai.openapi+json;version=3.0"
    }
  ]
}

Conformance

GET /conformance

Declares the OGC conformance classes supported by Sanson:

Conformance classStatus
CoreImplemented
GeoJSONImplemented
OAS30Implemented
FilterImplemented
Features FilterImplemented
QueryablesImplemented
CQL2 TextImplemented
CQL2 BasicImplemented
CQL2 Basic SpatialImplemented
CQL2 Spatial FunctionsImplemented
CQL2 Advanced ComparisonImplemented
Tiles CoreImplemented
TilesetImplemented
Tile Matrix SetImplemented
CQL2 JSONImplemented
CQL2 TemporalImplemented
CRS by ReferenceImplemented

OpenAPI specification

GET /api

Returns the auto-generated OpenAPI 3.0 specification. The admin UI includes an interactive API explorer powered by Scalar for testing endpoints directly from the browser.

Collections

GET /collections

Lists all available feature collections across all workspaces.

GET /collections/{collectionId}

Returns metadata for a single collection.

Collection ID format: {workspaceName}:{collectionName} (e.g., default:regions).

TIP

The : separator follows the same convention used by GeoServer. If your proxy or WAF has issues with : in URLs, clients can encode it as %3A.

Response example

json
{
  "id": "default:regions",
  "title": "regions",
  "extent": {
    "spatial": { "bbox": [[-5.1, 41.3, 9.6, 51.1]] }
  },
  "itemType": "feature",
  "crs": ["http://www.opengis.net/def/crs/OGC/1.3/CRS84"],
  "links": [
    { "href": "/collections/default:regions", "rel": "self", "type": "application/json" },
    {
      "href": "/collections/default:regions/items",
      "rel": "items",
      "type": "application/geo+json"
    },
    {
      "href": "/collections/default:regions/queryables",
      "rel": "queryables",
      "type": "application/schema+json"
    }
  ]
}

Features

GET /collections/{collectionId}/items

Returns features as a GeoJSON FeatureCollection with pagination.

Query parameters

ParameterDescriptionExample
limitNumber of features per page (default: 25, max: 100)?limit=50
offsetPagination offset (default: 0)?offset=100
bboxBounding box filter?bbox=2.2,48.8,2.5,49.0
datetimeTemporal filter (requires configured datetime_column)?datetime=2024-01-01/2024-12-31
lat + lonPoint intersection filter?lat=48.85&lon=2.35
lat + lon + radiusRadius search in meters?lat=48.85&lon=2.35&radius=1000
filterCQL2 Text or JSON expression?filter=population>100000
filter-langFilter language (cql2-text or cql2-json)?filter-lang=cql2-text
crsOutput CRS URI (default: CRS84)?crs=http://...EPSG/0/3857
bbox-crsCRS of bbox values (default: CRS84)?bbox-crs=http://...EPSG/0/3857

See CQL2 Filtering and Spatial Filtering for details.

Coordinate Reference Systems

By default, coordinates are returned in WGS84 (CRS84, longitude/latitude). Use the crs parameter to request coordinates in a different CRS:

GET /collections/default:communes/items?crs=http://www.opengis.net/def/crs/EPSG/0/2154

The response includes a Content-Crs header indicating the CRS used:

Content-Crs: <http://www.opengis.net/def/crs/EPSG/0/2154>

Supported CRS per collection are listed in the collection metadata (crs array). Common CRS include:

  • http://www.opengis.net/def/crs/OGC/1.3/CRS84 (default, WGS84 lon/lat)
  • http://www.opengis.net/def/crs/EPSG/0/4326 (WGS84)
  • http://www.opengis.net/def/crs/EPSG/0/3857 (Web Mercator)
  • http://www.opengis.net/def/crs/EPSG/0/2154 (Lambert 93, France)

The bbox-crs parameter specifies the CRS of bbox values when they are not in WGS84.

Pagination

The response includes pagination links in both the JSON body and HTTP headers:

json
{
  "type": "FeatureCollection",
  "features": [],
  "numberMatched": 142,
  "numberReturned": 25,
  "links": [
    { "href": "/collections/default:regions/items?offset=0&limit=25", "rel": "self" },
    { "href": "/collections/default:regions/items?offset=25&limit=25", "rel": "next" },
    { "href": "/collections/default:regions/items?offset=0&limit=25", "rel": "first" },
    { "href": "/collections/default:regions/items?offset=125&limit=25", "rel": "last" }
  ]
}

HTTP headers:

X-Total-Count: 142
Link: </collections/default:regions/items?offset=25&limit=25>; rel="next", ...

All query parameters (bbox, datetime, filter, etc.) are preserved in pagination links.

Feature by ID

GET /collections/{collectionId}/items/{featureId}

Returns a single GeoJSON Feature by its identifier.

Queryables

GET /collections/{collectionId}/queryables

Returns a JSON Schema describing the filterable properties of the collection. This enables GIS clients like QGIS to dynamically build filter UIs without prior knowledge of the data schema.

TIP

If exposed fields are configured on the collection, only those columns appear in queryables, features, and vector tiles. Aliases are reflected in property names.

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "/collections/default:regions/queryables",
  "type": "object",
  "title": "regions",
  "properties": {
    "geom": { "$ref": "https://geojson.org/schema/Geometry.json" },
    "nom": { "title": "nom", "type": "string" },
    "code": { "title": "code", "type": "string" }
  }
}

Style

GET /collections/{collectionId}/style

Returns the style configuration for a collection (see Collection Style for the format). Returns 204 No Content if no style is configured. External clients can use this endpoint to apply consistent styling.

Health check

GET /health

Returns the database connectivity status. Useful for load balancer health probes.

Released under the MIT License.