diff --git a/wiki/Admin-Panel-Overview.md b/wiki/Admin-Panel-Overview.md index fa67b6f84..b68798eca 100644 --- a/wiki/Admin-Panel-Overview.md +++ b/wiki/Admin-Panel-Overview.md @@ -52,9 +52,9 @@ The **Week starts on** default decides which day opens each row of every date pi ### Routing services -On desktop and mobile, **User Defaults** includes optional **Own routing engine** and **Own Valhalla instance** fields in the map section. Changes save when you leave the field; **reset** restores the built-in default. +On desktop and mobile, **User Defaults** includes the **Routing service** and optional **Own routing engine** and **Own Valhalla instance** fields in the map section. Changes save when you leave the field; **reset** restores the built-in default. -With both fields empty, TREK uses public OSRM servers for routing and the public FOSSGIS Valhalla for avoiding toll roads, motorways and ferries. Configuring only a custom routing instance disables the public Valhalla fallback. After entering a custom server URL, restart TREK and reload the page. See [Road-Trip](Road-Trip#routing-engines). +With **Routing service** on **Automatic** and both fields empty, the Valhalla of the TREK services calculates every route, and the public OSRM servers a day it cannot answer. Without the TREK services, or with **Public Valhalla (FOSSGIS)** chosen, TREK uses public OSRM servers for routing and the public FOSSGIS Valhalla for avoiding toll roads, motorways and ferries. Configuring only a custom routing instance disables the public Valhalla fallback. After entering a custom server URL, restart TREK and reload the page. See [Admin-User-Defaults](Admin-User-Defaults#routing-service) and [Road-Trip](Road-Trip#routing-engines). > **AI / MCP:** These fields configure the routing services the planner and the road trip MCP tools use, and do not change stored trip data. diff --git a/wiki/Admin-User-Defaults.md b/wiki/Admin-User-Defaults.md index dd10318c9..478e9fc91 100644 --- a/wiki/Admin-User-Defaults.md +++ b/wiki/Admin-User-Defaults.md @@ -44,16 +44,20 @@ Used for every user who has not entered their own key, so the whole instance get ### Own routing engine -The address of an OSRM instance of your own, for example `https://osrm.example.org`. Empty uses the public servers, which allow about one request a second: enough for a day plan, tight for a road trip. +The address of an OSRM instance of your own, for example `https://osrm.example.org`. Empty uses the public servers, which allow about one request a second: enough for a day plan, tight for a road trip. With the TREK services or an own Valhalla as **Routing service**, OSRM only calculates the days Valhalla cannot answer. ### Routing service -Which Valhalla answers what OSRM cannot: driving around toll roads, motorways and ferries, and the routes, heights and ways of tours. +Which Valhalla TREK asks, and with it how much of the routing Valhalla does. - **Automatic** (nothing chosen): the TREK services, or **Own Valhalla instance** when one is set. If only **Own routing engine** is set, no Valhalla is asked. -- **TREK services**: the Valhalla at `valhalla.liketrek.com` (or `TREK_VALHALLA_URL`). This server asks it with the installation key, so the browser never talks to it and no restart is needed. Where it cannot answer (no key yet, the day's allowance spent, the service down or slow to answer, or a shared page without a sign-in), TREK asks the public FOSSGIS Valhalla instead, without a message. After such an answer it keeps asking FOSSGIS for a while: a minute after an error or a question that took longer than ten seconds, as long as the service says when the allowance is spent (an hour at most). Each user may ask 60 routing questions a minute through this server, and the whole installation 100. -- **Public Valhalla (FOSSGIS)**: `valhalla1.openstreetmap.de`, as before. -- **Own Valhalla instance**: the address below. +- **TREK services**: the Valhalla at `valhalla.liketrek.com` (or `TREK_VALHALLA_URL`), a planet with elevation data. It calculates every route: the days of the planner and the road trip on foot, by bike and by car, driving around toll roads, motorways and ferries, and the routes, heights and ways of tours. This server asks it with the installation key, so the browser never talks to it and no restart is needed. Where it cannot answer (no key yet, the day's allowance spent, the service down or slow to answer, a shared page without a sign-in, or no way for one of the day's legs), OSRM calculates that day as it did before, without a message; a day is always calculated by one engine, never one leg by each, because the two estimate travel times differently. What only Valhalla can answer (avoiding road classes, tours) goes to the public FOSSGIS Valhalla instead. After such an answer TREK leaves the service alone for a while: a minute after an error or a question that took longer than ten seconds, as long as the service says when the allowance is spent (an hour at most). Each user may ask 60 routing questions a minute through this server, and the whole installation 100. +- **Public Valhalla (FOSSGIS)**: `valhalla1.openstreetmap.de`, as before: OSRM calculates the routes, and Valhalla only answers what OSRM cannot (driving around toll roads, motorways and ferries, and tours). This is also what an installation without the TREK services gets. +- **Own Valhalla instance**: the address below. Like the TREK services it calculates every route, with OSRM taking over a day it cannot answer. + +A day longer than one request may carry is asked in pieces that share a stop: twenty stops a piece on the TREK services and an own Valhalla, ten on FOSSGIS. + +Routes the browser has kept on the device are kept per engine, so switching the routing service never shows a day calculated by the other engine. The allowance the TREK services count for routing is shown in the TREK API card under **Admin → Settings**. diff --git a/wiki/Map-Settings.md b/wiki/Map-Settings.md index 8d192a68d..e3bedfaab 100644 --- a/wiki/Map-Settings.md +++ b/wiki/Map-Settings.md @@ -165,7 +165,7 @@ The small map preview on this settings page is the exception: it stays on a fixe ## Routing engines -The routes TREK draws and the travel times between stops come from a public OSRM router, and the avoidance of toll roads, motorways and ferries from a public Valhalla server. An admin can point TREK at engines of their own with **Own routing engine** and **Own Valhalla instance**, next to the map defaults under **Admin → User Defaults**. They are not part of this tab. See [Admin-User-Defaults](Admin-User-Defaults#own-routing-engine) and [Road-Trip](Road-Trip#routing-engines). +The routes TREK draws and the travel times between stops come from the Valhalla of the TREK services, with a public OSRM router for a day it cannot answer; without the TREK services from the public OSRM router, and the avoidance of toll roads, motorways and ferries from a public Valhalla server. An admin picks the **Routing service** and can point TREK at engines of their own with **Own routing engine** and **Own Valhalla instance**, next to the map defaults under **Admin → User Defaults**. They are not part of this tab. See [Admin-User-Defaults](Admin-User-Defaults#own-routing-engine) and [Road-Trip](Road-Trip#routing-engines). ## See also diff --git a/wiki/Road-Trip.md b/wiki/Road-Trip.md index 99b7bdbbd..965c3a196 100644 --- a/wiki/Road-Trip.md +++ b/wiki/Road-Trip.md @@ -226,12 +226,14 @@ When the instance has its own OSRM but no Valhalla, the switches are unavailable ## Routing engines -Routing needs two engines, and both have public defaults, so the addon works without any setup: +Routing uses two engines, and both have public defaults, so the addon works without any setup: -| Engine | Used for | Public default | Own instance | +| Engine | Used for | Default | Own instance | |---|---|---|---| -| **OSRM** | every road route TREK draws: the road trip, the day plan, the routed booking lines | the FOSSGIS servers at `routing.openstreetmap.de` | **Own routing engine** | -| **Valhalla** | driving around toll roads, motorways and ferries, and the **No motorway**, **No tolls** and **No ferry** offers | the TREK services' Valhalla through this server, the FOSSGIS Valhalla at `valhalla1.openstreetmap.de` where it cannot answer (**Routing service**) | **Own Valhalla instance** | +| **Valhalla** | with the TREK services or an own Valhalla: every road route TREK draws (the road trip, the day plan, the routed booking lines) on foot, by bike and by car, and the other ways of a leg. With the public FOSSGIS Valhalla only driving around toll roads, motorways and ferries, and the **No motorway**, **No tolls** and **No ferry** offers | the TREK services' Valhalla through this server (**Routing service**), the FOSSGIS Valhalla at `valhalla1.openstreetmap.de` where they are off | **Own Valhalla instance** | +| **OSRM** | every day Valhalla does not calculate: all of them with the public FOSSGIS Valhalla or without a Valhalla, and a day the TREK services or an own Valhalla cannot answer | the FOSSGIS servers at `routing.openstreetmap.de` | **Own routing engine** | + +A day is always calculated by one engine, never one leg by each: the two estimate travel times differently, and a day's arrival times are added up leg by leg. When Valhalla cannot answer a day (the service down or its allowance spent, or no way for one of its legs), OSRM calculates the whole day instead, without a message, and TREK asks Valhalla again for the next day it routes once the service has rested (see [Admin-User-Defaults](Admin-User-Defaults#routing-service)). A day that avoids road classes still goes to the public FOSSGIS Valhalla in that case, since OSRM cannot avoid them. The public OSRM servers allow roughly one request a second. That is enough for a day plan and tight for a road trip, which routes every leg of every day: TREK spaces its requests and retries a refused one, but a long trip takes a while to fill in. An instance with many road trippers is better off with its own. @@ -241,15 +243,20 @@ Why a restart: routes are calculated in the browser, and the browser only talks What the combinations do: +With **Routing service** left on **Automatic**: + | Own routing engine | Own Valhalla instance | Result | |---|---|---| -| empty | empty | Public OSRM for routes, public Valhalla for avoidance. | -| set | empty | Your OSRM for routes. **The public Valhalla is not used**, because an instance that runs its own router has chosen against public hosts. The avoid switches are unavailable, and **Other ways** can still offer routes without motorways or tolls if your OSRM supports excluding them. | -| empty or set | set | Your Valhalla for avoidance. | +| empty | empty | The TREK services' Valhalla for every route, public OSRM for a day it cannot answer. Without the TREK services: public OSRM for routes, public Valhalla for avoidance. | +| set | empty | Your OSRM for routes. **No Valhalla is used**, because an instance that runs its own router has chosen against public hosts. The avoid switches are unavailable, and **Other ways** can still offer routes without motorways or tolls if your OSRM supports excluding them. | +| empty or set | set | Your Valhalla for every route, OSRM (yours where set) for a day it cannot answer. | + +Choosing **Public Valhalla (FOSSGIS)** as **Routing service** keeps OSRM for every route and Valhalla for avoidance alone, whatever else is set. Requirements for your own instances: -- **OSRM** must serve the standard layout, `
/route/v1//…`, which `osrm-routed` does out of the box. It answers every route in TREK, not only road trips. The public servers refuse to exclude road classes; an OSRM of your own built through the MLD pipeline, with a profile that has those classes, can answer **No motorway** and **No tolls** in **Other ways** by itself. +- **OSRM** must serve the standard layout, `
/route/v1//…`, which `osrm-routed` does out of the box. It answers every route in TREK that Valhalla does not, not only road trips. The public servers refuse to exclude road classes; an OSRM of your own built through the MLD pipeline, with a profile that has those classes, can answer **No motorway** and **No tolls** in **Other ways** by itself. +- **Valhalla** of your own answers every route, so it needs the `auto`, `pedestrian` and `bicycle` costings and should take twenty locations a request (`max_locations`, Valhalla's own default for `auto`); a longer day is asked in pieces of twenty that share a stop. - **Reachable from the browser.** The browser calls the engine directly, so the address has to work from the devices your travellers plan on, not only from the TREK server. `http://localhost:5000` means the traveller's own computer to a browser. When TREK is served over HTTPS, the engine has to be HTTPS too, or the browser blocks it as mixed content. - **Reachable from the TREK server** for the [MCP tools](#mcp-tools), which calculate on the server. An address on your local network is accepted there without `ALLOW_INTERNAL_NETWORK`, because only an admin can set it. @@ -392,8 +399,9 @@ What TREK contacts, and from where: | Service | Asked by | When | To change it | |---|---|---|---| -| OSRM (`routing.openstreetmap.de` by default) | the browser, and the TREK server for MCP | every route | **Own routing engine** | -| Valhalla (`valhalla1.openstreetmap.de` by default) | the browser, and the TREK server for MCP | only when avoiding road classes or offering **No motorway**, **No tolls**, **No ferry** | **Own Valhalla instance**, or not at all once only **Own routing engine** is set | +| TREK services' Valhalla (`valhalla.liketrek.com` by default) | the TREK server, for the browser and for MCP | every route | **Routing service**, or `TREK_VALHALLA_URL` | +| OSRM (`routing.openstreetmap.de` by default) | the browser, and the TREK server for MCP | every route Valhalla does not calculate | **Own routing engine** | +| Valhalla (`valhalla1.openstreetmap.de`) | the browser, and the TREK server for MCP | with **Public Valhalla (FOSSGIS)**, or where the TREK services cannot answer: only when avoiding road classes or offering **No motorway**, **No tolls**, **No ferry** | **Own Valhalla instance**, or not at all once only **Own routing engine** is set | | TREK's place index and OpenStreetMap | the TREK server | the search along the route (OpenStreetMap through Overpass), and the place lookups of **Add manually** and the Google import (the usual place search) | see [TREK-Places-API](TREK-Places-API) and [Places-and-Search](Places-and-Search), and `OVERPASS_URL` and `NOMINATIM_URL` in [Environment-Variables](Environment-Variables) | | MobiData BW OCPDB | the TREK server | when a charging stop's data is shown | | | DWD and GDACS | the TREK server | only with **Show hazard areas** on | switch it off | diff --git a/wiki/Route-Optimization.md b/wiki/Route-Optimization.md index 5d808c667..e5311f0e6 100644 --- a/wiki/Route-Optimization.md +++ b/wiki/Route-Optimization.md @@ -20,9 +20,9 @@ Time that plugins add to the day, such as a charging stop, shows under the bar a ## Route calculation -TREK uses **OSRM** (Open Source Routing Machine) to calculate routes between consecutive places in the selected day. No API key is required. By default that is the public FOSSGIS OSRM, which allows about one request a second. An admin can point TREK at an OSRM of their own under **Admin → User Defaults** (**Own routing engine**, restart required); see [Road-Trip](Road-Trip#routing-engines). +TREK calculates the routes between consecutive places in the selected day with **Valhalla** where the instance uses the TREK services or a Valhalla of its own, and with **OSRM** (Open Source Routing Machine) otherwise. No API key is required. With the TREK services, which is the default, this server asks their Valhalla; a day it cannot answer is calculated by OSRM instead, whole, without a message. Without them it is the public FOSSGIS OSRM, which allows about one request a second. An admin chooses under **Admin → User Defaults** (**Routing service**, **Own routing engine**, **Own Valhalla instance**); see [Admin-User-Defaults](Admin-User-Defaults#routing-service) and [Road-Trip](Road-Trip#routing-engines). -The travel mode in the route bar offers **Driving**, **Walking** and **Cycling**, each routed on the matching OSRM network (on the public servers `routed-car`, `routed-foot` and `routed-bike`; an own OSRM is asked under the profiles `driving`, `foot` and `bike`). Installed plugins can add further profiles: a plugin with the `routeProvider` hook, for example an e-mobility plugin that plans charging stops, appears as an extra mode next to the built-in ones. When such a profile is selected, that plugin computes the day's route: its geometry is drawn on the map, planned stops such as chargers appear as small dots on the line, and the connectors between the stops show the plugin's travel times plus any note it attaches ("25 min charge"). If the plugin fails or times out, TREK falls back to straight lines exactly as it does on an OSRM outage. +The travel mode in the route bar offers **Driving**, **Walking** and **Cycling**. Valhalla routes them with its `auto`, `pedestrian` and `bicycle` costings; OSRM on the matching network (on the public servers `routed-car`, `routed-foot` and `routed-bike`; an own OSRM is asked under the profiles `driving`, `foot` and `bike`). Installed plugins can add further profiles: a plugin with the `routeProvider` hook, for example an e-mobility plugin that plans charging stops, appears as an extra mode next to the built-in ones. When such a profile is selected, that plugin computes the day's route: its geometry is drawn on the map, planned stops such as chargers appear as small dots on the line, and the connectors between the stops show the plugin's travel times plus any note it attaches ("25 min charge"). If the plugin fails or times out, TREK falls back to straight lines exactly as it does when no router answers. The mode you pick is the **day's** default. It is stored on the day, so each day of a trip can differ and the choice survives a reload. @@ -74,6 +74,6 @@ Both buttons are on the phone as well, in the day sheet. For a trip that is one long drive, the [Road-Trip](Road-Trip) addon adds a **Road trip** view beside **Days**: the whole trip as one chain of legs with arrival times, daily travel times, driving limits, search along the route, via points and avoidance of toll roads, motorways and ferries. -Avoiding toll roads, motorways and ferries is done by a Valhalla server and is documented under [Road-Trip](Road-Trip#routing-engines), together with the routing engines. +Avoiding toll roads, motorways and ferries is always done by a Valhalla server and is documented under [Road-Trip](Road-Trip#routing-engines), together with the routing engines. **See also:** [Day-Plans-and-Notes](Day-Plans-and-Notes), [Map-Features](Map-Features), [Display-Settings](Display-Settings), [Road-Trip](Road-Trip)