Vineyard terrain

Cold air drains downhill and pools in the low ground, so where a block sits matters as much as what’s planted on it. This pipeline reads a LiDAR elevation tile and maps slope, aspect, and where the cold air goes.

Stack
FastAPI, rasterio, NumPy, SciPy, WhiteboxTools
Tests
pytest for each stage, plus integration
Input
LidarBC 1 m DEM tiles
Code
SukhmanH/vineyard-terrain
Hillshade of a LiDAR elevation tile: a valley floor between steep walls, with side drainages.
Pipeline output on a public LidarBC tile, 1.78 km across.

How the terrain analysis reads a hillside

100 m

  1. A public LidarBC tile at 1 m resolution: 245 m of relief, shaded from the northwest.
  2. Slope from the elevation gradient. The steep valley walls show brightest.
  3. Aspect: south-facing ground, in white, takes the sun. North-facing ground stays dark and cold.
  4. On a calm night cold air drains downhill like water and collects in the low ground.

Pipeline

A FastAPI backend reads a LidarBC 1 m DEM with rasterio. Slope and aspect come from the elevation gradient in NumPy and SciPy. Hydrology runs through WhiteboxTools: breach the depressions first, so 1 m LiDAR speckle can’t dam the drainage, then accumulate flow.

Map

Each layer lands on a browser map as an overlay with its own opacity control.

Tests

A pytest suite covers every stage on its own, plus an end-to-end integration run.

This tile

Everything in the explainer is the pipeline’s real output on one public tile, chosen for its relief: 245 m from the valley floor to the ridge.