# Chilime terrain layers

The web reconstruction renders two independent terrain surfaces. SRTM is no
longer copied into or used by the web app.

## Active surfaces

### NASA High Mountain Asia 8 m

- Source raster: `HMA_DEM8m_MOS_20170716_tile-675_chilime_crop.tif`
- Official dataset: [NASA/NSIDC HMA 8-meter DEM Mosaics, Version 1](https://nsidc.org/data/hma_dem8m_mos/versions/1)
- Native horizontal grid: custom WGS 84 Albers Equal-Area, 8 m pixels
- Native vertical reference: WGS 84 ellipsoidal height
- Browser grid: `nasa-hma-8m-grid.json`, reprojected over the audited web extent
- Display vertical reference: EGM2008 orthometric height. The conversion samples
  the `us_nga_egm08_25.tif` geoid at every browser-grid cell and applies
  `H = h - N`.
- Coverage is partial. Source no-data remains no-data and appears as holes; it is
  never filled from the coarser layer.

### Paid NextGIS custom-area DEM

- Source raster: `dem-custom-af926f8c-20260902-en-gpkg/data/dem.tif`
- Upstream dataset: [Copernicus DEM GLO-30](https://dataspace.copernicus.eu/explore-data/data-collections/copernicus-contributing-missions/collections-description/COP-DEM)
- Native horizontal grid: WGS 84 geographic, one arc-second cells
- Vertical reference: EGM2008 orthometric height
- Browser grid: `nextgis-dem-grid.json`, retaining the native 174 × 106 cells
- Coverage is complete over the web reconstruction extent. It is the continuous
  comparison/fallback surface, but its source detail remains about 30 m.

Run `node scripts/build-elevation-grids.mjs` from `webapp/` to regenerate both
browser grids, then `pnpm sync-data`. The generator requires GDAL and the
EGM2008 geoid grid installed with QGIS LTR.

## Rendering and comparison

- Both elevation layers are selectable independently and can be overlaid with
  separate opacity controls. NextGIS is enabled by default for continuous
  coverage; NASA remains available for higher-detail partial coverage and
  comparison.
- One world unit is one metre horizontally and vertically. There is no relief
  exaggeration.
- The display mesh is sampled every 8 m. This preserves the nominal NASA spacing;
  it does not turn the NextGIS 30 m cells into 8 m observations.
- Contours are calculated separately from whichever terrain surfaces are visible.
- OpenStreetMap is draped over the complete NextGIS geometry and is requested only
  when selected.
- Mapbox Satellite is a separate on-demand zoom-16 imagery layer draped over the
  complete NextGIS geometry. It requests nine tiles for the fixed audited extent.
  The public browser token is intentionally shipped to the client and should be
  restricted to the deployment URLs in the Mapbox account. Imagery does not
  replace or refine the 30 m elevation cells.
- Over the 14,177 shared valid vertices in the rendered 8 m mesh, NASA minus
  NextGIS has mean +0.23 m, median -1.74 m, MAE 8.83 m, RMSE 13.62 m and
  95th-percentile absolute difference 29.09 m. At the approximate map anchor,
  the two rendered grids differ by 12.43 m.
  This is agreement between two surface models, not surveyed accuracy.

## Operational limits

Neither DEM is a current rescue survey. Both may include vegetation, buildings,
snow, shadows, steep-slope artifacts, older terrain and mosaic seams. The NASA
mosaic also has genuine data gaps. Neither surface resolves a portal opening,
retaining wall, tunnel invert, narrow river channel or current debris field.

The station coordinate is an approximate map listing attached to the first Main
Access route point. Plan +X east/+Y north is an assumption because the supplied
chainage drawing has no north arrow or survey control. The drawing's printed
EL 1387.492 reference has no verified geodetic tie to EGM2008. Consequently the
app must not be used to calculate rock cover, tunnel grade, safe approach paths
or personnel positions without control points established by a qualified survey
team.

The former SRTM files remain in this reference directory only as historical audit
artifacts. `sync-data.mjs` clears the public terrain directory before publishing,
so none of them are shipped or rendered.
