Skip to content

Django-OAPIF Django-OAPIF

Django-OAPIF serves Django models through an OGC API - Features endpoint, built on Django Ninja. Clients such as QGIS read and edit their features, within the permissions of Django.

from django_oapif import OAPIF

oapif = OAPIF()
oapif.register_collection(Building)

Features

  • Every registered model is a collection of features, which clients query by box, filter, page and coordinate reference system, and create, replace, update and delete.
  • Features are served as GeoJSON, with curves in JSON-FG or linearized, or as GeoArrow.
  • Who may read and write each collection is decided by the model permissions of Django, or by others.
  • Each collection describes its features with a JSON Schema, and the API with an OpenAPI 3.1 document.

Standards

The API declares these conformance classes:

Standard Conformance classes
OGC API - Common - Part 1: Core Core, JSON, Landing page
OGC API - Common - Part 2: Geospatial data Collections
OGC API - Features - Part 1: Core Core, GeoJSON, OpenAPI 3.1
OGC API - Features - Part 2: Coordinate Reference Systems by Reference Coordinate Reference Systems by Reference
OGC API - Features - Part 3: Filtering Queryables, Filter, Features Filter
Common Query Language (CQL2) Basic CQL2, Advanced comparison operators, Case-insensitive comparison, Basic spatial functions, CQL2 Text
OGC API - Features - Part 4: Create, Replace, Update and Delete Create/Replace/Delete, Update, Features
OGC API - Features - Part 5: Schemas Core roles for features, Feature references, Returnables and receivables, Schemas, Profile query parameter
OGC Features and Geometries JSON - Part 1: Core Core, Circular arcs, GeoJSON profiles, JSON-FG in Web APIs

OpenAPI 3.1 is a class of the 1.1 draft of Part 1, as the published standards only have one for OpenAPI 3.0: see conformance.

Get started

Follow the quick start to serve your own models, or try the demo to see an API running.