mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 05:21:15 +00:00
feat(tours): plan rides on horseback from signposted horse routes
A tour can now be a ride (HOR-01). The planner offers "Horse ride" as a tour type with its own horseshoe, and a Horse routes card beside the waypoints looks, when asked, for the route=horse relations OpenStreetMap knows in the map view. A route opens in a dialog that shows it on a map in the sections it is made of, split at forks, gaps and crossings, so nothing is ever joined across a gap. The rider picks a section and its direction, sees what the horse=* tags along it say (open, limited, closed, or unknown where untagged) and whether it is signposted the other way, and takes it as one undoable step. A section that does not start where the ride ends is only joined by a straight manual stretch once the rider switched that on. Nothing of a ride is routed: every leg follows a section or is drawn by hand, and the waypoint list and the map say which (a section as a solid line with its route, a manual stretch dashed and marked unchecked). A point at a section stays where the route has it, a ride works out no riding time, and distance, heights, day assignment, GPX import and export, the 3D view and the reversed ride keep working with each leg's origin saved and opened again. A failed lookup leaves the ride and the routes already found as they were. The server reads the routes through the shared Overpass client (GET /api/trips/:tripId/tours/horse-routes, Tours addon, trip access), keeps an answer twelve hours per grid-aligned view, and the tour contract refuses a routed leg, a via ferrata or a riding time on a ride and a horse route section on any other type. A migration enables the horse tour type.
This commit is contained in:
@@ -146,8 +146,8 @@ export const FERRATA_TILE_PAYLOAD: JsonColumn<FerrataTilePayload | null> = {
|
||||
};
|
||||
|
||||
/**
|
||||
* A tour leg taken as a fixed line (a via ferrata's own line from OSM) rather
|
||||
* than routed. A row that does not decode reads as a routed leg, which the
|
||||
* A tour leg taken as a fixed line (a via ferrata's own line from OSM, a
|
||||
* section of a horse route, a stretch drawn by hand) rather than routed. A row that does not decode reads as a routed leg, which the
|
||||
* editor then plans again.
|
||||
*/
|
||||
export const TOUR_WAYPOINT_FIXED_LEG: JsonColumn<TourFixedLeg | null> = {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
/**
|
||||
* HOR-01: a tour can be a ride on horseback. `horse` is a key of its own in
|
||||
* `tour_types`, enabled, with no routing profile: a ride is never routed, it
|
||||
* is made of sections of signposted horse routes and stretches the rider
|
||||
* draws by hand. Those live in `tour_waypoints.fixed_leg` like every other
|
||||
* fixed leg, so no column is added and no existing tour changes its meaning.
|
||||
* An instance that already defined the key keeps its own row.
|
||||
*/
|
||||
export class Migration20200101045600_a_tour_can_be_ridden_on_horseback extends Migration {
|
||||
override name = 'Migration20200101045600_a_tour_can_be_ridden_on_horseback';
|
||||
|
||||
override up(): void {
|
||||
this.addSql(`
|
||||
INSERT INTO tour_types (key, label_key, icon, color, routing_profile, is_sport, enabled, sort_order)
|
||||
VALUES ('horse', 'tourTypes.horse', 'Horseshoe', '#a16207', NULL, 1, 1, 7)
|
||||
ON CONFLICT (key) DO NOTHING
|
||||
`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user