RustGIS-compiled static peat and KHG vector tile pipeline #2

Closed
opened 2026-10-14 18:24:06 +00:00 by yuris · 0 comments
Owner

What to build

Build a preprocessing script using the RustGIS CLI / tippecanoe to convert khg_layer37.geojson (16 MB) and lahan_gambut_layer6.geojson (31 MB) into high-performance .pmtiles vector archives. Serve the PMTiles statically and render them as toggleable vector layers in MapLibre with graduated symbology for peat depth.

Technical specifications

  1. Target files:

    • scripts/build-pmtiles.sh: CLI batch compilation script converting GeoJSON into .pmtiles.
    • src/lib/gis/pmtiles-protocol.ts: Custom MapLibre PMTiles protocol registration utility.
    • src/components/map/layers/peat-soil-layer.tsx: MapLibre fill and outline layer definitions.
    • src/components/map/layers/khg-layer.tsx: MapLibre boundary line layer definitions.
    • src/components/controls/layer-toggles.tsx: Glassmorphism toggle switch panel.
    • public/tiles/peat_soil.pmtiles: Compiled peat soil polygon tile pyramid.
    • public/tiles/khg.pmtiles: Compiled KHG boundary tile pyramid.
  2. Compilation parameters:

    • Tooling: tippecanoe / pmtiles / rustgis-cli.
    • Peat Soil layer: tippecanoe -z 12 -Z 3 --drop-densest-as-needed -l peat_soil -o public/tiles/peat_soil.pmtiles .cache/lahan_gambut_layer6.geojson.
    • KHG layer: tippecanoe -z 12 -Z 3 --coalesce-densest-as-needed -l khg -o public/tiles/khg.pmtiles .cache/khg_layer37.geojson.
  3. Graduated depth symbology:

    • Property: peat_depth or extracted numerical depth in centimeters.
    • Color scale:
      • <50 cm (Sangat Dangkal): #fef08a (amber-200, opacity 0.5)
      • 50-100 cm (Dangkal): #fde047 (amber-300, opacity 0.55)
      • 100-200 cm (Sedang): #fbbf24 (amber-400, opacity 0.6)
      • 200-300 cm (Dalam): #f59e0b (amber-500, opacity 0.65)
      • 300-500 cm (Sangat Dalam): #d97706 (amber-600, opacity 0.7)
      • >500 cm (Kubah Gambut / Ekstrem): #7c2d12 (amber-900, opacity 0.8)
    • KHG Boundaries: stroke #38bdf8 (sky-400), line-width 1.2px, dasharray [3, 2].
  4. HTTP Range serving:

    • PMTiles protocol registered via pmtiles.Protocol() in MapLibre.
    • Static file route in Next.js returning Accept-Ranges: bytes and Content-Range headers for single-digit millisecond tile fetches.

Acceptance criteria

  • CLI script compiles 47 MB GeoJSON down to <12 MB .pmtiles archives.
  • curl -r 0-1023 -I http://localhost:3000/tiles/peat_soil.pmtiles returns HTTP 206 Partial Content.
  • Map displays peat soil polygons shaded by depth classification with zero UI frame drops.
  • Floating layer switch widget toggles Peat Soil and KHG layers on/off instantly.

Blocked by

  • Issue 1: Project scaffold, toolchain verification, and WebGL map baseline.

### What to build Build a preprocessing script using the RustGIS CLI / tippecanoe to convert `khg_layer37.geojson` (16 MB) and `lahan_gambut_layer6.geojson` (31 MB) into high-performance `.pmtiles` vector archives. Serve the PMTiles statically and render them as toggleable vector layers in MapLibre with graduated symbology for peat depth. ### Technical specifications 1. **Target files**: - `scripts/build-pmtiles.sh`: CLI batch compilation script converting GeoJSON into `.pmtiles`. - `src/lib/gis/pmtiles-protocol.ts`: Custom MapLibre PMTiles protocol registration utility. - `src/components/map/layers/peat-soil-layer.tsx`: MapLibre fill and outline layer definitions. - `src/components/map/layers/khg-layer.tsx`: MapLibre boundary line layer definitions. - `src/components/controls/layer-toggles.tsx`: Glassmorphism toggle switch panel. - `public/tiles/peat_soil.pmtiles`: Compiled peat soil polygon tile pyramid. - `public/tiles/khg.pmtiles`: Compiled KHG boundary tile pyramid. 2. **Compilation parameters**: - Tooling: `tippecanoe` / `pmtiles` / `rustgis-cli`. - Peat Soil layer: `tippecanoe -z 12 -Z 3 --drop-densest-as-needed -l peat_soil -o public/tiles/peat_soil.pmtiles .cache/lahan_gambut_layer6.geojson`. - KHG layer: `tippecanoe -z 12 -Z 3 --coalesce-densest-as-needed -l khg -o public/tiles/khg.pmtiles .cache/khg_layer37.geojson`. 3. **Graduated depth symbology**: - Property: `peat_depth` or extracted numerical depth in centimeters. - Color scale: - `<50 cm` (Sangat Dangkal): `#fef08a` (amber-200, opacity 0.5) - `50-100 cm` (Dangkal): `#fde047` (amber-300, opacity 0.55) - `100-200 cm` (Sedang): `#fbbf24` (amber-400, opacity 0.6) - `200-300 cm` (Dalam): `#f59e0b` (amber-500, opacity 0.65) - `300-500 cm` (Sangat Dalam): `#d97706` (amber-600, opacity 0.7) - `>500 cm` (Kubah Gambut / Ekstrem): `#7c2d12` (amber-900, opacity 0.8) - KHG Boundaries: stroke `#38bdf8` (sky-400), line-width `1.2px`, dasharray `[3, 2]`. 4. **HTTP Range serving**: - PMTiles protocol registered via `pmtiles.Protocol()` in MapLibre. - Static file route in Next.js returning `Accept-Ranges: bytes` and `Content-Range` headers for single-digit millisecond tile fetches. ### Acceptance criteria - [x] CLI script compiles 47 MB GeoJSON down to <12 MB `.pmtiles` archives. - [x] `curl -r 0-1023 -I http://localhost:3000/tiles/peat_soil.pmtiles` returns `HTTP 206 Partial Content`. - [x] Map displays peat soil polygons shaded by depth classification with zero UI frame drops. - [x] Floating layer switch widget toggles Peat Soil and KHG layers on/off instantly. ### Blocked by - Issue 1: Project scaffold, toolchain verification, and WebGL map baseline. ---
yuris closed this issue 2026-10-14 19:55:07 +00:00
yuris changed title from Issue 2: RustGIS-compiled static peat and KHG vector tile pipeline to RustGIS-compiled static peat and KHG vector tile pipeline 2026-10-14 22:31:31 +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#2
No description provided.