Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/danizd/geoviable/llms.txt

Use this file to discover all available pages before exploring further.

The GeoViable REST API is a FastAPI service that powers automated environmental feasibility assessment for land parcels in Galicia, Spain. It exposes endpoints for spatial analysis against 7 official environmental layers and PDF report generation. No authentication is required in the current MVP — the API is publicly accessible.

Base URLs

EnvironmentURL
Productionhttps://geoviable.movilab.es/api/v1
Local developmenthttp://localhost:8000/api/v1

Endpoints

MethodPathDescription
POST/analyzeRun spatial analysis, return JSON results
POST/report/generateRun analysis + generate PDF report
GET/layers/statusEnvironmental layer update status
GET/healthService health check

Authentication

No authentication is required. The API is publicly accessible in the MVP.
This is an MVP deployment with no authentication layer. Production deployments intended for restricted access should add authentication at the Nginx reverse-proxy level (e.g., HTTP Basic Auth or a bearer token header check) before exposing the API publicly.

Interactive Docs

FastAPI automatically generates interactive API documentation:
InterfaceURL
Swagger UI/api/v1/docs
ReDoc/api/v1/redoc
OpenAPI JSON schema/api/v1/openapi.json

Request Limits

LimitValue
Maximum body size5 MB
Maximum polygon area100 km²
Maximum polygon vertices10,000
Analysis timeout30 seconds
Polygons per request1

GeoJSON Input Format

All endpoints that accept a polygon expect a valid GeoJSON Feature object with a Polygon or MultiPolygon geometry. Coordinates must be in EPSG:4326 (WGS84 longitude/latitude order).
{
  "type": "Feature",
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [-8.5449, 42.8782],
        [-8.5400, 42.8782],
        [-8.5400, 42.8750],
        [-8.5449, 42.8750],
        [-8.5449, 42.8782]
      ]
    ]
  },
  "properties": {}
}

Geographic Scope

The API only accepts polygons within Galicia, Spain. Any geometry outside the bounding box below will be rejected with OUT_OF_BOUNDS. Galicia bounding box (EPSG:4326): [-9.5, 41.5, -6.5, 44.0] (min longitude, min latitude, max longitude, max latitude)

Error Response Format

All error responses share a consistent envelope:
{
  "error": {
    "code": "AREA_TOO_LARGE",
    "message": "El polígono excede el área máxima permitida (100 km²). Área recibida: 152.3 km².",
    "details": {
      "max_area_km2": 100,
      "received_area_km2": 152.3
    }
  }
}

Error Codes

CodeHTTPTrigger
PAYLOAD_TOO_LARGE413Request body exceeds the 5 MB limit
INVALID_JSON400Request body is not valid JSON
INVALID_GEOJSON400Not a valid GeoJSON Feature or FeatureCollection with 1 feature
INVALID_GEOMETRY_TYPE400Geometry is not Polygon or MultiPolygon
MULTIPLE_FEATURES400More than 1 polygon in the request
INVALID_TOPOLOGY400Polygon is self-intersecting
OUT_OF_BOUNDS400Polygon outside Galicia bounding box
AREA_TOO_LARGE400Polygon area > 100 km²
TOO_MANY_VERTICES400Polygon has > 10,000 vertices
QUERY_TIMEOUT504PostGIS query exceeded 30 seconds
ANALYSIS_FAILED500Internal spatial analysis error
MISSING_GEOJSON422geojson field missing from /report/generate request
MISSING_PROJECT_NAME422project.name missing or fewer than 3 characters
PROJECT_NAME_TOO_LONG422project.name exceeds 100 characters
PDF_GENERICATION_FAILED500WeasyPrint PDF rendering error

API Endpoints

POST /analyze

Accepts a GeoJSON polygon and returns the full spatial analysis as JSON. Used to preview layer intersections before generating a report.

POST /report/generate

Runs spatial analysis and returns a complete environmental feasibility PDF report as a binary download.

GET /layers/status

Returns the last update timestamp, status, and record count for each of the 7 environmental data layers.

GET /health

Returns service health status and database connectivity. Used by Docker healthchecks and uptime monitoring.

Build docs developers (and LLMs) love