v1

QGIS Integration

Mapalyze supports two QGIS integration paths:

  1. OGC API - Features (recommended, read/write)
  2. Direct PostGIS (read-only analysis)

Option 1: OGC API - Features (recommended)

Use this for operational editing from QGIS (create/update/delete).

Requirements

  • QGIS 3.40.4+
  • API key with read-write or admin scope
  • OGC endpoint URL: https://<ref>.supabase.co/functions/v1/api-gateway/oapif

Authentication config in QGIS

  1. QGIS -> Settings > Options > Authentication
  2. Add new config:
    • Type: API Header
    • Header: X-API-Key
    • Value: mk_live_... (or mk_test_... in sandbox)

Add OGC connection

  1. Layer > Add Layer > Add WFS / OGC API - Features Layer
  2. Create connection:
    • URL: https://<ref>.supabase.co/functions/v1/api-gateway/oapif
    • Authentication: select config above
    • Enable paging: enabled
  3. Connect and add layers.

Useful query params

Parameter Example Description
limit 200 Features per page
offset 0 Offset paging
bbox -7,37,-6,38 Spatial filter
datetime 2026-01-01T00:00:00Z/.. Updated-at filter
project_id uuid Project filter
f geojson Output format (json or geojson)

Option 2: Direct PostGIS (read-only)

Use this for advanced spatial SQL in PostGIS.

Requirements

  • QGIS 3.x
  • Direct DB connection credentials
  • Live API key (mk_live_...) with read-capable scope (read-only, read-write, or admin)

Session setup (required)

After connecting, run:

SELECT qgis.setup_session('mk_live_your_key_here');

This validates the key and scopes data to your organization.

Important:

  • qgis.setup_session requires live keys.
  • Test keys (mk_test_...) are rejected for production QGIS session setup.

Available views (qgis schema)

Layer Description
qgis.records Spatial records
qgis.records_all All records (including non-spatial)
qgis.forms Form metadata
qgis.projects Project metadata

Troubleshooting

Empty layers / no features

  • Confirm records actually have geometry.
  • Confirm form has a published version.
  • Confirm key has read scope and belongs to the correct org.

Permission denied on edits (OGC)

  • Use read-write or admin key.

QGIS access requires a live API key

  • Use a mk_live_... key for qgis.setup_session(...).

Invalid OGC URL

  • URL must end with /oapif.

Besoin d'aide avec l'API ? Contactez notre équipe support.

Commencer Gratuitement