REST API for storing and querying geographic features based on OGC standards, with custom extensions covering FKB requirements.
- CRUD Operations: Create, read, update, delete GeoJSON features
- Spatial Queries: Bounding box filtering with PostGIS spatial indexes
- Standards: GeoJSON-compliant input/output
- Auto-docs: Interactive API documentation at
/docs
# Start the API and database
docker-compose up
# API available at http://localhost:8000
# Interactive docs at http://localhost:8000/docs# Start PostgreSQL with PostGIS (if not using docker-compose)
docker run --name postgis-dev -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=geodata -p 5432:5432 -d postgis/postgis:18-3.6
# Install dependencies
uv sync
# Run the API
uv run --env-file dev.env uvicorn app.main:app --reloadGET /— Landing pageGET /conformance— API conformance to OGC standardsGET /collections— List of collections in the APIGET /collections/{collection_id}— Collection metadataGET /collections/{collection_id}/items— All features in a collectionPOST /collections/{collection_id}items— Create a featureGET /collections/{collection_id}/items/{feature_id}— A specific featurePATCH /collections/{collection_id}/items/{feature_id}— Partial update of featureDELETE /collections/{collection_id}/items/{feature_id}— Delete a feature
- FastAPI: Async web framework
- PostGIS: Spatial database extension for PostgreSQL
- psycopg: PostgreSQL adapter with connection pooling
- Pydantic: Request/response validation
- uv: Fast Python package manager
Set DATABASE_URL environment variable (default: postgresql://postgres:postgres@localhost:5432/geodata).