Planning (the Design canvas' Plan and GridToday, ideas from azedler/roadplanner): a stop's type as its NPS pictogram (marker and list), notes on the trip, its days and stops, + on a leg inserts the next point there; a parking spot per stop (P marker, the route goes there, the walk shown); a link pasted into the search becomes a place (/api/link: the URL's coordinates, else the page's geo meta / JSON-LD / a map link; public addresses only, logged in), added on the leg it lengthens least; avoids for the trip (+ ferries, unpaved) or a day (routed in pieces, joined); Check and Costs folds in the Route panel (no leave time, long days, arriving after sunset, long walks, missing vignettes; fuel from km × consumption × price, stop costs / paid, the budget); Today in drive mode's Menu (stops left, tonight, sunset, Open-Meteo weather, the day's notes, Skip next, Tomorrow). Plugins along the trip's route (Maptool::Corridor, a corridor width; Overpass around:) and plugin settings saved server-side; p4n via a host Firefox's cookies (docs/deployment.adoc). The recording's days (cut where the car stood ≥ 4 h, or by hand) and their export (days, a piece A–B, the whole trip; GPX with times). Track replay in the GNSS simulator. Step advance 5 m past a maneuver. The level gauge (drive mode, from Terrain): lift per wheel to the ramps' steps from roll, pitch, wheelbase and track
CI / check (push) Successful in 23s
CI / deploy (push) Successful in 18s

This commit is contained in:
randy committed 2026-12-03 23:34:25 +01:00
1 parent 5e31dfaba9
commit 87d7bd2463
36 files changed
+2047 -123

No files matched your search

