tower / interior-flight / files / src / views / raster.ts
Branch interior-flight · default branch · all branches
raster.ts
5a57ebae 2026-09-07 Pavel Safronov | 1 | /** |
| 2 | * Metadata for the rasters `npm run terrain` writes into static/. | |
| 3 | * | |
| 4 | * These must match the `render` block of content/geography.json — the generator | |
| 5 | * reads that file, the browser only ever sees the PNGs, and nothing in between | |
| 6 | * carries the numbers across. test/raster.test.ts asserts the two agree, because | |
| 7 | * a silent disagreement here would displace the terrain rather than break it, and | |
| 8 | * that failure mode has already cost this project once (D-024). | |
| 9 | */ | |
| 10 | export const RASTER_WIDTH = 2048 | |
| 11 | export const RASTER_HEIGHT = 1192 | |
| 12 | /** | |
| 13 | * The working range terrain-height.png is stretched across: black is the floor of | |
| 14 | * it, white the ceiling. It is deliberately not a round number and not anchored at | |
| 15 | * zero — it only has to cover the terrain that exists, and the tighter it is the | |
| 16 | * finer every step in it. Below zero is real: lake and sea floors are cut beneath | |
| 17 | * the datum, and the old fixed 0..5,000 m encoding clipped them flat. | |
| 18 | */ | |
9a621732 2026-09-08 Pavel Safronov | 19 | export const RASTER_MIN_HEIGHT_M = -560 |
5a57ebae 2026-09-07 Pavel Safronov | 20 | export const RASTER_MAX_HEIGHT_M = 4400 |
| 21 | export const RASTER_HEIGHT_SPAN_M = RASTER_MAX_HEIGHT_M - RASTER_MIN_HEIGHT_M | |
| 22 | ||
| 23 | export const COLOR_RASTER = 'terrain-color.png' | |
| 24 | export const HEIGHT_RASTER = 'terrain-height.png' |