A single-file web page for planning long motorcycle rides. You give it a start, a finish and any vias. It works out the route, picks rest, fuel and meal stops roughly every 100 km in towns that actually have services, and builds a live trip sheet:
- arrival and departure times in each stop's own time zone, including daylight saving
- planned fuel stops
- sunrise and sunset, with after-dark and dusk warnings
- forecast weather for each arrival
- totals for each riding day
Every change you make on the sheet updates everything below it straight away. The sheet can be copied into Google Sheets or Excel, or downloaded as CSV.
The planner comes as two files:
index.html: the planner itself. Everything it needs is in this one file.README.html: this guide.
Getting started
- Unzip both files into the same folder, anywhere on your computer. Keep them together.
- Open
index.htmldirectly in Chrome or Edge: double-click it, or drag it into a browser window. - On the very first open, it plans the example trip so you can see how it works: Melbourne → Mildura → Adelaide → Mount Gambier → Melbourne, with overnights at Mildura (leaving 06:00) and Mount Gambier (leaving 07:00).
- The How it works (README) link in the green header, and the one in the footer, open this guide in a new tab. That's why the two files need to be in the same folder.
Don't open it inside another app's file preview pane. Preview panes block internet lookups, and the page will say so.
You need an internet connection. There are no accounts, keys or installs.
The Trip panel
| Setting | What it does |
|---|---|
| Start / Finish | Town, suburb or address. Add the state to avoid mix-ups, e.g. Burnside SA (there is also a Burnside in Victoria). You can also type a latitude and longitude, e.g. -37.70, 145.10. The green text underneath shows what it was matched to. |
| Via (one per line) | Places the route must pass through. Each via becomes a fixed stop on the sheet. Add @ HH:MM to stay overnight and leave at that local time, e.g. Mildura VIC @ 06:00. |
| Depart date / time | When you leave the start, in the start's local time. |
| Stop every (km) | Target spacing between stops (default 100). Changing it re-picks the stops along the same route. |
| Speed (% of limit) | Every leg is timed as if you ride at this percentage of the speed limit (default 95%). |
| Rest stop / Fuel stop / Meal stop | Stop lengths in minutes (defaults 5, 15 and 30). A stop with FOOD ticked gets the meal time, a planned fuel stop the fuel time, any other stop the rest time. |
| Fuel range (km) | How far you will ride between fills. Any whole number. |
| Km on tank at start | Leave at 0 if you start with a full tank. |
| Sealed roads only | Ticked (the default): the route avoids unsealed roads, using the Valhalla routing engine's motorcycle profile. Unticked: OSRM, which drives unsealed roads more slowly but will still use them when they are much shorter. Press Plan trip after changing it. |
Press Plan trip after changing the start, vias or finish. Every other setting updates the sheet as soon as you change it.
Clear trip (next to Plan trip) starts a new route. Click it twice to confirm; the second click must come within 4 seconds. It removes the current trip, including the sheet, map, edits and weather, and empties Start, Via and Finish. It keeps your riding settings and the remembered place results and fuel hours. If you might want the trip again, use Save plan first.
The trip sheet
Each row is a stop. The numbers on a row describe the leg that arrives at that stop, the same layout as the original spreadsheet.
| Column | Meaning |
|---|---|
| # | Stop number (matches the pins on the map). |
| Flags | FUEL and FOOD buttons. An amber Fuel 303 means a fill is planned here, 303 km after the previous fill. + fuel / + food means it's available but not planned; no fuel / no food means none was found in the map data. Click to change. A dot after the label means you set it by hand. |
| Stop | The town. A servo or roadhouse that isn't inside a town shows its name and where it is, e.g. Ampol, Horsham (from its address) or 7-Eleven, near Dimboola (the nearest named place, when it has no address in the map data). Stops the planner chose have a drop-down of nearby alternatives, showing how far away each one is and what it has. The grey line underneath lists the services found and how far the town is off the route. Fuel stations show their opening hours when OpenStreetMap has them, e.g. Fuel (Ampol 24 hrs, BP Mo-Su 06:00-21:00), otherwise just the brand. If every fuel station there has recorded hours and all of them are shut when you arrive, Fuel closed on arrival shows in red; if it's a planned fill, a warning also appears above the table. Many country servos have no hours recorded, so no warning doesn't guarantee they're open. |
| State | State, plus the time zone in use (e.g. ACDT). |
| Km / Total | Length of this leg, and the running total. |
| Km/h | Average speed for the leg. Hover to see the average at 100% of the limits. Type a number to override it; auto goes back. |
| Ride | Riding time for the leg (h:mm). |
| Arrive / Depart | Local times. Type a departure time to make the stop an overnight; auto goes back. Changing the departure on row 0 changes the trip's departure time. |
| Stop min | Length of the stop. Type a number to override the rest / fuel / meal length. |
| Since fuel | Km ridden since the last planned fill. Shown in red if it's over your fuel range, with a warning above the table. |
| Weather on arrival | Temperature, conditions, chance of rain, wind and gusts for the hour you arrive. Forecasts only go 16 days ahead. |
| Sun | Sunrise and sunset at that stop on the day you arrive. |
| Light | After dark if any part of the leg is ridden before sunrise or after sunset. Dusk/dawn if it starts or ends within 30 minutes of either. |
| Notes | Your own notes. They are kept with the plan and exported. |
| + stop / remove | Add a stop after this row (the planner finds the best place in the gap), or remove a stop the planner chose. |
Below the table, one day card per riding day shows the distance, riding time, stop time, leave and arrive times, total time on the road, and any dark or dusk legs. The green header shows the totals for the whole trip.
On the map
- The route is the green line.
- Numbered pins are the stops; square pins are your start, vias and finish.
- Small dots are other places with services that were found. Amber dots have fuel; click one to Add as stop.
- Use the switch at the top right to change between Roads, Topographic and Satellite.
Buttons
- Refresh weather: fetch the latest forecasts.
- Copy for Sheets: copy the sheet, then paste it into Google Sheets or Excel.
- Download CSV: the sheet as a CSV file. The first 10 columns are in the original spreadsheet's order (Flag, Location, Km, Speed, Stop, Hours, Arrive, Depart, State, Notes), followed by Total km, Since fuel, weather, sunrise, sunset, light, the fuel stations' opening hours, and whether fuel is open when you arrive.
- Save plan / Open plan: save the whole plan, including your edits, to a
.jsonfile, and open it again later.
How it works
Route
With Sealed roads only ticked, the route comes from the public Valhalla server (the routing engine on the OpenStreetMap website), using its motorcycle profile set to avoid unsealed roads and tracks. An unsealed road is only used right at the start or finish, for example a gravel driveway.
This relies on roads being marked as sealed or unsealed in OpenStreetMap. Most main roads are. Some remote roads have no surface recorded, and Valhalla then judges by the type of road, so an occasional unsealed road may still slip through. Check remote sections on the Satellite map.
The public Valhalla server won't take a single request covering more than 1,500 km, so the planner asks for the route one leg at a time (start to first via, via to via, and so on). A leg longer than that is split into pieces of about 1,000 km along the highway, then joined back into one leg, so the split points never show as stops.
If Valhalla can't be reached or can't find a sealed route, the planner uses OSRM instead and says so in red. OSRM's public server has no option to avoid unsealed roads; it only drives them more slowly.
With the box unticked, OSRM is always used.
Choosing stops
The planner picks stops one at a time, searching as it goes:
- Jump the stop spacing (e.g. 100 km) along the route from the last stop.
- Search 25 km either side of that point for towns and roadhouses with fuel, food or a store.
- If there's nothing, widen the search step by step. This handles long empty stretches in the outback.
- Score each place and pick the best. Places closer to the target distance score better. Bigger towns, places with food, and places with fuel when the tank is getting low get a bonus. Places that would leave you short of fuel are avoided. Before an overnight that has no fuel, the last stop is pulled towards a place with fuel as close to the overnight as possible.
- Repeat from the chosen stop until the next via or the finish is within about 1.3 × the spacing.
Localities that exist in name only (no fuel, food or shop in OpenStreetMap) are never chosen.
Fuel stops
Fuel stops are planned by these rules, in order of priority:
- Never ride further than your fuel range between fills, where the map has fuel that makes this possible.
- Fill at the end of each day, at the overnight stop or the closest stop with fuel before it, so you start the next morning full.
- Use as few fills as possible.
- Spread the fills as evenly as possible across the day. For example, a 1,000 km day on a 300 km range gives 4 fills at about 200 / 400 / 700 / 1,000 km rather than 300 / 600 / 900 / 999.
Anything you tick or untick by hand is kept, and the rest is planned around it.
A stop counts as an overnight if it has a set departure time or a stop of 5 hours or more.
Speeds and times
Each leg is timed at Speed (% of limit) of the speed limits along it. On a sealed-roads route, Valhalla's own road speeds are used as the limits, since it bases them on the signed limits. With OSRM, the limits are estimated from OSRM's own road speeds, because its public server doesn't supply them. OSRM times roads at 80% of their mapped limit, so the planner divides by 0.8 to get the limit back.
This is accurate for roads whose limit is recorded in OpenStreetMap, which covers most highways. It reads low on roads with no limit recorded. If a leg looks wrong, type a speed into its Km/h cell.
Times are calculated in each stop's own time zone, from Open-Meteo, so crossing into SA or QLD and daylight saving changes are handled. Until the weather service answers, a rough built-in guess is used.
Sunrise and sunset
These are calculated on your computer using the standard (NOAA) sunrise equation, accurate to about a minute. No internet is needed for this.
Weather
Forecasts come from Open-Meteo: the hourly forecast nearest each arrival time, up to 16 days ahead. They are refreshed when older than 3 hours, when stops change, or when you press Refresh weather.
Data sources
| Service | Used for |
|---|---|
| Valhalla (FOSSGIS public server) | Route and travel times with Sealed roads only ticked |
| OSRM demo server | Route and travel times otherwise, or if Valhalla fails |
| Photon | Finding your start, vias and finish; main search for towns, fuel and food |
| Nominatim | Fuel station opening hours (looked up by map id after the stops are chosen); backup for finding places |
| Overpass | Backup for fuel station opening hours, and backup search for towns, fuel and food |
| Open-Meteo | Forecasts and time zones |
| Esri | Map pictures |
All place and road data is from OpenStreetMap and its contributors. These are free, shared services, so the planner spaces out its requests. If one is busy, it waits and retries, and the status line counts down. If both place searches fail, the stops found so far are kept, and pressing Plan trip again a few minutes later carries on from where it stopped.
What is saved on your computer
Three things are kept in the browser's storage on this computer only:
- Your last plan (form, settings, route, stops, edits and weather). It is saved after every change and reopened automatically next time.
- Place search results, kept for 30 days. Re-planning the same trip, or another trip over the same country, needs few or no searches.
- Fuel station opening hours already looked up, also kept for 30 days.
Clear trip removes only your last plan. The place results and fuel hours stay, so a new route over country you've already searched is still quick.
Chrome and Edge treat every page opened from a file as the same site for storage. So a new version of index.html picks up the plan left by the previous version, wherever you saved it. Press Plan trip to re-plan it with the new version's rules.
Use Save plan to keep a trip permanently or move it to another computer.
Troubleshooting
| Message or problem | Cause and fix |
|---|---|
| "…shown inside another app…" | The file is open in an app's preview. Save it and open it directly in Chrome or Edge. |
| "…could not be reached…" | No internet, or an ad blocker or firewall is blocking that service. |
| "Place search is busy, trying again in N s…" | Photon is busy. It retries on its own. |
| "Place search failed…" | Photon and the Overpass backup both failed. Stops found so far are kept; press Plan trip again in a few minutes. |
| "Could not find …" | Add the state, e.g. Keith SA, or type latitude and longitude. |
| "No route found" | The routing service couldn't route between those places. Check the green "matched to" text under each box. |
| "A sealed-roads-only route could not be made…" | Valhalla couldn't be reached or found no sealed route, so OSRM was used and the route may include unsealed roads. Try Plan trip again later, or check remote sections on the Satellite map. |
| "Fuel station opening hours could not be loaded…" | Both hours services failed. The trip is otherwise fine; press Refresh weather to try again. |
| "Opening hours recorded for 0 of N fuel stations…" | The lookup worked, but those servos have no hours in OpenStreetMap. |
| "Beyond forecast range" | The arrival is more than 16 days away. |
| A leg speed looks wrong | Type the right speed into its Km/h cell. If they're all a bit high or low, adjust Speed (% of limit). |
| Map shows "Access blocked" or "API key required" | A map provider refused. The page uses Esri maps; try the Topographic or Satellite switch. |
For anyone editing the code
index.html has three parts, all commented in detail:
- Page layout and styles (HTML and CSS). Colours are named settings at the top of the styles, with light and dark versions.
Core: all calculations, with no screen and no internet. This covers the route model, possible stops, stop scoring, fuel planning, time zones, sunrise and sunset, and the sheet and day totals. It can be tested on its own in Node.js.- The page script: the Trip form, online lookups, stop picking, map, sheet drawing, editing, export and saving.
All the code is in index.html. It was developed as separate files (template.html, core.js, app.js) and combined into it.
Two functions in Core, chooseStops and samplePoints, are no longer used by the page; they are kept because the tests use them.