Client-side GeoJSON area calculator for comparing multiple point-to-coverage methods in the browser.
This app is designed for loading point GeoJSON, adjusting spatial rules, comparing generated coverage polygons on a map, and exporting the resulting GeoJSON layers.
bun i
bun run devThen open the local Vite URL, load a point GeoJSON file, pick or adjust a profile, and run the calculations.
- Loads GeoJSON
PointandMultiPointinputs and normalizes them into point features. - Compares multiple coverage methods from the same dataset and parameter set.
- Runs heavy calculations in a Web Worker so the UI can keep updating incrementally.
- Previews generated geometries on a Leaflet map and exports each method as GeoJSON.
- Supports built-in and saved parameter profiles.
- Publishes cleanly to GitHub Pages.
- Upload a GeoJSON file containing point features.
- Choose a built-in profile or adjust the calculation parameters manually.
- Click
Calculate all methods. - Inspect each result on the map.
- Switch the displayed area unit between
ha,m², andkm². - Export any generated result as GeoJSON.
The app currently calculates these output layers:
- Observed footprint
- Connectivity A
- Connectivity B
- Cluster + concave hull
- Occupied grid
Each method uses the currently selected profile values from the sidebar.
# install dependencies
bun i
# start local dev server
bun run dev
# create a production build
bun run build
# preview the production build locally
bun run previewsrc/
main.js UI, map rendering, profile management, worker messaging
calculator.js Shared spatial calculation logic
calculation-worker.js Background calculation orchestration
config.js Default parameters and built-in presets
styles.css Layout and visual styling
- The app is fully client-side.
- Long-running geospatial work is executed in
src/calculation-worker.js. - Shared spatial logic lives in
src/calculator.js. - The map preview uses lighter preview geometry where available, while exports preserve the full generated GeoJSON.
- Input should be valid GeoJSON.
- The app currently expects
PointorMultiPointgeometry. - Non-point geometries are ignored during extraction.
GitHub Pages deployment is configured in .github/workflows/deploy-pages.yml.
On pushes to main, the workflow:
- installs dependencies with Bun
- builds the app with Vite
- publishes the
dist/output to GitHub Pages
The Vite config uses a relative base path so the built app works both on GitHub Pages subpaths and when served from the site root.
Keep changes incremental and preserve the current product shape:
- upload point GeoJSON
- adjust parameters
- compare methods
- preview geometry
- export GeoJSON
Before opening a PR:
bun run buildIf calculation behavior changes, verify at least one real GeoJSON upload in the browser.
TODO: add project license.