Wireless Coverage — LiDAR to Tower Siting
Wireless Coverage turns a USGS 3DEP LiDAR point cloud over San Francisco into ranked candidate cell-tower sites, using GeoBrix on Databricks. LiDAR returns become DSM / DTM / CHM surfaces. The surfaces are indexed to H3. Exact H3 line-of-sight viewsheds score each candidate site. It comes in two flavors. One is a Lakeflow pipeline that runs the whole flow as a scheduled job. The other is an interactive notebook series that walks through each step and the GeoBrix functions behind it.
Executed output — full San Francisco
These screenshots come from the executed Notebook Series, run end to end over the whole San Francisco AOI (DEMO=False). The committed notebooks ship the smaller Golden Gate Park demo (DEMO=True).
First, the surface stack over all of San Francisco: bare earth (DEM) beside the full surface (DSM). Buildings and canopy read as the difference between them:

Zooming into one neighborhood, Part 3a cross-checks that the H3 grid faithfully summarizes the underlying 1 m pixels. A hex reads as the color of the pixels beneath it:
![]()
Finally, the Golden Gate Park demo makes the ranked sites legible. Part 4 scores each candidate by how many res-12 cells it can see, so the best sites rise to the top:

- Lakeflow SDP
- Notebook Series
A Wireless Coverage pipeline: a Lakeflow Declarative Pipeline (SDP) plus a post-pipeline tower-siting task. A Databricks Asset Bundle packages it, and it runs entirely on Serverless compute with the GeoBrix Python API.
This is the production counterpart to the notebook series (see the other tab). It uses the same San Francisco AOI and USGS 3DEP LiDAR sources. It runs as a scheduled medallion pipeline instead of one-off notebook outputs. A land downloader task stages the data. The pipeline then cascades bronze → silver → gold through declared table-to-table dependencies. A siting task runs the H3-native tower analysis. A validate notebook confirms all outputs.
wc_lidar_pts is a streaming table, so each update reads only the .laz tiles inventoried since the last one. Some setting changes need a reset, listed in the bundle README.
examples/notebooks/wireless-coverage/lakeflow — the bundle, pipeline transformations, siting task, validation notebook, and full setup instructions live here. See its README for deploy/run steps, prerequisites, and configuration notes.
Lakeflow Spark Declarative Pipelines run DBR 19 on the PREVIEW channel; the examples use it with the env6 wheel. The pipeline and its land and siting tasks use geobrix[vizx,stac] from the env6 wheel, with the Overture CLI as a separate entry. Each takes it as a single pip dependency entry. The code uses the rasterx and gridx Python API with no JAR, on Serverless throughout. To fall back to the CURRENT channel (DBR 18), set pipeline_channel=CURRENT, point gbx_wheel at the env5 wheel, and set the job environment_version to 5. Check the Lakeflow runtime channel versions when you deploy. The bundle defaults to Serverless. For heavier runs (notably full San Francisco) switch the pipeline and job tasks to classic compute (serverless: false + a cluster spec) for dedicated memory and throughput. See Surfaces & Levels.
How it works: from staged LiDAR to ranked tower sites

A scheduled run takes raw USGS 3DEP LiDAR .laz files through six stages:
- Land — a downloader task stages USGS 3DEP LiDAR EPT nodes and Overture water polygons onto a Unity Catalog Volume. Nothing is interpreted yet — data just arrives.
- Bronze — inventory — Auto Loader records one row per
.lazfile as it appears, so re-runs pick up only newly staged data. - Silver — surface stack — GeoBrix
read_pathsreads the.lazfiles as they arrive on the inventory stream, so each update parses only the newly staged tiles. The pipeline tile-indexes the classified returns in the streaming tablewc_lidar_pts. It bins them into 1 m DSM and TIN DTM rasters per tile. Therst_chmfunction derives the Canopy Height Model. - Gold — H3 grids — the surfaces are reprojected to EPSG:4326, isobanded, and indexed to H3 cells at resolution 10. Each table carries a stable res-9 join key so downstream consumers join on one column.
- Siting — a post-pipeline Spark task runs the H3-native tower-siting analysis. The analysis uses a res-9 candidate lattice, a coarse quick-pass to rule out weak sites, and exact res-12 H3 line-of-sight viewsheds on survivors. The
h3_viewshed_towersfunction distributes the viewsheds, with one tower per Spark task. - Validate — a final notebook task confirms all output tables are populated and spot-checks quality assertions.
Each stage reads only the one before it. The pipeline declares these as table-to-table dependencies. Lakeflow then builds the lineage graph, runs stages in order, and recomputes only what changed.
What it uses from GeoBrix
- Bronze: a plain Auto Loader
binaryFilestream lists the staged.lazfiles (laz_inventory); it reads no point data. - Silver:
read_pathsruns thelidar_gbxreader over the files that arrive on the inventory stream. The output iswc_lidar_pts, a streaming table: each update reads only the tiles inventoried since the last one. It has one row per return plus_source_path, the file it came from. The rows are spread over 512 tasks. Withon_error="skip", the reader skips a file that cannot be decoded and writes a warning in the executor logs. The pipeline keeps going instead of failing the update. The tiles never change once landed, so the example does not needdeclare_ingest. See Lakeflow SDP for the pipeline setup. - Surfaces and grids: RasterX on Serverless:
bin_points_tiled,rst_dtmfromgeoms_aggandrst_chmbuild the surfaces;rst_transform,rst_clip,rst_isobandandgbx_rst_h3_rastertogridmaxturn them into the H3 grids.
What a run looks like
The bundle deploys one job, wireless_coverage_lf_job, whose four tasks run in sequence. The land task stages the data, pipeline refreshes the Lakeflow pipeline, siting ranks the tower sites, and validate checks the outputs:

