Level 2 of 3 This component, complete on its own. Its files, sources and tests are the detail below. Open the detail
Repository
lidar-kit
One lidar module for the drone products: Airfieldpath, Municipath, SprayPath and Field Twin. It reads public lidar (USGS 3DEP point clouds) or a drone's own cloud, measures from it, and streams it into a browser view with a camera path a film can step frame by frame. Each product uses this copy rather than keeping one of its own.
It does five things:
Fetch a box of a USGS 3DEP point cloud over HTTP, only the octree nodes that touch the box and only to the depth asked for (the Entwine Point Tile layout of the AWS public dataset usgs-lidar-public).
Prepare a cloud: crop, drop noise, thin to one point per voxel, and classify ground when a cloud arrives unclassified (a drone's own lidar). Public 3DEP clouds keep their producer's classification.
Measure: a bare-earth model (DEM), a surface model (DSM), slope, building heights from footprints, closed hollows where water would pond, and change between two clouds of one place.
Write for the browser: tiled, levelled point files and a draped ground surface, as script files that load from disk or any server.
View: web/lidar-viewer.js on three.js r149. It streams a cloud coarse first, draws the ground surface, pins labels, measures between two picked points, and flies a scripted camera path that is a pure function of time.
Every file it writes carries its source and the steps applied to it, so a number on a screen can be traced back to the survey it came from.
Start in five minutes
You need Python 3.10 or later and about 250 MB for the environment. Node and Chrome only for the browser tests.
python3 -m venv ~/.stellarview/lidar-venv
~/.stellarview/lidar-venv/bin/pip install "laspy[lazrs]" numpy scipy scikit-image pillow
~/.stellarview/lidar-venv/bin/python -m unittest discover -s tests # 13 tests on clouds with known answers
Then fetch a small box, see what it holds, and measure it (the box below is 300 m across, a few MB):
K=bin/lidarkit
EPT=https://s3-us-west-2.amazonaws.com/usgs-lidar-public/FL_Peninsular_Seminole_2018/ept.json
$K fetch --ept $EPT --bbox=-81.2440,28.7740,-81.2410,28.7765 --depth 11 --origin=-81.2349,28.7772 \
--cache ~/.stellarview/lidar-data/cache --out /tmp/box.npz
$K info /tmp/box.npz
$K dem /tmp/box.npz --res 0.5 --out /tmp/dem.npz --asc /tmp/dem.asc # the .asc opens in any GIS