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

  1. Calculations by replacement libraries need to be fast enough so that users won't recognize any delays.
  2. Must be a fitting replacement for the current library allowing for easy integration.
  3. Replacement solutions have to be well maintained and documented.

Assumptions

  1. Switching hull calculation to the backend is not preferred right now and only a last resort.
  2. 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)

GitHub

  • Popular (721 stars on GitHub)

  • Latest release: 2.0.0 from July 16, 2025 (as of 05.02.2026)

  • fast algorithm

  • well-tested

  • Dependencies

Yet to be tested

  • Test results:

Alternative B: concaveHullJS (by Mark Roland)

GitHub

  • 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)

Documentation
GitHub

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

Notes