Opening the pipeline task shows the medallion lineage Lakeflow derived from the table-to-table dependencies. On a full San Francisco run, ~817 M classified LiDAR returns (wc_lidar_pts) bin into a few hundred 1 m DSM / DTM / CHM surface tiles. These tiles roll up into the res-10 H3 gold grids:

Table catalog
All tables land in {catalog}.{schema} (defaults: geospatial_docs.wireless_coverage_lf).
Bronze
| Table | Description |
|---|---|
laz_inventory | Auto Loader streaming table — one row per staged .laz EPT file (path, file_size, _ingested_at). |
Silver
| Table | Description |
|---|---|
wc_lidar_pts | Streaming table — classified LiDAR returns read with read_paths from the .laz files on the laz_inventory stream (each update reads only the newly inventoried tiles), tile-indexed with a res-15 H3 cell ID (EPSG:3857), plus _source_path (the file each return came from). |
wc_surface_dsm | DSM — max elevation of all returns per 1 m tile. |
wc_surface_dtm | DTM — Delaunay-TIN bare earth over class-2 ground returns (gap-free). |
wc_surface_chm | CHM — rst_chm(DSM, DTM): canopy/structure height in metres, clamped ≥ 0. |
Gold
| Table | Description |
|---|---|
wc_h3_dem_res10 | Bare-earth elevation-band H3 cells (res 10), land-masked, with res-9 parent join key. |
wc_h3_dsm_res10 | Surface elevation-band H3 cells (res 10), land-masked, with res-9 parent join key. |
wc_h3_chm_res10 | Max canopy/structure height per H3 cell (res 10), gap-filled, land-masked, with res-9 parent join key. |
Siting
The siting tables are regular Delta tables, overwritten each run. H3-indexed tables (*_res*) carry both a BIGINT cellid column and a STRING h3 column (for map tools that query string H3 keys). They are liquid-clustered on the BIGINT cell column for fast spatial queries. Coverage outputs are H3-indexed at resolution 12 and carry the res-9 parent join key.
| Table | Description |
|---|---|
wc_h3_surf_r13 | H3 res-13 surface bin (DSM max elevation per cell) — finest-resolution blocker surface. Columns: cellid BIGINT, h3 STRING, z DOUBLE; liquid-clustered on cellid. |
wc_h3_grnd_r13 | H3 res-13 ground bin (DTM min elevation per cell) — finest-resolution bare-earth base. Columns: cellid BIGINT, h3 STRING, z DOUBLE; liquid-clustered on cellid. |
wc_h3_quickpass_res9 | Every res-9 candidate's coarse quick-pass coverage fraction (pre-rule-out screen). |
wc_h3_candidate_sites_res9 | Ranked tower survivors: cellid BIGINT, h3 STRING, lon, lat, required_mast, viewshed_cells, viewshed_pct, observer_z; liquid-clustered on cellid. |
wc_h3_coverage_res12 | Per-cell line-of-sight depth at res 12 — how many sited towers can see each cell. Columns: cellid BIGINT, h3 STRING, tower_los_count LONG, res INT, parent_cellid, parent_cellid_res; liquid-clustered on cellid. Suitable for external H3 map layers. |
wc_h3_coverage_top10_res12 | Same, aggregated over only the top-10 sites by coverage. Columns: cellid BIGINT, h3 STRING, tower_los_count LONG, res INT, parent_cellid, parent_cellid_res; liquid-clustered on cellid. |
wc_h3_site_viewshed_res12 | Per-site fine-resolution viewshed: one row per sited tower + visible cell pair. Columns: site_cellid BIGINT, site_h3 STRING, cellid BIGINT, h3 STRING, res INT, parent_cellid, parent_cellid_res; liquid-clustered on (site_cellid, cellid) for per-site lookups and per-cell map tiles. |
Deploy and run
databricks bundle deploy
databricks bundle run wireless_coverage_lf_job
The bundle validates and deploys with the committed defaults in databricks.yml out of the box. To point it at your own workspace, copy databricks.override.yml.example to databricks.override.yml (git-ignored) and fill in your CLI profile; it is layered in automatically via include: ["*.override.yml"]. A fresh clone with no override file still validates/deploys.
- Schedule: the job ships paused (
pause_status: PAUSED, daily at0 0 7 * * ?America/Chicago) — unpause it in the workspace once you've confirmed a manual run. - Shared LiDAR: if you have already run the notebook series and staged the USGS 3DEP data, set
laz_dir(and optionallywater_mask_dir) in your override file. This reuses those files and skips the ~4.9 GB download (about 24,000 LAZ tiles for the full city). Seedatabricks.override.yml.examplefor the exact paths. - GeoBrix wheel:
gbx_wheelpoints at a stagedgeobrix-0.6.0+env6-py3-none-any.whl. Stage your own build at that path or override the variable to wherever your wheel lives. The notebooks install the wheel from the v0.6.0 release; the bundle installs it from a Volume. Stage it with the steps on the installation page.
Configuration
Unity Catalog catalog and schema names can include hyphens (e.g. solutions-catalog-default, sdsc-nyc-workshop-2026). Both the notebook series and the Lakeflow bundle properly quote all identifiers with backticks, so hyphenated names work without issue. If you encounter errors like "invalid identifier," check that your catalog/schema parameters are spelled correctly (case-sensitive).
Bundle variables (set in databricks.yml; override per-workspace in databricks.override.yml):
| Variable | Default | Description |
|---|---|---|
catalog | geospatial_docs | Unity Catalog catalog name. |
schema | wireless_coverage_lf | UC schema; all pipeline and siting tables land here. |
volume | data | UC volume; raw data lands under {volume}/wireless-coverage-lf/. |
full_aoi | true | true for the full San Francisco AOI; false for the Golden Gate Park demo window. After changing it on a deployed pipeline, run databricks bundle run wireless_coverage_lf_pipeline --full-refresh wc_lidar_pts, so the tiles already read are clipped to the new AOI. |
simplify | true | Apply product st_simplify to isobands before H3 covering (default True = fast, no coverage loss, needed for full-SF performance; False = exact isobands, heavy/slow). |
laz_dir | (derived) | Path to staged .laz EPT files. Leave empty to auto-derive under the Volume. Set to the notebook series' Volume path to reuse already-staged LiDAR. laz_inventory and the streaming table wc_lidar_pts keep the files and points of an earlier folder, so after changing laz_dir on a deployed pipeline reset both once: databricks bundle run wireless_coverage_lf_pipeline --full-refresh laz_inventory,wc_lidar_pts. |
water_mask_dir | (derived) | Path to staged Overture water GeoParquet. Leave empty to auto-derive. |
gbx_wheel | /Volumes/geospatial_docs/geobrix/sample-data/geobrix-0.6.0+env6-py3-none-any.whl | Path to the staged GeoBrix wheel. |
Algorithm and resolution parameters are tunable via wireless_coverage.* keys in the pipeline configuration block. Key defaults:
| Key | Default | Description |
|---|---|---|
h3_res | 10 | H3 resolution for the gold elevation/canopy grids. |
tower_res | 9 | H3 resolution for the naive candidate-tower lattice. |
quickpass_res | 10 | Coarse quick-pass screen resolution. |
viewshed_res | 12 | Exact H3 line-of-sight resolution (coverage output). |
surface_bin_res | 13 | Finest H3 "pixel" bin resolution for siting surfaces. |
max_dist_m | 2500 | Line-of-sight buffer radius in metres. |
antenna_above_surface_m | 10 | Observer height above the DSM surface in metres. |
quick_thresh_frac | 0.30 | Minimum quick-pass coverage fraction to survive rule-out. |
simplify | true | Simplify isoband geometry via product st_simplify before H3 covering (default True; set False for exact isobands at the cost of heavy performance at full scale). |
Prerequisites
- Unity Catalog: a catalog and schema (defaults
geospatial_docs.wireless_coverage_lf) and a Volume nameddataunder it. The pipeline creates sub-directories inside the Volume, not the Volume itself. - GeoBrix wheel staged at the
gbx_wheelpath. See Surfaces & Levels. - Network access: the
landtask fetches USGS 3DEP and Overture Maps data over HTTPS — Serverless has outbound internet by default.
Validation notebook
The validate task (validate/validate_wc_lf.ipynb) runs after the siting task completes, reads all output tables, confirms each is non-empty, and prints summary statistics. It also compares the source files in wc_lidar_pts with the files laz_inventory lists. It prints how many have no points (a file with no point inside the AOI counts too). This check matters because read_paths(..., on_error="skip") skips an unreadable file with only a warning in the executor logs. wc_lidar_pts is a streaming table, so a file skipped once stays without points on later updates. Reset both tables (see the note at the top of this tab) to read it again. Run it manually from the workspace as a quick sanity check after a fresh deploy or configuration change.
Wireless Coverage — LiDAR Surface Foundations
A notebook series that builds the elevation and surface data foundation for wireless-coverage analysis directly from a USGS 3DEP LiDAR point cloud. It puts data first and analytics later. The surfaces produced here (Canopy Height Model, Digital Surface Model, bare-earth Digital Terrain Model) are the inputs for later parts. Those parts consume them for antenna siting via H3-native line-of-sight analysis.
The LiDAR path (Parts 1 and 2a) works over all of San Francisco (SF_AOI = (-122.55, 37.70, -122.35, 37.85)). It reads the staged 3DEP LiDAR (.laz Entwine Point Tile nodes) with the GeoBrix lidar_gbx reader and bins returns into 1 m rasters per spatial tile. A single 1 m raster over SF is ~460 M pixels, so binning is tiled and bounded. The rx.bin_points_tiled function bins each tile with memory proportional to the raster grid (W×H), not the point count. A full-resolution (DECIMATE=1) tile therefore never OOMs. The binned surfaces are persisted to permanent tables you own (a CATALOG.SCHEMA you set) and read back downstream.