+36 -10
View File
@@ -10,17 +10,19 @@ independence from connectivity.
* [x] Offline vector tiles (PMTiles/MBTiles) for Europe/world via Planetiler or MapTiler — Geofabrik per-country extracts, `osmium merge`, Planetiler's default OpenMapTiles profile straight to PMTiles (`lib/maptool/pmtiles_builder.rb`); offline now shares the exact same style/palette as online (`ONLINE_STYLE_PATCH`) instead of a separate protomaps-schema theme
* [x] Shaded relief / DEM layer — hillshade toggle in the sidebar, sourced from public Terrarium tiles online; reads `data/terrain.pmtiles` for offline if one's been generated (see docs/development.adoc), otherwise the toggle is online-only for now
** [ ] Terrain slope readout for parking (numeric, not just visual shading)
* [ ] Contour lines from OSM for hikes and mountain passes
* [x] Hiking trail overlay — Waymarked Trails raster tiles online (`public/js/hiking_trails.js`), colored per-route by the OSM `colour` tag they already render (the KST/KČT paint-blaze colors in Slovakia/Czechia, plain red elsewhere). Click queries a one-off Overpass `around` search (racing 3 public mirrors) for the route's name/colour/network/operator/distance
** [x] Offline copy wired in for real, no custom Planetiler profile needed — `Maptool::HikingTrails` (`lib/maptool/hiking_trails.rb`) runs `osmium tags-filter r/route=hiking` + `add-locations-to-ways` + `cat -f opl` against the *same* per-country Geofabrik `.osm.pbf` already downloaded for `offline.pmtiles`, no new download. One `data/hiking_trails/<CODE>.geojson` per country (not one combined file), generated as the last step of every offline build and cached like `geofabrik_cache` (skipped once already newer than its source PBF) — a many-country selection no longer means one giant file, since `GET /api/hiking-trails` lists available countries and the Overlays panel's own checklist only fetches `GET /tiles/hiking_trails/<CODE>.geojson` for whichever ones get ticked. Offline click uses a local `queryRenderedFeatures` hit-test instead of Overpass — instant, no network. See docs/development.adoc
* [x] Overpass/OSM scripts to extract POIs (drinking water, dump stations, LPG, public toilets, laundromats, shops, springs) — `rake overpass:pois`, see docs/development.adoc; writes a `.geojson` to drop in `data/gpx/` or upload. Also runnable from inside the app itself now, see the import plugins entry below (`plugins/overpass-pois` wraps this same query). Each category now carries a real `POI_ICONS` glyph and color (not p4n2gpx's plain red marker) plus a popup description built from opening_hours/operator/website tags
* [x] Import plugins: a pluggable way to add more data sources (Park4Night, iOverlander, Freecampsites, ...) without their scrapers necessarily living in this (public) repo — sidebar icon (logged in only) lists whatever's under `plugins/`, "Run for this area" uses the current map viewport as the bbox, no separate area-picker needed. Contract: a `plugin.json` manifest + a script that reads `--south`/`--west`/`--north`/`--east` and prints a GeoJSON `FeatureCollection` to stdout (`lib/maptool/plugins.rb`, `GET /api/plugins`, `POST /api/plugins/:name/run`) — output saved the same way an upload would be. `plugins/overpass-pois` ships as the reference example; a private/ToS-sensitive scraper just drops its own directory in locally and is never `git add`ed
** [x] Park4Night — private plugin (`data/plugins/p4n2gpx/`, outside this repo per the "ToS-sensitive scraper" note above); iOverlander/Freecampsites still open, same story
** [ ] Along the planned route (2026-12-01): Park4Night and overpass-pois fetch the whole
viewport/bbox today — a second mode for a corridor around the route (a few km either side):
the plugin contract gains the route (a polyline / buffered boxes, not one big bbox), the
results into the trip's folder
** [x] Along the planned route (2026-12-01): "Along the trip's route" ± 1/2/5/10/20 km in the
plugins panel; a plugin with `"route": true` gets `--route=<GeoJSON file> --corridor-km=N`
(overpass-pois: Overpass' `around:` over the thinned route; p4n2gpx: circles along it,
`lib/maptool/corridor.rb`), points further off dropped by maptool, into the recorded trip's
folder when one runs. Plugin settings (`"settings"` in plugin.json: a login cookie) set in the
panel, kept in `data/plugin_settings.json`, given to the command as env vars — p4n2gpx's
`P4N_SESSION_COOKIE` (park4night's login is behind reCAPTCHA: a browser's Cookie header)
** [x] A private plugin's own dependencies now have somewhere to live too: `data/plugins/` is under the persistent `data/` bind mount (survives a redeploy, unlike `build/`), and `docs/deployment.adoc` documents the convention
* [x] Kiwix/ZIM offline Wikipedia linked to POI GPS coordinates — proxied through this app (`GET /kiwix/*` in app.rb) rather than a direct link to kiwix-serve — production sits behind a reverse proxy that only forwards to this app, so no address exists for a browser to reach kiwix-serve at directly; kiwix-serve runs with `--urlRootLocation=/kiwix` so its own emitted links already match. `KIWIX_URL` + `GET /api/kiwix` reachability check, same optional-integration pattern as offline.pmtiles/terrain.pmtiles; `docker-compose.yaml` now runs a `kiwix` service, ZIM not included (see docs/development.adoc for where to get one)
** [x] Replaced the old per-popup "Nearby on Wikipedia" link (one POI at a time, easy to miss) with a standalone "Wikipedia" layer under Tracks & Points — a live `GET /api/kiwix/nearby` refetch on every pan/zoom, not a saved file. kiwix-serve's own geo search never echoes back a result's coordinates, so `Maptool::Kiwix.nearby` fetches each matching article's own page too and reads its `<meta name="geo.position">` tag — verified against the real production ZIM (~1.6s for a 30-result page; tried parallelizing those fetches with threads, no measured gain, kept sequential)
@@ -154,6 +156,14 @@ plan from — the server does the heavy lifting. The UI is built for a mouse tod
append-only journal per trip (`data/trip_log/<started>.ndjson`, fsynced every 5 s, a torn
last line skipped), a restart picks the running trip up from it; the library's track built
from it every 5 min and at the end. Still to do: the pictogram, a walk from another device shown with it, visited points
** [x] The recording's days and export (the canvas' GridRecording, 2026-12-03): the Trip menu's
"Recording ▸" opens it — the running trip, else the last one: totals, the days (one log, the
days only cuts: stood ≥ 4 h, else 03:00; ✂ Cut here and Join kept as journal lines), ⌕ a day
on the map; Export the days ticked, a piece between draggable A–B markers or the whole trip as
one GPX (a track per day, times per point) or a .zip of a file per day, with the stops near
the line, the planned route, the stands (`lib/maptool/trip_days.rb`,
`/api/trip/log/days`, `/api/trip/log/export`). Not yet: renaming the trip there, the days
named by place (no reverse geocoding offline), moving a cut by hand
** [x] Colors: planned vs really driven — the planned route (magenta ahead, the part behind
thin and dashed) and the recorded track solid on top (`--route-driven`), docs/design.adoc
** [x] The menu while driving: showing routes and points, editing the trip — all of it on the
@@ -302,7 +312,7 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
* [x] A "follow" mode like a car navigation: camera locked to the GNSS position, rotated to the
heading, pitched ~60°, smooth easing — the tracker's "Navigate" (see the Tablet-friendly
section); follows the MQTT tracker, not the browser's own GNSS control yet
** [ ] Real 3D relief from the raster-dem terrain and Liberty's `building-3d` extrusions while navigating
** [x] Real 3D relief from the raster-dem terrain and Liberty's `building-3d` extrusions while navigating (the 3D mode has both)
* [ ] Full navigation (the car's main screen while driving; everything from our own Valhalla
tiles, no online service — Valhalla has OSM `maxspeed`, `traffic_signals` and turn lanes)
** [x] Basics on the dashboard (`public/js/dashboard.js`): the speed limit as a sign and a red
@@ -324,7 +334,7 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
route = over 30 m from its line for 3 fixes in a row (fixes with HDOP > 5 don't count), then
the route panel routes from the position to the points not reached yet (via points passed
by km along the route, `legs_km`), at most every 15 s and only moving
*** [ ] Step advance like Ferrostar's DistanceEntryExit (30 m to the step's end, 5 m past it)
*** [x] Step advance like Ferrostar's DistanceEntryExit (30 m to the step's end, 5 m past it)
instead of "the first maneuver ahead by km"; arrival at 30 m. Done: progress only forward —
the position looked for near the last one first (`locate`, 0.1 km back to 3 km ahead), so a
route along the same road twice or crossing itself doesn't jump; the step still advances 5 m
@@ -354,7 +364,7 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
browser's GNSS control), the dashboard as part of the driving-mode UI. Done: drive mode's Follow
follows the CAN GNSS; the LTE tracker (MQTT) is a tracker layer to switch on (a second car, the car
seen from home), Meshtastic the same with the nodes picked
*** [ ] Any point of a tracker layer can be the one the map follows — one at a time (picking
*** [x] Any point of a tracker layer can be the one the map follows — one at a time (picking
another one, or the car's own GNSS, takes it over); today only the MQTT tracker's card has "Navigate"
** [x] `locate()` scans the whole route each fix — a window around the last hit on long routes
** [ ] Shared trip — one itinerary per server for every screen (the cab's display, the tablet
@@ -375,6 +385,16 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
(the day ends), stay and note; day headers with km and time; another screen's change shown
where it happened with Undo. Not yet: the route coloured by day, each stop's source, the
drive mode's Trip menu by days
*** Planning (the canvas' Plan and GridToday, ideas from azedler/roadplanner), in this order:
**** [x] A stop's type (its NPS pictogram on the marker and in the list), notes on the trip,
the days (on a day's first point) and the stops; + on a leg inserts the next point there
**** [x] The place and where the car stays apart: Parking in a stop's ✎, a P marker (drag it), the route goes there, the walk ×1.25 straight
**** [x] A pasted link (Google Maps, park4night, a page with coordinates) becomes a place in the search (/api/link, logged in); + puts it on the leg it lengthens least
**** [x] Avoids for the trip (+ ferries, unpaved) or a day (the day's ✎; routed in pieces, joined). Soft preferences (camps ≤ 40 €, lakes) not yet: for the Check / search when wanted
**** [x] Check (a fold in the Route panel): no leave time, a day over 8 h driving, a night spot after sunset, a long walk from the parking, motorways without the vignette; each with ⌖. Not yet: a day's avoids vs its route, winter-closed roads, opening hours
**** [x] Costs (a fold): fuel = km × the profile's consumption × the trip's fuel price, each stop's costs / paid, the budget left. Not yet: documents / receipts per stop, prices per country
**** [x] Today in drive mode (Menu ▸ Today): the stops left with arrival, tonight, sunset, Open-Meteo weather, the day's notes and Check items, Skip next, Tomorrow ▸. Not yet: Late +30 min
**** [ ] MCP over maptool (later)
*** [ ] Brick ↔ the car: a trip planned at home on brick handed to the car's server (with
the library sync, or "send to the car")
*** [ ] Push instead of polling (SSE) if 2 s ever feels slow
@@ -397,7 +417,8 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho
trips over our Valhalla (2–8 km each, one after another) at 90 % of the road's limit, a fix
a second into the same `gnss.*` signals / GNSS_LATEST as the node's (ignored meanwhile)
*** [x] The dashboard's tilt from the terrain's slope while simulating
*** [ ] Replay a library track (GPX/FIT with times) instead, at its own speed
*** [x] Replay a library track (GPX/FIT with times) instead, at its own speed (`/sim.html`,
`GnssSim#replay`; stops longer than 30 s shortened to it)
** [x] Free look while following: moving the map by hand pauses the follow, "Back to the
position" or 15 s untouched resumes it
* [x] While following a planned route: the route ahead highlighted, distance to the next
@@ -458,7 +479,12 @@ are in home-gitops `docs/canopen-nodes.adoc` ("Inšpirácia: Garmin Tread / zūm
as a live layer with trails, short messages, "come here" into the trip
* [ ] Audio: volume / mute from the keypad and the app, navigation prompts ducking the music
* [ ] Level gauge from IMU (ESP32/RPi) — camper tilt, wheel-chock leveling calculation
* [x] Level gauge from IMU (ESP32/RPi) — camper tilt, wheel-chock leveling calculation (the canvas'
GridLevel, 2026-12-03): Terrain → "Level ▸" (in place of Road view; ✕ closes it the same): the
car from above with the cm under each wheel (lifted to the highest, never dug in), rounded to
the profile's ramp steps or exact for jacks, the bubble, roll / pitch now and after; the
profile's new wheelbase, track and ramps fields (guessed from length / width when unset).
Not yet: a pitch target (the bed's head up), only the two low wheels on ramps
* [ ] Victron/Home Assistant via MQTT or WebSocket — battery SoC, tank levels, temperatures
* [ ] Plot GPS track with historical battery/speed data