Frontend Hull Library
Status: Draft
Assignee: Alfons Mueller
Problem
The library hull.js we currently use to do concave hull calculations in the drawing layers of the frontend is deprecated and not maintained anymore.
To avoid security and compatibility issues we want to switch to another solution.
Constraints
- Calculations by replacement libraries need to be fast enough so that users won't recognize any delays.
- Must be a fitting replacement for the current library allowing for easy integration.
- Replacement solutions have to be well maintained and documented.
Assumptions
- Switching hull calculation to the backend is not preferred right now and only a last resort.
- Overlapping areas are allowed as per polygon overlap decision. (TODO: add proper link once merged)
Only the top layer is relevant for heatmap calculations.
Solutions
Alternative A: concaveman (by Mapbox)
-
Popular (721 stars on GitHub)
-
Latest release: 2.0.0 from July 16, 2025 (as of 05.02.2026)
-
fast algorithm
-
well-tested
-
Dependencies
- rbush for point indexing
- tinyqueue as a priority queue
- point-in-polygon for point in polygon queries
- robust-predicates for 3-point orientation tests
Yet to be tested
- Test results:
Alternative B: concaveHullJS (by Mark Roland)
-
Not as well known as concaveman (28 stars on GitHub)
-
Last updated in April 2025 (as of 05.02.2026)
-
small, all-in-one library
-
not as well tested
-
Dependencies
- none
Yet to be tested
- Test results:
Alternative C: turf/concave (part of Turf.js)
-
Part of actively maintained geo library ecosystem (10.2k stars on GitHub)
-
Latest release: v7.3.3 from January 28, 2026 (as of 05.02.2026)
-
Very well documented
-
Concave hull functionality only a small part of Turf.js
-
Only needed modules can be imported
-
A comparison to concaveman is made which returns correct hull
Yet to be tested
- Test results:
Alternative D: Backend implementation (fallback)
- If no suitable frontend library, implement in Rust backend using PostGIS ST_ConcaveHull or Rust geo crate
- Possibility of implementing polygon clipping on a data level instead of current solution (last added polygon is used for calculations(TODO: add proper link once merged))
- A lot more involved then just replacing hull.js with another library
Decision
Rationale
Implications
Related Decisions
- Old Polygon calculations decision
- Polygon overlap handling decision(TODO: add proper link once merged)