examples/notebooks/wireless-coverage — download the folder and import the notebooks (Parts 1, 2a, 2b, 3a, 3b, and 4) into your Databricks workspace to run.
The series uses the rasterx Python API plus the geobrix[vizx] env6 wheel — so it runs on Serverless environment 6 with no JAR. The laspy / lazrs readers the point cloud needs ship with the env wheel. Visualization helpers come from databricks.labs.gbx.vizx. See Surfaces & Levels.
DECIMATE=1 keeps every LiDAR return. The default Golden Gate Park demo (DEMO=True) downloads and bins about 2,700 LiDAR nodes (~91 M returns). The full San Francisco run (DEMO=False) downloads about 24,400 nodes (~4.9 GB, ~830 M returns). Raise DECIMATE (e.g. 10) for a fast coarse pass while iterating on the visualization cells; the pipeline is identical either way.
The notebooks
Part 1 — Pure LiDAR → CHM (01_pure_lidar_chm.ipynb)

A classified LiDAR point cloud already carries everything a Canopy Height Model needs: every return is classified (ground vs. above-ground) and georeferenced. So the CHM is a couple of binning ops away — no external DEM, no coverage gaps:
- DTM (bare earth) — bin the ground returns (ASPRS class 2) →
minelevation per pixel. - DSM (surface) — bin all returns →
maxelevation per pixel. - CHM —
rst_chm(DSM, DTM)= DSM − DTM, clamped ≥ 0.
Part 1 is the shortest path from returns to canopy: it keeps only the CHM.
Part 2a — Surfaces: DSM + DTM → CHM (02a_surfaces_dsm_dtm_chm.ipynb)

