Inspect a watershed point cloud
Select synthetic ground returns, summarize the complete selection, and export a sampled 3D view and a grid coverage chart.
// Synthetic LAS input. Run from a directory containing lidar_watershed.las.
import aner.dev
import aner.lidar
import aner.parallel
import aner.plot
let work = lidar.context_with(execution: parallel.local(workers: 4), memory_mb: 32)
let cloud = lidar.open(work, "lidar_watershed.las")
let ground = cloud.window(500000.0, 4420000.0, 500120.0, 4420100.0)
.where_class(2, include_withheld: false)
let elevation = ground.grid(cell_size: 10.0)
print(cloud.metadata())
print(elevation.summary())
dev.capture("LAS source", cloud.metadata())
dev.capture("Selected ground returns", elevation.count())
dev.capture("10 m elevation grid", elevation)
dev.capture("Empty cell count", elevation.cell_count(2, 2))
let points = plot.point_cloud(ground, color: "z", max_points: 300, seed: 42)
.labels("Easting (m)", "Northing (m)", "NAVD88 elevation (m)")
.color_label("Elevation (m)").aspect("equal").view(-48.0, 30.0).view_zoom(1.65)
.title("Synthetic watershed ground returns")
.caption("Seed 42 shows 300 of 616 ground returns. Withheld records are excluded.")
.theme(plot.theme("light")).size(980, 660)
let coverage = plot.lidar_grid(elevation)
.labels("Easting (m)", "Northing (m)")
.title("Ground-return coverage in 10 m cells")
.caption("Color shows returns per cell for the full selection. Zero marks an empty cell.")
.theme(plot.theme("light")).size(850, 650)
points.show()
coverage.show()
points.save("watershed-review.html")
points.save("watershed-points.svg")
coverage.save("watershed-coverage.svg")
Make it your experiment.
Use the matching development runtime. Save this program as examples/lidar_watershed.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check lidar_watershed.aner
aner lidar_watershed.aner --dev lidar-firstThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Use the matching Aner 0.1.1-dev.1 source runtime. Save lidar_watershed.aner and lidar_watershed.las in the same fresh writable directory and run from there. Open the exported HTML in a browser for offline review.
lidar_watershed.las Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution