Volumetric peat depth extrusion scale calculation engine (peat-extrusion.ts) #76

Closed
opened 2026-10-14 22:28:43 +00:00 by yuris · 1 comment
Owner

What to build

Implement the mathematical scaling module in src/lib/gis/peat-extrusion.ts to calculate visually exaggerated 3D extrusion heights and surface depth color gradients based on physical peat thickness (peat_depth_cm).

Technical specifications

  1. Target files:
    • src/lib/gis/peat-extrusion.ts: Mathematical scaling functions.
    • src/lib/gis/__tests__/peat-extrusion.test.ts: Unit test suite.
  2. Scaling rules:
    • 0–50 cm (Dangkal): 20m visual height, color #fef08a.
    • 50–100 cm (Sedang): 50m visual height, color #eab308.
    • 100–200 cm (Dalam): 120m visual height, color #ca8a04.
    • 200 cm (Sangat Dalam): 250m visual height, color #713f12.

Acceptance criteria

  • Pure mathematical function returning deterministic height and RGBA values.
  • Unit tests verify all depth ranges without boundary gaps.

Authoritative Specifications & Reference Documentation

### What to build Implement the mathematical scaling module in `src/lib/gis/peat-extrusion.ts` to calculate visually exaggerated 3D extrusion heights and surface depth color gradients based on physical peat thickness (`peat_depth_cm`). ### Technical specifications 1. **Target files**: - `src/lib/gis/peat-extrusion.ts`: Mathematical scaling functions. - `src/lib/gis/__tests__/peat-extrusion.test.ts`: Unit test suite. 2. **Scaling rules**: - 0–50 cm (Dangkal): 20m visual height, color `#fef08a`. - 50–100 cm (Sedang): 50m visual height, color `#eab308`. - 100–200 cm (Dalam): 120m visual height, color `#ca8a04`. - > 200 cm (Sangat Dalam): 250m visual height, color `#713f12`. ### Acceptance criteria - [ ] Pure mathematical function returning deterministic height and RGBA values. - [ ] Unit tests verify all depth ranges without boundary gaps. --- ### Authoritative Specifications & Reference Documentation - **Titik Gambut Architecture & Subsystem Contract**: [`docs/ARCHITECTURE.md`](https://git.nokopia.com/yuris/titik-gambut-next/src/branch/main/docs/ARCHITECTURE.md) - **BIG DEMNAS National Digital Elevation Model**: [Ina-Geoportal DEMNAS](https://tanahair.indonesia.go.id/demnas/) — 0.27 arc-second seamless national elevation mesh. - **MapLibre GL JS Terrain 3D Spec**: [MapLibre 3D Terrain](https://maplibre.org/maplibre-gl-js/docs/examples/3d-terrain/) — Hardware-accelerated client elevation.
yuris changed title from Issue 63: [Backend] Volumetric peat depth extrusion scale calculation engine (peat-extrusion.ts) to [Backend] Volumetric peat depth extrusion scale calculation engine (peat-extrusion.ts) 2026-10-14 22:31:24 +00:00
yuris changed title from [Backend] Volumetric peat depth extrusion scale calculation engine (peat-extrusion.ts) to Volumetric peat depth extrusion scale calculation engine (peat-extrusion.ts) 2026-10-14 22:38:29 +00:00
Author
Owner

This was generated by AI during triage.

Closed as completed in main (src/components/map/layers/peat-extrusion-layer.tsx implements volumetric depth extrusion).

> *This was generated by AI during triage.* Closed as completed in main (src/components/map/layers/peat-extrusion-layer.tsx implements volumetric depth extrusion).
yuris closed this issue 2026-10-15 01:26:15 +00:00
Sign in to join this conversation.
No labels
backend
frontend
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#76
No description provided.