The main arc. It builds directly on the LiDAR point cloud from Part 1. It persists the complete surface stack as reusable permanent tables you own. Each is a governed Delta table of tiles in a CATALOG.SCHEMA you set. Optional GeoTIFF export uses gtiff_gbx. The production bare-earth DTM is a TIN surface — a Delaunay triangulation of the classified ground returns (rst_dtmfromgeoms_agg), barycentrically interpolated to a gap-free raster. Because it works directly from the point cloud's own classification, it is a beyond-pixels surface. It is terrain reconstructed from the actual ground returns rather than approximated from raster values. The binned-min DTM is shown alongside for comparison:
- TIN DTM — a Delaunay triangulation of the ground returns (
rst_dtmfromgeoms_agg), barycentrically interpolated to a gap-free bare earth. Points are built withst_makepoint(x, y, z), so Z carries through the WKB into the triangulation. This is the production terrain. - Binned DTM —
minz of ground returns per pixel (fast; can leave tiny gaps where no ground return landed). Shown for comparison.
Writes the canonical wc_surface_{dsm,dtm,chm} tables and OUT_DIR GeoTIFFs that Parts 3a, 3b, and 4 consume.
Part 2b — Surfaces from a DSM Raster (02b_surfaces_from_dsm.ipynb)

An alternative on-ramp for when a LiDAR point cloud is not available. Starting from a DSM raster only, it approximates the bare-earth DTM by applying a morphological opening to the DSM (rst_filter min then max). It then derives the CHM with rst_chm. The result is a pixel-only approximation: without ground-classified returns, the bare earth is estimated from the surface shape rather than reconstructed from the point cloud. The Parts 1–2a LiDAR path produces a more accurate terrain for production use. When no point cloud is available, a published terrain product such as USGS 3DEP is the recommended production alternative. Part 2b lands the same canonical wc_surface_{dsm,dtm,chm} tables as Part 2a, so Parts 3 and 4 work unchanged either way.
Part 3a — H3 Gridding (03a_h3_gridding.ipynb)

