--- name: gc2-ogc description: Use when reading features or rendering maps through the OGC API (OGC API Features Part 1/2, OGC API Maps Part 1) in GC2 BaaS — /api/v4/ogc/database/{database}/... routes, collections, items as GeoJSON with bbox/limit/offset/crs/datetime, map images, the getOgc* tools, CRS URIs and axis order, or the 401/403/404 semantics of collections. --- # OGC API (Features + Maps) Use this skill for the v4 OGC API under `/api/v4/ogc/database/{database}`: a standards-based, read-only view of OWS-enabled layers. Features are served by the in-process WFS engine (geofence rules with service `wfst`, versioning, workflow all apply), maps by the WMS backend through the OWS proxy (rules with service `ows`, versioning). For single-feature CRUD use `gc2-feature`; for classic WMS/WFS/WMTS use `gc2-ows`. ## Availability Lives on the GeoCloud2 branch `feature/v4-ogc-api` (2026-09-10/11). **Not** on production `api.gc2.io` yet — assume dev-only. SDK: `@mapcentia/gc2-sdk` 0.3.0+ ships the `Ogc` class (explicit-client pattern, `new Ogc(client)`) with `getLandingPage`, `getConformance`, `getCollections`, `getCollection`, `getItems
`, `getItem
`, and the URL builders `mapUrl`/`datasetMapUrl` for images, plus `OGC_CRS84` and `ogcEpsgCrs(code)` for CRS URIs. Otherwise use the MCP tools or plain HTTP. `f=jpeg` maps need the WMS mapfiles regenerated once after upgrade (save any layer via `postLayer`, or the legacy `/controllers/mapfile` endpoint).
## Routes and MCP tools
All routes are `GET`, public (`Scope::PUBLIC`): Bearer token, HTTP Basic or anonymous. A Bearer token must match `{database}` (401 otherwise). Collection id is always `schema.table`.
| Route (relative to `/api/v4/ogc/database/{database}`) | Tool | Returns |
|---|---|---|
| `/` | `getOgcLandingPage` | links: `conformance`, `data` (collections), `service-desc` (OpenAPI), `service-doc` |
| `/conformance` | `getOgcConformance` | `conformsTo` — Features Core/GeoJSON/OAS30/CRS, Maps Core/bbox/crs/datetime/png/jpeg |
| `/collections?limit&offset` | `getOgcCollections` | `collections[]`, `numberMatched`, `numberReturned`, `next`/`prev` links (limit default 100, max 1000) |
| `/collections/{id}` | `getOgcCollection` | `id`, `title`, `description`, `extent.spatial.bbox` (CRS84), `extent.temporal` (versioned layers), `crs[]`, `storageCrs`, links `items` (vector only) and `map` |
| `/collections/{id}/items?limit&offset&bbox&bbox-crs&crs&datetime` | `getOgcItems` / `Ogc.getItems(db, id, {limit, offset, bbox, bboxCrs, crs, datetime})` | streamed `application/geo+json` FeatureCollection + `Content-Crs` header |
| `/collections/{id}/items/{fid}?crs&datetime` | `getOgcItem` / `Ogc.getItem` | bare GeoJSON `Feature` with `links` |
| `/collections/{id}/map?bbox&bbox-crs&crs&width&height&f&transparent&bgcolor&datetime` | `getOgcCollectionMap` / `Ogc.mapUrl` | `image/png` (default) or `image/jpeg` |
| `/map?collections=a,b&...` | `getOgcDatasetMap` / `Ogc.datasetMapUrl` | image with several collections **of the same schema** (400 otherwise) |
Only layers with WFS/OWS enabled (`enableows`) are collections. Raster layers appear as collections without `itemType`/`items` (map only). The MCP tools return the response as text: fine for JSON, useless for map images — fetch maps over HTTP.
## Items: parameters and defaults
- `limit` default **10**, max 10000 (values above are clamped); `offset` default 0. The response always carries `numberMatched` (exact count, saturating at 1,000,000) and `numberReturned`; follow the `next` link to page.
- `bbox` = `minx,miny,maxx,maxy` (6 values allowed, the vertical pair is dropped) in the axis order of `bbox-crs`; a lower corner above the upper corner is 400 (no antimeridian boxes).
- `crs` / `bbox-crs` must be a URI from the collection's `crs` list: `http://www.opengis.net/def/crs/OGC/1.3/CRS84` (default, lon/lat), `http://www.opengis.net/def/crs/EPSG/0/4326` (**lat/lon** axis order, both in bbox input and GeoJSON output), `http://www.opengis.net/def/crs/EPSG/0/