Update no-go areas spec with GPX persistence and export options

Documents:
- Right-click to delete
- Save to Journal preserves no-go areas in GPX extensions
- Export Plan includes full planning state
- Export Route is clean track only
- GPX extensions format with trails:planning namespace

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-03 12:53:17 +01:00
parent 180f1fc4bd
commit 7ef694c366
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9

View file

@ -13,5 +13,44 @@ Users SHALL be able to draw polygons on the map that BRouter avoids when computi
- **AND** BRouter routes around the no-go area
#### Scenario: Delete no-go area
- **WHEN** a user deletes a no-go area polygon
- **WHEN** a user right-clicks a no-go area polygon
- **THEN** it is removed from the Yjs doc and the route is recomputed
### Requirement: Persist no-go areas in GPX
No-go areas SHALL be preserved when saving to the journal or exporting a plan.
#### Scenario: Save to Journal
- **WHEN** a user saves a route to the journal from the planner
- **THEN** the GPX includes no-go area polygons in `<extensions>` using the `trails:planning` namespace
- **AND** editing the route in the planner restores the no-go areas
#### Scenario: Export Plan
- **WHEN** a user exports a plan (via "Export Plan" dropdown option)
- **THEN** the GPX includes waypoints, track, and no-go areas in `<extensions>`
- **AND** reimporting the plan into the planner restores all planning data
#### Scenario: Export Route
- **WHEN** a user exports a route (default export or "Export Route" dropdown option)
- **THEN** the GPX includes only the computed track (no waypoints, no extensions)
- **AND** the file is compatible with any GPX-consuming application
### Requirement: GPX extensions format
No-go areas are stored in GPX using a custom XML namespace:
```xml
<gpx xmlns:trails="https://trails.cool/gpx/1">
<extensions>
<trails:planning>
<trails:nogo>
<trails:point lat="52.5" lon="13.3"/>
<trails:point lat="52.4" lon="13.4"/>
<trails:point lat="52.3" lon="13.2"/>
</trails:nogo>
</trails:planning>
</extensions>
</gpx>
```
- Each `<trails:nogo>` element contains 3+ `<trails:point>` elements
- Parser accepts both namespaced (`trails:nogo`) and non-namespaced (`nogo`) elements
- Areas with fewer than 3 points are rejected on parse