Takes the surface tables from Parts 1–2a (or 2b) and prepares them for global-grid analysis.
It H3-indexes each surface at a parameterized resolution (default: H3 resolution 10, ≈65 m
edge). The rst_isoband function extracts DEM and DSM elevation bands as contiguous isoband polygons.
The Databricks product h3_try_coverash3 indexes them to H3 cells.
Cumulative elevation tiers give each cell a coverage-depth value. The Canopy Height Model
is aggregated to the maximum canopy height per H3 cell via gbx_rst_h3_rastertogridmax.
Interior gaps are filled with h3_cellfill_array (k=1, IDW, land mask re-applied after fill).
All three H3 tables — wc_h3_dem, wc_h3_dsm, wc_h3_chm — are prepared for
downstream analysis in Part 4. Each H3-cell output table carries a stable res-9 rollup join
key: parent_cellid (the h3_toparent of each cell at res 9) and parent_cellid_res.
This key lets the tables join in one column to any external grid keyed at H3 resolution 9 (coverage, demand,
population). This key is present on the Part 3a wc_h3_* tables, Part 4's
wc_h3_coverage* tables, and Part 3b's wc_rpx_h3_coverage table.
H3 resolution is a choice, not a ceiling. Part 1 stored one res-15 cell per LiDAR return
(cellid_r15, ≈0.9 m² — sub-metre, finer than a 1 m pixel). h3_toparent rolls any
res-15 cell to any coarser resolution in a GROUP BY. The same underlying data therefore feeds
res-10 visualization grids and res-12 viewshed buffers alike.
Part 3b — Raster-Pixel Surfaces (03b_raster_pixel_surfaces.ipynb)

The honest counterpoint to Part 3a. Part 3a takes the LiDAR surfaces beyond pixels into an H3 discrete global grid. Part 3b holds the native 1 m raster representation up next to that H3 grid. It then re-runs Part 4's tower-siting question on the raster side. This shows how the two paradigms score the same ground.
Part A — representation contrast. Over a 2 km window around Golden Gate Park, the same
DSM surface renders as 1 m-pixel tiles and as H3 cells at resolution 10. The contrast
makes the resolution-dial framing concrete: the raster is fixed at 1 m; H3 dials to any
resolution via h3_toparent. The res-15 cells stored in Part 1 are finer
than a 1 m pixel (≈0.9 m² per cell). They roll to resolution 10, 12, or any other target with a GROUP BY. So H3's
resolution is a dial, not a ceiling.
Part B — viewshed foil. The notebook scores an independent spread of candidate towers over the DSM footprint
with the per-tower raster viewshed (rst_viewshed_towers). It also scores them inline with the same
res-12 H3 line-of-sight model (h3_los_visible). So Part 3b runs standalone, and the two
engines are compared head-to-head. The candidate lattice regenerates Part 4's res-9 centroid
pattern independently. Part 3b reads only the Part 2 DSM, Part 3a's H3 grids, and
config_nb. It never touches a Part 4 table. rst_viewshed_towers selects the in-radius
1 m DSM tiles for each tower, mints a bytes-free VRT, runs one pixel-level viewshed, and
histograms in-radius coverage. It runs one tower per Spark task, the natural fan-out unit at full
San Francisco scale. No raster bytes cross a shuffle.
The trade-off is stated honestly. Part 4's H3 viewshed bins one max-height per ~17 m res-12 cell. This smooths fine blockers that a 1 m raster line-of-sight respects. That makes the H3 viewshed an optimistic screening estimate, suitable for ruling out candidates quickly across the full lattice. The raster viewshed is the strict pixel-level confirmation of a shortlisted site's exact coverage footprint. The large coverage gap between the two outputs is the expected signature of that resolution smoothing, not a defect in either approach.
Outputs (gated on FORCE_RELOAD; saved under the wc_rpx_ prefix):
| Table | Contents |
|---|---|
wc_rpx_raster_viewshed_demo | Per-tower raster coverage counts (visible_px, total_px, viewshed geometry) |
wc_rpx_h3_viewshed_demo | Per-tower H3 line-of-sight cell counts (the H3-engine viewshed) |
wc_rpx_h3_coverage_demo | Per-cell H3 LOS coverage depth for the demo towers |
wc_rpx_comparison_demo | Raster vs H3 coverage area on the shared 2.5 km-disk metric |
Maps — the strongest demo tower's exact 1 m-pixel viewshed next to Part 4's H3-cell coverage depth: two paradigms, one scene.
Part 4 — Naive H3-Native Tower Siting (04_tower_viewsheds.ipynb)

