TheDocumentation 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.
/report/generate endpoint is the main production endpoint of GeoViable. It accepts a GeoJSON polygon and project metadata, runs the full spatial analysis against all 7 environmental layers, generates a static map of the parcel, renders a Jinja2 HTML template with the results, converts it to PDF using WeasyPrint, and returns the binary PDF as a direct download attachment. The entire pipeline runs on every request.
Method and path: POST /api/v1/report/generate
Request
Content-Type:application/json
The request body must contain two top-level objects: the GeoJSON Feature and a project metadata block.
Parameters
GeoJSON Feature object describing the parcel boundary. Must follow the same structure and constraints as the
/analyze endpoint — a Feature with a Polygon or MultiPolygon geometry in EPSG:4326.Project metadata included in the PDF report header and footer.
Request Example
Response — 200 OK
A successful response returns the PDF as a binary file download.| Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename="GeoViable_Informe_{slugified_name}_{YYYYMMDD}.pdf" |
project.name is slugified (lowercased, spaces replaced with underscores, special characters removed, truncated to 40 characters) before being embedded in the filename. For example, a project named "Ampliación nave industrial — Parcela 234" produces a filename such as GeoViable_Informe_ampliacion_nave_industrial_parc_20260411.pdf.
Error Codes
This endpoint applies all the same GeoJSON validation rules as/analyze, plus the following additional validations on the project object:
| Code | HTTP | Trigger |
|---|---|---|
MISSING_GEOJSON | 422 | The geojson field is missing from the request body |
MISSING_PROJECT_NAME | 422 | project.name is not provided, empty, or fewer than 3 characters |
PROJECT_NAME_TOO_LONG | 422 | project.name exceeds 100 characters |
PDF_GENERICATION_FAILED | 500 | WeasyPrint encountered an error during PDF rendering |
INVALID_JSON | 400 | Request body is not valid JSON |
INVALID_GEOJSON | 400 | Not a valid GeoJSON 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 |
curl Example
--output report.pdf flag tells curl to write the binary response body directly to a file instead of printing it to the terminal.
The spatial analysis is always re-executed on every call to
/report/generate. Results are never cached from a previous /analyze call. This ensures the PDF always reflects the current state of the environmental layer data in the database.