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 /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
object
required
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
object
required
Project metadata included in the PDF report header and footer.

Request Example

{
  "geojson": {
    "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": {}
  },
  "project": {
    "name": "Ampliación nave industrial — Parcela 234",
    "author": "Estudio Técnico López",
    "description": "Evaluación previa para licencia urbanística",
    "basemap": "PNOA"
  }
}

Response — 200 OK

A successful response returns the PDF as a binary file download.
HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename="GeoViable_Informe_{slugified_name}_{YYYYMMDD}.pdf"
The response body is the raw binary PDF. Save it directly to a file (see the curl example below). 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:
CodeHTTPTrigger
MISSING_GEOJSON422The geojson field is missing from the request body
MISSING_PROJECT_NAME422project.name is not provided, empty, or fewer than 3 characters
PROJECT_NAME_TOO_LONG422project.name exceeds 100 characters
PDF_GENERICATION_FAILED500WeasyPrint encountered an error during PDF rendering
INVALID_JSON400Request body is not valid JSON
INVALID_GEOJSON400Not a valid GeoJSON 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

curl Example

curl -X POST https://geoviable.movilab.es/api/v1/report/generate \
  -H "Content-Type: application/json" \
  -d '{
    "geojson": {
      "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": {}
    },
    "project": {
      "name": "Ampliación nave industrial — Parcela 234",
      "author": "Estudio Técnico López",
      "description": "Evaluación previa para licencia urbanística",
      "basemap": "PNOA"
    }
  }' \
  --output report.pdf
The --output report.pdf flag tells curl to write the binary response body directly to a file instead of printing it to the terminal.
Use "basemap": "PNOA" when the report will be submitted to a planning authority. PNOA (Plan Nacional de Ortofotografía Aérea) is the official Spanish aerial imagery, which is more familiar to public administration reviewers than OpenStreetMap.
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.

Build docs developers (and LLMs) love