feat(terrain): configure Anycast CDN DEMNAS 3D elevation terrain tiles replacing demo source #100

Merged
yuris merged 1 commit from feat/demnas-terrain-tiles into main 2026-10-15 01:21:20 +00:00
Owner

Summary

Replaces external third-party demonstration terrain tiles with configurable Anycast CDN and local DEMNAS 3D elevation endpoints.

Closes #97

Principles applied

  • principle-boundary-discipline: Eliminates third-party runtime dependency on demotiles.maplibre.org by binding elevation raster delivery to Anycast CDN and local endpoints.
  • principle-build-the-lever: Added scripts/generate-demnas-terrain.py with verified Mapbox Terrain-RGB encoder/decoder formulas for DEMNAS rasters.
  • principle-test-behavior-not-implementation: Asserted that terrain tile sources point to production CDN raster endpoints without referencing third-party demo servers.
  • ponytail-review: Maintained standard Mapbox Terrain-RGB encoding compatible with MapLibre GL JS native raster-dem without adding extra shader plugins.

Impact

  • For the consumer: Eliminates external server outages; enables fast 3D peat dome elevation rendering directly from the Anycast CDN edge.
  • For the maintainer: Clean configuration via NEXT_PUBLIC_TERRAIN_TILES_URL and reusable Terrain-RGB processing utility.

Anti-Overengineering Audit (ponytail-review)

  • No bespoke tools or in-house crates added when standard upstream libraries exist.
  • No cosmetic compliance (e.g. importing a library just to call an unused helper or info command).
  • Code subtraction evaluated: unnecessary wrappers or files were deleted rather than preserved.

Verification proof

  • pnpm exec vp check: Passed cleanly with zero formatting or lint errors across 241 files.
  • pnpm test: 14 test suites and 84 unit tests passed in 359ms.
  • pnpm build: Next.js Turbopack production build completed cleanly with all 12 routes generated.
## Summary Replaces external third-party demonstration terrain tiles with configurable Anycast CDN and local DEMNAS 3D elevation endpoints. Closes #97 ### Principles applied - `principle-boundary-discipline`: Eliminates third-party runtime dependency on `demotiles.maplibre.org` by binding elevation raster delivery to Anycast CDN and local endpoints. - `principle-build-the-lever`: Added `scripts/generate-demnas-terrain.py` with verified Mapbox Terrain-RGB encoder/decoder formulas for DEMNAS rasters. - `principle-test-behavior-not-implementation`: Asserted that terrain tile sources point to production CDN raster endpoints without referencing third-party demo servers. - `ponytail-review`: Maintained standard Mapbox Terrain-RGB encoding compatible with MapLibre GL JS native raster-dem without adding extra shader plugins. ### Impact - **For the consumer:** Eliminates external server outages; enables fast 3D peat dome elevation rendering directly from the Anycast CDN edge. - **For the maintainer:** Clean configuration via `NEXT_PUBLIC_TERRAIN_TILES_URL` and reusable Terrain-RGB processing utility. ### Anti-Overengineering Audit (ponytail-review) - [x] No bespoke tools or in-house crates added when standard upstream libraries exist. - [x] No cosmetic compliance (e.g. importing a library just to call an unused helper or info command). - [x] Code subtraction evaluated: unnecessary wrappers or files were deleted rather than preserved. ### Verification proof - `pnpm exec vp check`: Passed cleanly with zero formatting or lint errors across 241 files. - `pnpm test`: 14 test suites and 84 unit tests passed in 359ms. - `pnpm build`: Next.js Turbopack production build completed cleanly with all 12 routes generated.
feat(terrain): configure local and Anycast CDN DEMNAS 3D elevation terrain tiles
All checks were successful
CI / Verify Quality & Build (pull_request) Successful in 1m16s
540d81b773
- Remove third-party dependency on demotiles.maplibre.org in dem-terrain.ts
- Configure DEFAULT_TERRAIN_TILES_URL pointing to Anycast CDN endpoint (https://cdn.nokopia.com/tiles/terrain/) with env override
- Add scripts/generate-demnas-terrain.py for processing BIG DEMNAS rasters into Terrain-RGB encoding
- Update unit tests in src/lib/gis/__tests__/dem-terrain.test.ts

Closes #97
yuris merged commit 0ddd18b07f into main 2026-10-15 01:21:20 +00:00
yuris deleted branch feat/demnas-terrain-tiles 2026-10-15 01:21:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
backend
frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/titik-gambut-next!100
No description provided.