Lay of the Land
All methods

Hard cases

What happens where the data or the field isn't the easy kind, and where each is tested. The rule throughout is the spec's: a clear explanation, never made-up terrain.

No lidar

Discovery lists what exists, even if it's only USGS's 1/3 arc-second DEM, and ranking refuses anything coarser than 3 m as too coarse for tile grades. Nothing is recommended, and no build starts. The panel says "None of this data is good enough for tile design. You'll need a survey, or an upload of better data", or, with nothing found at all, "No elevation data found", with the upload already open.

coverage-gaps.md has where this happens in the tile-drained states: mostly reservations, where USGS has nothing finer.

Tested in test_against_database.py (nothing usable starts no build), test_ranking.py, and elevation.spec.ts (no data is explained honestly; when nothing is usable, nothing is recommended).

Mixed datums

  • A source on a datum that can't be converted, such as NGVD29 or NOAA's tidal datums, is listed with its datum named, and refused. test_usgs_discovery.py, test_noaa_discovery.py.
  • A product in a different system from its lidar. USGS's 1 m DEMs are NAVD88 in meters even where the lidar was in feet. Taking the index's word for the lidar scaled Indiana's and Wisconsin's terrain to 0.3048 of its height, until item 134 found it. test_usgs_discovery.py.
  • NAVD88 in feet is converted, in US survey feet or international feet. test_field_dem.py (heights always come out in meters).
  • A file that contradicts its listing, in its vertical system or its units, is refused when it's read, rather than trusted. So is an upload on a datum that needs a shift. test_field_dem.py.
  • Projects joined into one DEM are only joined if every one is NAVD88 in meters. test_usgs_discovery.py.
  • Heights that are grossly wrong whatever the source says, such as meters converted as if they were feet, are caught by comparing every build with USGS's 1/3 arc-second DEM, and the build is refused. elevation-accuracy.md has the thresholds. test_reference.py, test_terrain_build.py, test_uploads.py.
  • A point cloud file whose header gives another height unit or datum than its listing is refused. test_point_cloud_dem.py.

Tiny fields

  • Terrain always takes in 100 m around the fields, so even an acre has ground enough to say where water goes. test_aoi.py.
  • Land that drains into a small field from outside it is traced on coarser ground for 2 km around, and what can't be counted is marked as a minimum. hydrology.md explains. test_hydrology.py.
  • Processing doesn't assume size: a surface a few dozen cells across still conditions and draws. test_hydrology.py.
  • Automated layout says "The field's too small for laterals at this spacing" for each outlet where none fit, rather than offering nothing silently. generate.test.ts.

Large fields

  • A grid too large for the worker to hold is refused before any of it is read, saying how many cells it would be, how many the worker can hold, and what coarser grid size would fit. With no grid asked for, a point cloud is gridded at the finest its density supports that fits (0.25 to 5 m), and a DEM can be asked for a coarser cell size (resampled by area-weighted averaging). worker-deploy.md has how the limit is set. test_point_cloud_dem.py, test_field_dem.py, test_memory.py.
  • A point cloud streams through PDAL, so its size doesn't matter, only its grid's. test_point_cloud_dem.py.
  • Whole point cloud tiles pick up where they stopped after a dropped connection, and another attempt skips the tiles already kept. test_point_cloud_dem.py.

Irregular fields

  • Terrain follows a field's shape, not its bounding box. test_aoi.py. So does what's read of a point cloud: the outline goes to PDAL with enough around it for every edge cell, and the points in the rest of the rectangle are never fetched. test_point_cloud_dem.py.
  • Service areas only count land inside the fields, and land out of every pipe's reach is left as undrained. service-area.test.ts.
  • Laterals stop at holes in a field. laterals.test.ts.
  • Several fields are joined by a strip where they're close enough to share a main, and kept apart where they aren't. test_aoi.py.

Mixed-vintage coverage

A field often crosses from one lidar project to another, flown in different years, with neither covering it alone.

  • Each project is offered on its own, with how much of the area it covers. Ranking refuses one covering under half, and marks one under 95% down. test_ranking.py.
  • Coverage is measured against the outline of each project's data, not its 10 km tiles, which a field across a project boundary is wholly inside. elevation-ranking.md explains. test_usgs_discovery.py.
  • USGS's 1 m DEMs are joined where none covers 95% of the area but several together cover at least 5 points more than the best alone. The newest comes first, and the DEM reader keeps the first value it finds for a cell, so where they overlap the newer project's cells are used. The candidate's note says which projects, in what order, and its dates run from the oldest collection to the newest. test_usgs_discovery.py.
  • A build with gaps says how much of the area has data, and warns when it's thin. elevation.spec.ts.
  • A DEM that has less than the search said isn't saved with a hole nobody was told about. If it comes up more than 5 points of the area short of its listed coverage, the build reads the other 1 m DEM projects from the same search, newest first, to fill the rest, and says which it used. If that still leaves it more than 5 points short, or there's nothing to fill from, the build stops and says what it found: "This source was listed as covering 100% of the area, but its files have data for only 60% of it, so nothing was saved." The 5 points are a judgment: it's the margin ranking already uses for complete coverage, and the index's outlines are coarser than the data. A person's own file isn't held to this, since nothing measured its coverage, and neither is a point cloud, which has honest gaps over water. test_terrain_build.py.

The seam between joined projects

Two flights of the same ground commonly differ by several centimeters. Joined first value wins, that difference becomes a step along the line where one project's cells give way to the other's, and at a 0.1% grade a 10 cm step reads as 100 m of fall.

  • It's measured, not corrected. Where joined projects overlap, each cell's difference is taken, the joined project less the one whose cells are kept, in meters after any unit conversion. The terrain keeps the median, the 5th and 95th percentiles, and how many cells they share. No elevation is changed. Offering to remove the offset is a separate decision, and isn't made here.
  • Over 3 cm, it's a warning, which says how large the step is, what run of tile that is at a 0.1% grade, and that nothing was adjusted.
  • With fewer than 1,000 shared cells, the seam counts as not checked, and the terrain says so, which is also a warning. That includes projects that don't overlap at all. 1,000 cells is a judgment: at 1 m, a strip 2 m wide along 500 m of seam.

Why 3 cm, which is a judgment:

  • It's the finest step any of this lidar claims to hold. The USGS Lidar Base Specification's smooth surface precision is at most 3 cm for QL 0, and 6 cm for QL 1 and QL 2. A smaller step can't be told from what one flight already contains.
  • It's well above what the measurement can mistake. It's a median over 1,000 or more cells. Two grids of one flight came out 0.0 cm apart here, with 90% of cells within about 4 cm, and two flights three years apart came out 4.4 cm apart (elevation-accuracy.md).
  • It already matters to a design. 3 cm is the fall of 30 m of tile at 0.1%.
  • It isn't a fault in either project. The specification allows a QL 2 project 10 cm RMSE, and 8 cm between its own overlapping swaths, so two projects that both meet it can differ by more than this. The warning says there's a step, not that the data is bad.

test_field_dem.py, test_terrain_build.py.

Only USGS's 1 m DEMs are joined. Joining sources with different grids would resample one of them, and a point cloud gridded next to a DEM would make a seam that neither shows. Those are left as separate choices.