
## Terrain 50 → Unity heightmaps (2026-11-06 ~15:35 UK)
- Script: `convert_terrain50.py` (`overview` or `square SK SO …`), venv `.venv` (numpy, rasterio 1.5.2 wheels, pillow). Outputs in `heightmaps/`, index `heightmaps/heightmaps_index.json`.
- Nodata: OS sea fill -0.9 and missing tiles → GeoTIFF nodata -9999; 16-bit PNG/RAW value 0. Northern Ireland is nodata (Terrain 50 is GB only).
- 16-bit PNG/.r16 (uint16 little-endian, rows north→south): 0 = nodata/sea; h_m = min_m + (v-1)/65534·(max_m-min_m), min/max per file JSON.
- GB overview: 8×8 block mean (nodata ignored) to 400 m BNG (OSGB 0,0–660000,1230000), bilinear warp to EPSG:4326 at 0.0065°×0.0038° (~415×420 m) → 1631×2930, bounds W-8.759 S49.815 E1.843 N60.949, −36.9…1278.7 m (block mean lowers peaks; Ben Nevis ~1345 m at 50 m).
- SK at native 50 m: BNG 400000,300000–500000,400000 (`sk_50m_27700.tif`, 2000×2000) and EPSG:4326 0.00075°×0.00045° (~50 m) → 2009×2018, −134.0…636.3 m. The −134 m minimum is a deep pit in the official data near E456100 N315300 (looks like a quarry). It has not been changed.
- Only resampling of the official grid; no infill. Licence OGL v3.0: **Contains OS data © Crown copyright and database right 2026**.
