feat: basic brouter shapes handling #124

Merged
maxtkc merged 8 commits from 120-shapes-brouter into main 2026-05-11 22:34:57 +00:00
Owner

Closes #120

Closes #120
maxtkc self-assigned this 2026-05-11 22:34:43 +00:00
When a shape is replaced (delete + insert), handleShapeRemoved removes
the shape's features from routeFeatures. The subsequent insert call to
invalidateShape sets the new coords in shapeIndex but finds no matching
features to update in-place. Detect this case (anyUpdated === false) and
call invalidateTrip('insert') for each trip referencing the shape so
they are re-bucketed with the new shape geometry without a page reload.
When anyUpdated is false (shape deleted then re-inserted via GPX replace),
calling invalidateTrip with 'insert' skips the bucket-removal step, leaving
the trip in the stop-seq fallback bucket created by handleShapeRemoved.
Both a stop-seq feature and a shape feature then exist in routeFeatures,
with the stop-seq drawn on top and the shape invisible.

Using 'update' instead causes invalidateTrip to first remove the trip from
its old stop-seq bucket (via tripToFeatureKey → removeTripFromBucket) before
adding it to the new shape bucket, so only the shape geometry is rendered.
maxtkc merged commit 037a45311a into main 2026-05-11 22:34:57 +00:00
maxtkc deleted branch 120-shapes-brouter 2026-05-11 22:34:57 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gtfs.zone/coloring-book!124
No description provided.