v1
OGC API - Features
O Mapalyze implementa OGC API - Features (Parte 1 Core + Parte 4 Transactions).
URL base
https://<ref>.supabase.co/functions/v1/api-gateway/oapif
Autenticação
Envie a chave API em 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
Descoberta
| Método | Caminho | Descrição |
|---|---|---|
| GET | /oapif/ |
Documento de início |
| GET | /oapif/conformance |
Declaração de conformance |
| GET | /oapif/api |
Definição OpenAPI |
Collections (formulários)
| Método | Caminho | Descrição |
|---|---|---|
| GET | /oapif/collections |
Listar coleções de formulários |
| GET | /oapif/collections/{formId} |
Metadados da coleção + esquema |
Items (registros)
| Método | Caminho | Escopo | Descrição |
|---|---|---|---|
| GET | /oapif/collections/{formId}/items |
read | Listar registros como GeoJSON FeatureCollection |
| GET | /oapif/collections/{formId}/items/{recordId} |
read | Feature individual |
| POST | /oapif/collections/{formId}/items |
write | Criar Feature |
| PUT | /oapif/collections/{formId}/items/{recordId} |
write | Substituir Feature |
| PATCH | /oapif/collections/{formId}/items/{recordId} |
write | Atualização parcial de Feature |
| DELETE | /oapif/collections/{formId}/items/{recordId} |
write | Exclusão suave de Feature |
Parâmetros de consulta (GET items)
| Parâmetro | Tipo | Descrição |
|---|---|---|
limit |
int | Features por página (padrão 100, máx 10000) |
offset |
int | Offset para paginação |
bbox |
string | minLng,minLat,maxLng,maxLat |
bbox-crs |
string | Suportado: CRS84, urn:ogc:def:crs:OGC:1.3:CRS84, ou URL OGC CRS84 completa |
datetime |
string | Instante ou intervalo ISO-8601 (2026-01-01T00:00:00Z/..) |
project_id |
string | Filtrar por projeto |
f |
string | Formato de saída: json ou geojson |
Um f inválido ou bbox-crs não suportado retorna 400 validation_error.
Paginação e metadados
As respostas incluem links de paginação determinísticos e contagens:
{
"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"}
]
}
O gateway preserva os parâmetros de consulta relevantes (bbox, datetime, project_id, f, bbox-crs) nos links gerados.
Criar um 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"
}
}'
Notas:
- A geometria deve ser GeoJSON válido.
- O payload de geometria é limitado a 100KB.
- Se
properties.project_idfor fornecido, deve pertencer à mesma organização. - Propriedades do sistema (
_mapalyze_*) na entrada são ignoradas.
CRS
As respostas incluem:
Content-Crs: <http://www.opengis.net/def/crs/OGC/1.3/CRS84>
Todas as coordenadas são CRS84 (WGS84 lon/lat).
Limites de taxa
Os endpoints OGC seguem os mesmos limites de chave API documentados em Erros e Limites de Taxa.
Precisa de ajuda com a API? Entre em contato com nossa equipa de suporte.