Drainage canal and canal block proximity risk factor engine (danger-score.ts) #56

Closed
opened 2026-10-14 22:28:38 +00:00 by yuris · 0 comments
Owner

What to build

Enhance the fire danger scoring engine in src/lib/domain/danger-score.ts to compute distance penalties for hotspots located near unblocked drainage canals and apply mitigation credits if nearby functional sekat kanal are present.

Technical specifications

  1. Target files:
    • src/lib/domain/danger-score.ts: Add calculateCanalRiskFactor(hotspotCoord, canals, sekatKanal).
    • src/lib/domain/__tests__/danger-score.test.ts: Vitest unit tests.
  2. Algorithm rules:
    • Hotspot within 250m of an unblocked drainage canal: +15 penalty points.
    • Hotspot within 500m of a functional, water-holding sekat kanal: -10 mitigation credit.

Acceptance criteria

  • Unit tests pass covering all canal proximity combinations.
  • Scoring remains deterministic and executes under 1ms per cluster.

Authoritative Specifications & Reference Documentation

  • Titik Gambut Architecture & Subsystem Contract: docs/ARCHITECTURE.md
  • Kementerian ATR/BPN Satu Peta HGU: Satu Peta Geoportal — Official cadastral HGU plantation concessions.
  • KLHK Geoportal PBPH-HTI / PBPH-HA: KemenLHK WebGIS — Forestry and pulpwood concession boundaries.
  • Global Forest Watch Indonesia Concessions: GFW Open Data — Reference timber and palm oil concessions.
  • BRGM PRIMS (Peatland Restoration Information & Monitoring System): prims.brgm.go.id — Peat drainage canals, canal blocks (sekat kanal), and deep wells (sumur bor).
  • Pantau Gambut Canal Network: pantaugambut.id — Field verification data on drainage canal degradation.
### What to build Enhance the fire danger scoring engine in `src/lib/domain/danger-score.ts` to compute distance penalties for hotspots located near unblocked drainage canals and apply mitigation credits if nearby functional *sekat kanal* are present. ### Technical specifications 1. **Target files**: - `src/lib/domain/danger-score.ts`: Add `calculateCanalRiskFactor(hotspotCoord, canals, sekatKanal)`. - `src/lib/domain/__tests__/danger-score.test.ts`: Vitest unit tests. 2. **Algorithm rules**: - Hotspot within 250m of an unblocked drainage canal: +15 penalty points. - Hotspot within 500m of a functional, water-holding *sekat kanal*: -10 mitigation credit. ### Acceptance criteria - [ ] Unit tests pass covering all canal proximity combinations. - [ ] Scoring remains deterministic and executes under 1ms per cluster. --- ### 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) - **Kementerian ATR/BPN Satu Peta HGU**: [Satu Peta Geoportal](https://satupeta.atrbpn.go.id/) — Official cadastral HGU plantation concessions. - **KLHK Geoportal PBPH-HTI / PBPH-HA**: [KemenLHK WebGIS](https://geoportal.menlhk.go.id/) — Forestry and pulpwood concession boundaries. - **Global Forest Watch Indonesia Concessions**: [GFW Open Data](https://data.globalforestwatch.org/) — Reference timber and palm oil concessions. - **BRGM PRIMS (Peatland Restoration Information & Monitoring System)**: [prims.brgm.go.id](https://prims.brgm.go.id/) — Peat drainage canals, canal blocks (*sekat kanal*), and deep wells (*sumur bor*). - **Pantau Gambut Canal Network**: [pantaugambut.id](https://pantaugambut.id/) — Field verification data on drainage canal degradation.
yuris changed title from Issue 43: [Backend] Drainage canal and canal block proximity risk factor engine (danger-score.ts) to [Backend] Drainage canal and canal block proximity risk factor engine (danger-score.ts) 2026-10-14 22:31:26 +00:00
yuris changed title from [Backend] Drainage canal and canal block proximity risk factor engine (danger-score.ts) to Drainage canal and canal block proximity risk factor engine (danger-score.ts) 2026-10-14 22:38:32 +00:00
yuris closed this issue 2026-10-15 04:53:34 +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#56
No description provided.