v1
OGC API - Features
Mapalyze implémente OGC API - Features (Partie 1 Core + Partie 4 Transactions).
URL de base
https://<ref>.supabase.co/functions/v1/api-gateway/oapif
Authentification
Envoyez la clé API dans X-API-Key :
curl -H "X-API-Key: mk_live_..." \
"https://<ref>.supabase.co/functions/v1/api-gateway/oapif/collections"
Conformance
ogcapi-features-1/1.0/conf/coreogcapi-features-1/1.0/conf/geojsonogcapi-features-4/1.0/conf/create-replace-deleteogcapi-features-4/1.0/conf/update
Endpoints
Découverte
| Méthode | Chemin | Description |
|---|---|---|
| GET | /oapif/ |
Document d'accueil |
| GET | /oapif/conformance |
Déclaration de conformance |
| GET | /oapif/api |
Définition OpenAPI |
Collections (formulaires)
| Méthode | Chemin | Description |
|---|---|---|
| GET | /oapif/collections |
Lister les collections de formulaires |
| GET | /oapif/collections/{formId} |
Métadonnées de collection + schéma |
Items (enregistrements)
| Méthode | Chemin | Portée | Description |
|---|---|---|---|
| GET | /oapif/collections/{formId}/items |
read | Lister les enregistrements en GeoJSON FeatureCollection |
| GET | /oapif/collections/{formId}/items/{recordId} |
read | Feature individuel |
| POST | /oapif/collections/{formId}/items |
write | Créer un Feature |
| PUT | /oapif/collections/{formId}/items/{recordId} |
write | Remplacer un Feature |
| PATCH | /oapif/collections/{formId}/items/{recordId} |
write | Mise à jour partielle d'un Feature |
| DELETE | /oapif/collections/{formId}/items/{recordId} |
write | Suppression douce d'un Feature |
Paramètres de requête (GET items)
| Paramètre | Type | Description |
|---|---|---|
limit |
int | Features par page (par défaut 100, max 10000) |
offset |
int | Offset pour la pagination |
bbox |
string | minLng,minLat,maxLng,maxLat |
bbox-crs |
string | Supporté : CRS84, urn:ogc:def:crs:OGC:1.3:CRS84, ou URL OGC CRS84 complète |
datetime |
string | Instant ou intervalle ISO-8601 (2026-01-01T00:00:00Z/..) |
project_id |
string | Filtrer par projet |
f |
string | Format de sortie : json ou geojson |
Un f invalide ou bbox-crs non supporté retourne 400 validation_error.
Pagination et métadonnées
Les réponses incluent des liens de pagination déterministes et des compteurs :
{
"type": "FeatureCollection",
"timeStamp": "2026-02-20T09:30:12.121Z",
"numberMatched": 78,
"numberReturned": 10,
"features": [],
"links": [
{"href": "...?limit=10&offset=0", "rel": "self"},
{"href": "...?limit=10&offset=10", "rel": "next"}
]
}
Le gateway préserve les paramètres de requête pertinents (bbox, datetime, project_id, f, bbox-crs) dans les liens générés.
Créer un feature
curl -X POST \
-H "X-API-Key: mk_live_..." \
-H "Content-Type: application/json" \
"https://<ref>.supabase.co/functions/v1/api-gateway/oapif/collections/{formId}/items" \
-d '{
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [-6.75, 37.57]},
"properties": {
"name": "New Point",
"project_id": "c328e46a-8fb9-41f1-a5f9-3dca9a894ab3"
}
}'
Notes :
- La géométrie doit être du GeoJSON valide.
- Le payload de géométrie est limité à 100 Ko.
- Si
properties.project_idest fourni, il doit appartenir à la même organisation. - Les propriétés système (
_mapalyze_*) dans l'entrée sont ignorées.
CRS
Les réponses incluent :
Content-Crs: <http://www.opengis.net/def/crs/OGC/1.3/CRS84>
Toutes les coordonnées sont en CRS84 (WGS84 lon/lat).
Limites de débit
Les endpoints OGC suivent les mêmes limites de clé API documentées dans Erreurs et Limites de Débit.
Besoin d'aide avec l'API ? Contactez notre équipe support.