Overview
For the Ritual Map Paths feature (performant-software/core-data-places#658) we need to draw curved arc lines connecting a path's ordered stops (stop 1 → stop 2 → stop 3 …), shown as dashed arcs on the map. This is a small, reusable piece of map geometry, so it belongs in the shared geospatial library, next to the existing uncertainty-circle helper.
Specifics
- Given an ordered list of points, produce curved arc geometry connecting each consecutive pair.
- Each arc can be identified by its position in the sequence, so a consumer can style or highlight one segment.
- The amount of curve is adjustable. At the scale of these maps (stops a few hundred meters apart) a true great-circle arc looks straight — the curvature only shows over long distances — so a visible bow means a deliberate, adjustable curve.
- No new runtime dependency: turf.js (7.x) is already a dependency and is what the existing circle helper uses; it also bundles
@turf/bezier-spline, @turf/great-circle, and @turf/along.
A suggested shape
This is just one way to do it; if you see a cleaner approach, please use it.
- A function alongside
Map.toCertaintyCircle, for example Map.toArcs(coordinates, { curvature }), returning a GeoJSON FeatureCollection of LineStrings — one arc per consecutive pair, each tagged with its position in the sequence.
- To make the bow: for each pair A→B, take the midpoint, push it sideways by
curvature × distance(A, B), then run [A, midpoint, B] through @turf/bezier-spline. curvature defaults to a small value (around 0.2) and is adjustable.
Relevant code
@performant-software/geospatial — Map.toCertaintyCircle(point, radiusKm) is the pattern to mirror (a point + radius → a GeoJSON circle via @turf/circle).
core-data-places/src/apps/detailPages/PlaceMap.tsx — shows how the app draws that circle as a map layer.
Shipping
Part of performant-software/core-data-places#658.
Overview
For the Ritual Map Paths feature (performant-software/core-data-places#658) we need to draw curved arc lines connecting a path's ordered stops (stop 1 → stop 2 → stop 3 …), shown as dashed arcs on the map. This is a small, reusable piece of map geometry, so it belongs in the shared geospatial library, next to the existing uncertainty-circle helper.
Specifics
@turf/bezier-spline,@turf/great-circle, and@turf/along.A suggested shape
This is just one way to do it; if you see a cleaner approach, please use it.
Map.toCertaintyCircle, for exampleMap.toArcs(coordinates, { curvature }), returning a GeoJSONFeatureCollectionof LineStrings — one arc per consecutive pair, each tagged with its position in the sequence.curvature × distance(A, B), then run[A, midpoint, B]through@turf/bezier-spline.curvaturedefaults to a small value (around 0.2) and is adjustable.Relevant code
@performant-software/geospatial—Map.toCertaintyCircle(point, radiusKm)is the pattern to mirror (a point + radius → a GeoJSON circle via@turf/circle).core-data-places/src/apps/detailPages/PlaceMap.tsx— shows how the app draws that circle as a map layer.Shipping
@performant-software/geospatialrelease; core-data-places then updates to that version and draws the arcs as a dashed layer (Draw all stops and dashed arcs throughout the path core-data-places#660).Part of performant-software/core-data-places#658.