Make a map of my land from public lidar, with a 3D view, in one session. First ask me, in one short message, for: the address, a parcel ID or a dropped pin; how far around it to map (default: the parcel plus 300 m); what has changed in recent years (trees cut, a pond dug, a new building); and where to make the project. Outside the US, ask me where my country publishes its lidar, and adapt the steps.
Rules
- Keep my location private. Send the address only to the US Census Geocoder, the parcel ID only to my town’s or county’s GIS, and the area’s bounds only to the data services named below. Use a private repo or a plain folder, never a public repo.
- Free, public data only. Ask before anything that costs money or needs an account.
- Keep downloads out of git, in a git-ignored
tmp/. Commit only derived files, each under 5 MB, plus a SOURCES.md listing each dataset, its flight dates, CRS, URL and the date you fetched it.
- Analyze in the DEM’s UTM zone, in metres. Use Web Mercator for display images only. Its metres aren’t metres: at 45° N one is about 0.71 m on the ground, and areas come out twice too big.
- Check each file’s CRS and units before combining. The 1 m DEM is UTM in metres. Survey and county files are often State Plane in US survey feet, with heights in feet. Town map viewers often serve Web Mercator.
- Every layer gets a check you can run, with an expected result, and a line on what it can’t show.
- Pin these versions, which worked together on December 2, 2026: Python 3.13, rasterio 1.5.2, laspy 2.7.0 with lazrs 0.8.2, numpy 2.5.4, pyproj 3.8.0, shapely 2.2.0, scipy 1.18.1, scikit-image 0.26.0, contourpy 1.4.0, Pillow 13.0.0, MapLibre GL JS 6.16.0.
1. Find the flight
- Geocode the address with the US Census Geocoder (
https://geocoding.geo.census.gov/geocoder/locations/onelineaddress, benchmark=Public_AR_Current, format=json). It places addresses along the road, so show me the point and wait for my yes.
- List the 1 m DEM tiles from the USGS TNM Access API:
https://tnmaccess.nationalmap.gov/api/v1/products with datasets=Digital Elevation Model (DEM) 1 meter, the area’s bbox and outputFormat=JSON. Page through all results with max and offset.
- Pick one flight. Several often cover the same place, each named in the tile titles (one spot in Denver has a 2013 and a 2020 flight). Use the newest that covers the whole area, and only its tiles, so no seams run between years. USGS LidarExplorer shows the flights on a map.
- No 1 m DEM? Try the
Lidar Point Cloud (LPC) dataset and build the ground from its class 2 returns. With neither, use National Elevation Dataset (NED) 1/3 arc-second (about 10 m) and tell me tree heights are out.
- Tell me the flight, its dates and its point density before downloading anything big.
2. Terrain
- Read the DEM tiles over HTTP with rasterio’s range reads, clipped to the area, instead of downloading whole tiles (
GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR). Merge them on the native UTM grid.
- Derive hillshade, slope in percent, and contours every 10 ft, with every fifth line heavier.
- Check: under 1% of the area is no-data, the CRS is a UTM zone in metres, and the elevation range is plausible. Tell me the lowest and highest points and where they are.
3. Tree heights
- The point cloud: Microsoft Planetary Computer’s
3dep-lidar-copc collection, the USGS tiles as cloud-optimized LAZ. Find tiles with a STAC search (https://planetarycomputer.microsoft.com/api/stac/v1/search), and sign each download with a token from https://planetarycomputer.microsoft.com/api/sas/v1/token/3dep-lidar-copc. Use the DEM’s flight. Its name can differ between the two catalogs, so match by dates and footprint, then confirm with the ground check below.
- Planetary Computer’s copy only has flights from 2012 to 2021 (its catalog, checked December 2, 2026). For a newer flight, download the LAZ tiles listed under the TNM API’s
Lidar Point Cloud (LPC) dataset. They come from rockyweb.usgs.gov, which answered 429 and stalled on December 1 and 2, 2026. Fetch one tile at a time, with retries and backoff, and resume partial files. A 3 km square at about 6 points per m² was 11 tiles, 1.1 GB.
- Canopy height: the highest return in each 1 m cell minus the DEM, on the DEM’s exact grid. Drop noise (classes 7 and 18) and withheld points. Most flights have no building class, so roofs, power lines and towers count as canopy. Cap heights at the tallest tree that grows in my area: anything taller is a bird or a stray return. Fill a cell with no return from its tallest neighbor, at most two cells away.
- Keep it under 5 MB: store whole half metres in a
uint8, with a 0.5 scale on the band so GDAL and QGIS read metres. Quarter metres were mostly noise and pushed a 3 km square past 5 MB.
- Check the ground: class 2 returns minus the DEM should have a median within ±0.05 m. A constant offset means a different flight or datum. A ratio of about 3.28 means feet.
- Check the open ground: lawns and fields should have a median of 0 m, and my house its roof height. Ask me roughly how tall the house is.
- Say what it can’t show. It’s a snapshot from the flight, so anything cut, grown or built since is wrong. Mark the changes I told you about. A flight between leaf fall and leaf out shows hardwood crowns thin, with heights a little low.
4. Property lines and water
- Get the parcel from my town’s or county’s map viewer. Many are ArcGIS: find its REST service in the page’s network requests, query the parcel as GeoJSON, and keep every source field.
- A tax parcel isn’t a survey. Report its area measured in UTM beside the assessor’s acreage. Expect them to differ by a few percent.
- Parcels from two towns can overlap at the town line. Keep both as supplied, and don’t snap them together.
- Streams: USGS NHD large-scale flowlines,
https://hydro.nationalmap.gov/arcgis/rest/services/nhd/MapServer/6. My state’s GIS may also have stone walls, wetlands or old roads. Ask before adding them.
5. The map
Build one local page with MapLibre GL JS, served with python3 -m http.server.
- Layers: hillshade, contours, canopy (as shaded relief or a few height bands, not a rainbow), the parcel line and streams. Offer an online aerial photo as an option.
- A 3D button:
raster-dem terrain from 256 px PNG tiles in Terrarium encoding (height = R × 256 + G + B / 256 − 32768), tilted 60°, with sky.
- Exaggerate the terrain about 1.5×. Gentle land looks flat at true scale.
- Keep the canopy out of the exaggerated surface, or the trees grow 1.5 times too tall. Add it divided by the exaggeration.
- Ease the ground down for a few hundred metres past the area’s edge, so the land doesn’t end at a cliff.
- Check in a headless browser: clicking the house and the highest point shows the DEM’s elevation there, in both 2D and 3D, and the console has no errors.
6. Show me
Show screenshots of the 2D map and the 3D view, SOURCES.md and what each layer can’t show. Then rank these next steps for my land:
- One tree per treetop: local peaks in the canopy, then watershed crowns. Airborne lidar finds the canopy, not the forest. In one tested woodlot it found a sixth to a quarter of the trees an inventory counted, with heights good to about a metre and a little low.
- Evergreen or not, from a leaf-off flight: the share of returns that reach the ground under each crown, about 12% under hemlock and 47% under sugar maple. Set the cutoff on two stands I know.
- Roof shapes: roof planes fitted to the points inside each footprint give faces, pitch and ridge height, but no walls, windows or chimneys.
- My trails from GPX, smoothed for display only, with the raw tracks kept.
- The map offline on my phone, and a print PDF.
- Newer data: a leaf-off drone lidar flight fixes the public flight’s age. Ask me first, since it costs money.
The test that proves it
I open the page and find my house, the driveway and a tree line I know. I switch to 3D and turn the map. Clicking the house shows its ground elevation and a canopy height near its roof. Last, I measure one tall tree I can reach with a rangefinder and compare it with the canopy layer.