All projects

Geospatial Tooling

LiDAR2Building Geospatial Engine

3D context geometry (extruded buildings, terrain, streets, trees) from a lat/lng for anywhere in England

My own tool, first prototyped in March 2023: a FastAPI job service and a CLI. One latitude/longitude in, 3D context geometry out (extruded buildings, terrain, streets, trees). Built on DEFRA 1m LiDAR and Ordnance Survey vectors, for anywhere in England.

WHY IT EXISTS

Context modelling is the unglamorous first hour of every environmental analysis: someone manually extracts surroundings, terrain, and vegetation before the real work starts. England has high-quality open LiDAR and OS data, but stitching it into usable 3D geometry takes scripting most teams do not have time to write.

I wrote that scripting once, properly, and shipped it as a tool.

APPROACH

One Python pipeline integrating multiple geospatial APIs:

  • OS OpenData and Ordnance Survey for building footprints
  • DEFRA latest 1m LiDAR composite for buildings, terrain, and vegetation
  • GeoPandas + Fiona for vector pipelines
  • Laspy for raster/LiDAR pipelines
  • rhino3dm for headless 3D geometry generation (no Rhino app, server context)

Two ways in: a CLI for use inside Rhino/Grasshopper workflows, and a job API that other apps call.

PRODUCTION API

From April 2026 I rebuilt it behind a job API that I run myself, so other apps can call it:

  • FastAPI job API: submit a site, poll its status, stream live progress events, download the result files, or cancel. Idempotency keys and a result cache serve a repeated request instantly instead of recomputing it.
  • Worker: arq on Redis runs one warm generation job at a time; job rows and progress live in Postgres and stream to clients through Redis.
  • Accounts: API keys are stored as HMAC-SHA256 hashes with a server-side pepper. Monthly quotas are refunded automatically when a job fails, is cancelled or expires in the queue.
  • Operations: readiness checks on Postgres, Redis and the worker heartbeat; jobs left running by a worker restart are marked failed and refunded; raster and vector caches with size-based eviction; Docker Compose deployed through Dokploy.
  • Tests: 186 automated tests.

COVERAGE

  • Any lat/lng in England, not just test cases.
  • Output: extruded building footprints with heights from LiDAR, classified terrain mesh, vegetation point clusters, street centrelines.
  • Examples include a residential overheating site context and an urban outdoor-comfort study, both generated in under 5 minutes per site.

CHALLENGES

  • Data heterogeneity: DEFRA, OS OpenData, and Ordnance Survey use different projections, formats, and access patterns. Unified ingestion layer required.
  • LiDAR classification: separating building, terrain, and vegetation returns at 1m resolution needs careful filtering.
  • Headless geometry: rhino3dm in a server context with no Rhino app meant rebuilding the geometry generation pipeline from primitives.
  • Coverage: pipeline has to degrade gracefully when LiDAR tiles are missing or partial.

WORKFLOW

  1. Building footprint extraction: OS OpenData and Ordnance Survey vector queries.
  2. LiDAR acquisition: DEFRA 1m datasets for buildings, terrain, vegetation.
  3. Data processing: GeoPandas, Fiona, Laspy for vector and raster pipelines.
  4. Geometry generation: rhino3dm, headless, extruded buildings on terrain.
  5. Tool layer: CLI and the FastAPI job API.

OUTCOMES

  • Hours-per-project of context modelling eliminated.
  • Foundation for downstream environmental analyses (CFD, solar, daylight) at urban scale.
3D context generated from a single lat/lng: extruded buildings, terrain, streets and trees, ready for analysis in minutes.