Hazards is BetterCalapan's localized hazard-risk map for Calapan City. It helps residents explore barangay-level hazard zones and critical facilities.
Note
The platform is currently in beta. Versions >= 0.1.x are usable and publicly released, but the version will be tagged as 1.0.0 once the app has been optimized.
| Tool | Purpose |
|---|---|
| SvelteKit | Framework |
| TypeScript | Type safety |
| MapLibre GL JS | Interactive maps |
| Vite | Build tool |
| Vanilla CSS | Styling |
| Vitest | Unit testing |
| Playwright | Browser testing |
| Cloudflare Workers | Hosting |
| pnpm | Package management |
# Install dependencies
pnpm install
# Start the dev server
pnpm run dev
# Run checks in order
pnpm run check
pnpm run build
pnpm run lint
pnpm run testIf wrangler.jsonc changes, run pnpm run gen before the checks.
Browser tests require Chromium:
pnpm exec playwright install chromium
pnpm run test:browserFor network-related browser failures, rerun serially:
pnpm exec playwright test --workers=1pnpm run deployThe app deploys to Cloudflare Workers through Wrangler.
| Source | Data |
|---|---|
| OCHA Philippines COD-AB | Calapan barangay boundaries |
| UP NOAH Center | Flood, storm-surge, and landslide hazard classes |
| GeoRisk Philippines | Ground shaking, liquefaction, and tsunami layers |
| PANaHON | Typhoon tracks |
| Mapzen Terrain Tiles | 3D elevation data |
Generate localized hazard tiles and barangay summaries:
pnpm run generate:hazardsThe generator expects NOAH inputs under ~/downloads/noah/{flood,storm-surge,landslide}. Set NOAH_DATA_DIR to use another root.
Refresh the critical-facilities snapshot:
pnpm run generate:critical-facilitiesReview source freshness, coverage, licensing, and verification status before publishing refreshed data.
GNU GPL v3.0. See LICENSE for details.