With the LiDAR surfaces from Parts 2a/2b and the H3 grids from Part 3a in hand, Part 4 asks the siting question. Which candidate tower locations are worth the detailed analysis? The approach is deliberately naive — a baseline screen, not a final plan — and stays entirely in the H3 domain rather than operating on pixels.
Candidate lattice. One tower candidate is placed at the centroid of every H3 resolution-9 cell (≈170 m edge) that falls within the area of interest. No land-cover constraints, no placement optimization — just a dense, regular lattice that covers the whole AOI.
Quick-pass rule-out. Before paying for any detailed line-of-sight work, each candidate gets a cheap coarse viewshed at H3 resolution 10 (≈65 m). A site that cannot achieve at least 30% coverage of its buffer at that coarse resolution is ruled out immediately. In the Golden Gate Park demo, this reduces 176 candidates to 62 survivors (~65% discarded) before any fine-resolution work begins.
Exact H3 line-of-sight. Each surviving candidate is evaluated with the library function
h3_los_visible (from databricks.labs.gbx.gridx.helpers). It is a pure-Python H3 primitive that runs an exact
ray-march test for every cell in the buffer. The observer sits at the DSM surface height plus a 10 m
antenna clearance. The target is the ground surface (DTM) plus a 1.6 m receiver height. The buffer
radius is 2.5 km. The line-of-sight test uses the binned H3 surface as both the blocker map and the
ground reference. It is therefore a surface-relative check. The only shortcut is the H3 binning resolution,
not the line-of-sight geometry.
Two-factor scoring. Each site is scored on two independent factors kept as separate columns:
required_mast— the mast height the site needs to clear its own local surface and provide the 10 m antenna clearance (CHM + antenna_clearance; lower is cheaper to build).viewshed_cells— the number of H3 cells the site has line of sight to (higher is better coverage).
Sites are ranked by viewshed_cells descending, then required_mast ascending (nulls last).
Combining the two into a single score — balancing cost against coverage — is a decision left to
the analyst.
Nearest-ground fallback. Some cells have a DSM surface value but no bare-earth DTM value
(typical at water bodies or dense-canopy edges). For these cells, the notebook fills the ground height for required_mast
from the mean of the nearest populated H3 ring. The search expands up to 3 rings. A site with no ground
anywhere in those rings keeps required_mast as NULL — honestly uncostable rather than guessed.
Outputs (all gated on FORCE_RELOAD; once the tables exist a re-run loads them and skips the
per-tower viewsheds):
| Table | Contents |
|---|---|
wc_h3_quickpass | Every candidate's coarse coverage fraction (pre-rule-out score) |
wc_h3_candidate_sites | Ranked survivors: required_mast, viewshed_cells, viewshed_pct, observer_z |
wc_h3_coverage | Per-cell LOS depth: how many sited towers can see each H3 cell |
wc_h3_coverage_top10 | Same, aggregated over only the top-10 sites by coverage |
Four maps trace the rule-out funnel. Map A shows all candidates colored by coarse coverage fraction. Map B shows survivors that cleared the quick-pass. Map C shows per-cell coverage depth with all sited towers and their 2.5 km buffers overlaid. Map D shows the ten best sites with their viewsheds and buffers.
Next. A forthcoming land_cover notebook adds the demand side.
It weights coverage by where people and buildings are, excluding water, parks, and no-build zones. It also optimizes placement
within each cell, turning this naive screen into a smarter siting tool.
Table catalog
All notebook-series tables land in {CATALOG}.{SCHEMA} (defaults: geospatial_docs.geobrix). A demo run
(DEMO=True) appends a _demo suffix so it never collides with a full-SF run; H3 tables append _res{n}.
The series shares most of its outputs with the Lakeflow SDP flavor — the
same table names, but written to a different schema (geospatial_docs.wireless_coverage_lf). The last column
contrasts the two flavors.
| Table | From | Description | Lakeflow (LDP) flavor |
|---|---|---|---|
wc_lidar_pts | 01 | Classified LiDAR returns, tile-indexed with a res-15 H3 cell ID (EPSG:3857). | Shared (LDP Silver, a streaming table there; it also carries _source_path) |
wc_lidar_dsm / wc_lidar_dtm / wc_lidar_chm | 01 | Part 1's shortest-path DSM / bin-min DTM / CHM surfaces, kept for the pure-LiDAR walkthrough. | Notebook-only (LDP builds wc_surface_* instead) |
wc_surface_dsm | 02a / 02b | DSM — max elevation of all returns per 1 m tile. | Shared (LDP Silver) |
wc_surface_dtm | 02a / 02b | DTM — Delaunay-TIN bare earth (02a) or morphological-opening approximation (02b). | Shared (LDP Silver; the LDP uses the TIN path) |
wc_surface_chm | 02a / 02b | CHM — rst_chm(DSM, DTM), clamped ≥ 0. | Shared (LDP Silver) |
wc_h3_dem_res10 / wc_h3_dsm_res10 / wc_h3_chm_res10 | 03a | Land-masked elevation-band DEM/DSM and the raw max-canopy (CHM) grid — H3 cells at res 10 with a res-9 parent join key. nb3a clamps, gap-fills, and land-masks the CHM in-notebook for the rendered/analysis surface. | Shared (LDP Gold) |
wc_rpx_raster_viewshed / wc_rpx_h3_viewshed / wc_rpx_h3_coverage / wc_rpx_comparison | 03b | Raster-pixel vs H3 viewshed comparison — 1 m-pixel rst_viewshed_towers vs res-12 h3_los_visible, head-to-head on the same towers. | Notebook-only (no raster-pixel stage in the LDP) |
wc_h3_surf_r13 / wc_h3_grnd_r13 | 04 | Res-13 surface (DSM max) and ground (DTM min) bins — the finest blocker/base for line-of-sight. | Shared (LDP Siting) |
wc_h3_quickpass_res9 | 04 | Every res-9 candidate's coarse quick-pass coverage fraction (pre-rule-out screen). | Shared (LDP Siting) |
wc_h3_candidate_sites_res9 | 04 | Ranked tower survivors: cellid BIGINT, h3 STRING, lon, lat, required_mast, viewshed_cells, viewshed_pct, observer_z (liquid-clustered on cellid). | Shared (LDP Siting) |
wc_h3_coverage_res12 / wc_h3_coverage_top10_res12 | 04 | Per-cell line-of-sight depth at res 12 (all sites / top-10), H3-indexed with cellid BIGINT, h3 STRING columns (liquid-clustered on cellid), and the res-9 parent join key. | Shared (LDP Siting) |
wc_h3_site_viewshed_res12 | 04 | Per-site fine-resolution viewshed: one row per sited tower + visible cell pair. Columns: site_cellid BIGINT, site_h3 STRING, cellid BIGINT, h3 STRING (liquid-clustered on (site_cellid, cellid) for per-site lookups and per-cell map tiles). | Shared (LDP Siting) |
laz_inventory | — | (not generated by the notebook series) | Lakeflow-only — a Bronze Auto Loader stream that wc_lidar_pts reads with read_paths; the notebooks read the staged .laz directly via lidar_gbx. |
Key GeoBrix functions shown
lidar_gbxreader —spark.read.format("lidar_gbx").option("decimate", …).load(path)emits one Spark row per LiDAR return (x, y, z, intensity, return_number, number_of_returns, classification, gps_time), recursing sub-directories of staged.laz. Options:classFilter,returnFilter,decimate,mode(points/metadata). See LiDAR reader.bin_points_tiled— bounded tiled point binning: peak memory is the raster grid (W×H), not the point count, so full-density LiDAR bins without OOM. Picks a per-pixel statistic (maxfor the DSM surface,minon ground returns for the bare-earth DTM) and is built onrst_binpoints_agg. See RasterX › Memory & scale.rst_chm— differences an aligned DSM and DTM into a Canopy Height Model (DSM − DTM, clamped ≥ 0, NoData preserved). See RasterX functions.rst_dtmfromgeoms_agg— builds a Delaunay-TIN bare-earth surface from ground points (and optional breaklines) with barycentric interpolation — a gap-free alternative to the binnedminDTM. Points arrive as WKBPOINT Zfrom the productst_makepoint(x, y, z). See RasterX functions.gtiff_gbxwriter —df.select("source", "tile").write.format("gtiff_gbx").mode("overwrite").save(dir)writes each raster tile as a GeoTIFF (<source>.tif) to a Volume. See GeoTIFF writer.gbx.vizxhelpers —plot_raster/plot_filerender tiles and staged GeoTIFFs (auto-decimation + percentile stretch,cmap=). See Visualization API.
Data flow
Staged 3DEP LiDAR (.laz EPT nodes) → lidar_gbx reader → one row per return (x, y, z, classification, …; EPSG:3857)
│
▼ assign tile keys (tx, ty) + per-tile extent columns (1024 m tiles, 1 m pixels)
│
├─▼ bin_points_tiled(all returns, "max") per tile (bounded) → DSM tiles
└─▼ bin_points_tiled(class 2, "min") per tile (bounded) → DTM tiles (bare earth)
│
▼ rst_chm(DSM, DTM) (Spark, per tile)
Canopy Height Model tiles (Float32, NoData = −9999)
│
▼ (Part 2a) _persist → DSM / DTM / CHM permanent tables (CATALOG.SCHEMA); optional gtiff_gbx GeoTIFF export
▼ (Part 2a) rst_dtmfromgeoms_agg on st_makepoint(x, y, z) ground points → TIN bare earth (gap-free)
▼ (Part 2b, alt) DSM raster in → rst_filter(min→max) morphological open → approximate bare earth; rst_chm → same surface tables (pixel-only path)
│
▼ (Part 3a) rst_isoband → h3_try_coverash3 → wc_h3_dem / wc_h3_dsm elevation-tier grids
▼ (Part 3a) gbx_rst_h3_rastertogridmax → wc_h3_chm max-canopy grid
▼ (Part 3a) h3_cellfill_array (k=1, IDW, land mask) → gap-filled H3 tables
│
▼ (Part 3b) independent candidate lattice → rst_viewshed_towers (per-tower, 1 m raster) → wc_rpx_raster_viewshed_demo
▼ (Part 3b) h3_los_visible (inline, res-12, self-contained) → wc_rpx_h3_viewshed_demo / wc_rpx_h3_coverage_demo
▼ (Part 3b) raster vs H3 comparison → wc_rpx_comparison_demo
│
▼ (Part 4) H3 res-9 centroid lattice → quick-pass rule-out (res-10, 30% threshold)
▼ (Part 4) h3_los_visible (res-12, 2.5 km buffer) → wc_h3_candidate_sites
▼ (Part 4) per-cell LOS depth aggregation → wc_h3_coverage / wc_h3_coverage_top10
Gotchas
- Bin per tile, bounded. A single 1 m raster over all of San Francisco is ~460 M pixels — far too large for one tile.
rx.bin_points_tiledassigns per-tile extents and bins each tile with memory bounded by the grid (W×H), not the point count, so full-density (DECIMATE=1) binning never OOMs. (Callingrst_binpoints_aggdirectly realizes a whole tile's points and can exhaust RAM at full density — see Memory & scale.) - Ground is ASPRS class 2. The bare-earth DTM bins only classification 2 (ground); the DSM bins all returns. Filtering the point DataFrame to class 2 before the
minbin is what makes the DTM "bare earth." - Z must survive to the TIN.
rst_dtmfromgeoms_aggneedsPOINT Zgeometry. Build points with the productst_makepoint(x, y, z)and passst_asbinary(...)— the WKB carries Z, so the triangulation interpolates real elevations rather than collapsing to 2D. - Thin the points that feed the TIN. A Delaunay TIN holds all its points in memory to triangulate. Unlike the binned DTM (memory bounded by the raster grid), a triangulation is inherently global and can't be grid-bounded. At
DECIMATE=1a single tile's ground returns can exhaust a worker, so Part 2a samples them to a bounded count (TIN_MAX_PTS) before triangulating. A bare-earth TIN is near-identical from a representative subset. See RasterX › Memory & scale. - Empty / corrupt point-cloud nodes are skipped. The
lidar_gbxreader skips 0-byte or unreadable.lazfiles with a warning instead of failing the whole distributed read. One bad EPT node therefore can't take down the job. - Serverless-safe throughout. No
spark.conf.set,_jvm,.rdd,.cache()/.persist(). Surfaces are persisted to permanent tables you own (CATALOG.SCHEMA) — a governed Delta table of tiles, reused across cells and sessions rather than a session temp table. An optionalgtiff_gbxexport writes GeoTIFF files to a Volume.
Related
- DEM extra — H3 Rasterize takes the complementary path. It runs a ready-made 10 m seamless DEM over the Bay Area through the full raster→H3 pipeline (
rst_clip→rst_isoband→ product H3 →rst_h3_rasterize_agg→rst_frombands_agg). No LiDAR required — it shows the "if the elevation raster already exists" route to the same kind of coverage-tier model.