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.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.
Base URLs
| Environment | URL |
|---|---|
| Production | https://geoviable.movilab.es/api/v1 |
| Local development | http://localhost:8000/api/v1 |
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /analyze | Run spatial analysis, return JSON results |
POST | /report/generate | Run analysis + generate PDF report |
GET | /layers/status | Environmental layer update status |
GET | /health | Service 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:| Interface | URL |
|---|---|
| Swagger UI | /api/v1/docs |
| ReDoc | /api/v1/redoc |
| OpenAPI JSON schema | /api/v1/openapi.json |
Request Limits
| Limit | Value |
|---|---|
| Maximum body size | 5 MB |
| Maximum polygon area | 100 km² |
| Maximum polygon vertices | 10,000 |
| Analysis timeout | 30 seconds |
| Polygons per request | 1 |
GeoJSON Input Format
All endpoints that accept a polygon expect a valid GeoJSON Feature object with aPolygon or MultiPolygon geometry. Coordinates must be in EPSG:4326 (WGS84 longitude/latitude order).
Geographic Scope
The API only accepts polygons within Galicia, Spain. Any geometry outside the bounding box below will be rejected withOUT_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 Codes
| Code | HTTP | Trigger |
|---|---|---|
PAYLOAD_TOO_LARGE | 413 | Request body exceeds the 5 MB limit |
INVALID_JSON | 400 | Request body is not valid JSON |
INVALID_GEOJSON | 400 | Not a valid GeoJSON Feature or FeatureCollection with 1 feature |
INVALID_GEOMETRY_TYPE | 400 | Geometry is not Polygon or MultiPolygon |
MULTIPLE_FEATURES | 400 | More than 1 polygon in the request |
INVALID_TOPOLOGY | 400 | Polygon is self-intersecting |
OUT_OF_BOUNDS | 400 | Polygon outside Galicia bounding box |
AREA_TOO_LARGE | 400 | Polygon area > 100 km² |
TOO_MANY_VERTICES | 400 | Polygon has > 10,000 vertices |
QUERY_TIMEOUT | 504 | PostGIS query exceeded 30 seconds |
ANALYSIS_FAILED | 500 | Internal spatial analysis error |
MISSING_GEOJSON | 422 | geojson field missing from /report/generate request |
MISSING_PROJECT_NAME | 422 | project.name missing or fewer than 3 characters |
PROJECT_NAME_TOO_LONG | 422 | project.name exceeds 100 characters |
PDF_GENERICATION_FAILED | 500 | WeasyPrint 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.