A single-file web page for planning repatriation runs from the coroner (46 Moore St, Southbank) to country funeral directors, finishing at Notting Hill. Start and Finish are filled in for you; you give it the towns you're delivering to. It works out the route, picks rest, fuel and meal stops roughly every 200 km in towns that actually have services, and builds a live trip sheet:
- a drop-down of the funeral directors in each destination town, from your own list (add them one at a time, or import a spreadsheet). Pick one and the route goes to its door.
- fuel stops only at stations that take the Shell Card, and every Shell Card station along the route highlighted on the map
- 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 driving 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 an example run so you can see how it works: the coroner → Horsham → Notting Hill, leaving 08:00 tomorrow.
- Add your funeral directors with Funeral directors list in the Trip panel (one at a time, or import a CSV list). Then choose the one under Horsham in the trip sheet, and the trip is planned again to that address.
- 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 Repat Planner keeps its saved plan and remembered results separately from the Bike Trip Planner, so the two can be used on the same computer without affecting each other.
The Trip panel
| Setting | What it does |
|---|---|
| Start / Finish | Start is Coroner and Finish is Notting Hill unless you change them. Coroner (anything containing "coroner", "coronial", "VIFM" or "46 Moore") means 46 Moore St, Southbank; Notting Hill means Notting Hill VIC. Both are looked up on the map when you plan, and the green text underneath shows exactly what was matched, so check it. Neither gets a funeral director drop-down. Otherwise: a town, suburb or address. Add the state to avoid mix-ups, e.g. Burnside SA. You can also type a latitude and longitude, e.g. -37.70, 145.10, for example if the van leaves from a different gate. The green text underneath shows what it was matched to. |
| Via (one per line) | The towns you're delivering to, in order. Each becomes a fixed stop with its own funeral director drop-down. If the finish isn't the coroner (a one-way run), it gets a drop-down too. 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. Defaults to 08:00 tomorrow. |
| Stop every (km) | Target spacing between stops (default 200, about a break every two hours). Changing it re-picks the stops along the same route. |
| Speed (% of limit) | Every leg is timed as if you drive at this percentage of the speed limit (default 95%). |
| Rest stop / Fuel stop / Meal stop | Stop lengths in minutes (defaults 15, 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 drive between fills (default 600). Any whole number. |
| Km on tank at start | Leave at 0 if you start with a full tank. |
| Shell Card stations within (km of route) | How far either side of the route Shell Card stations are shown on the map (default 3, up to 10). Changing it redraws the pins straight away. |
| Sealed roads only | Ticked (the default): the route avoids unsealed roads, using the Valhalla routing engine's car 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 run. Click it twice to confirm; the second click must come within 4 seconds. It removes the current trip, including the sheet, map, edits, weather and the funeral directors you chose, empties Via, and puts Start and Finish back to Coroner and Notting Hill. It keeps your settings, your funeral director list, and the remembered place results, fuel hours and fuel brands. If you might want the trip again, use Save plan first.
Funeral directors
Funeral directors come only from your own list. Nothing is taken from the map data: only funeral directors you've added are shown on the map or offered in the drop-downs.
Your list
- Open it with Funeral directors list in the Trip panel, or + add funeral director under a destination town in the trip sheet (the town is filled in for you).
- Add one: enter the name, street address, town and phone, press Find on map, check the green "Found:" line is the right place, then Save. If the address isn't found, or lands in the wrong spot, paste the latitude and longitude instead: in Google Maps, right-click the building and click the numbers at the top of the menu to copy them, e.g.
-36.7180, 142.2010. - Edit or delete from the list underneath. Changing the street or town clears the old map position, and Save finds the new one. If you edit a funeral director chosen for the current trip, the trip is re-routed to the new spot.
- Import list… loads a whole list from a CSV file (in Excel: File → Save As → CSV). The first row should name the columns:
Name,Street address,Town,Phone, and optionallyLatitudeandLongitude. A singleAddresscolumn like40 Baillie Street, Horsham VIC 3400also works. An entry with the same name and town as one already in your list updates it; the rest are added. Each address is then found on the map, one at a time. Any that can't be found show Not located: edit them to fix the address or paste coordinates. Until then they show in the drop-down but can't be chosen. - Export list saves the list as
funeral-directors.csv, which opens in Excel and can be imported again.
Where the list is kept. On the Cloudflare Pages site set up as below, the list is shared: it's stored on the server, everyone using the site sees the same list on any device, and changes need the passphrase (asked for once, then remembered in that browser; Forget passphrase in the window removes it). Opened from a file instead, the list is kept in that browser only: clearing the browser's site data removes it, and another computer won't have it. Either way, Export list now and then makes a backup.
If you'd added funeral directors in a browser before the shared list was set up, the window offers Copy this browser's own list into the shared list.
If the shared list can't be reached, the last copy seen in that browser is shown and can still be used for trips, but it can't be changed until the server is back.
Choosing one for a trip
- Under each destination town in the trip sheet, a drop-down lists your funeral directors whose town matches, or that are within 10 km of the town centre, nearest first, with address and distance.
- Choosing one plans the trip again, routed to that funeral director instead of the town centre. The stop is renamed (e.g. "Wimmera Funerals, Horsham"), and its address and phone show in the grey line underneath and in the CSV. Choose Town centre to go back. Planning again also resets that run's edits on the sheet, so choose the funeral directors before editing.
- They also show on the map as purple FD squares. Click one and press Deliver here to choose it. The chosen one is drawn larger.
- Until a funeral director is chosen for a town, a red note above the sheet says the route ends at the town centre.
Your choices for a trip are kept with the plan and in a saved plan file, but not after Clear trip, so a new trip never starts with a funeral director chosen for an earlier one. If you delete a funeral director that's chosen for the current trip, it disappears from the drop-down and a red note says the route still goes there: choose another, or press Plan trip to go to the town centre. Always confirm the delivery address against the paperwork.
Shell Card stations
After a trip is planned, the planner finds every fuel station within 10 km of the whole route, then highlights the ones that take the Shell Card:
| On the map | Brands |
|---|---|
| Yellow SC pin, red edge | Shell; Reddy Express (formerly Coles Express, now run by Viva Energy); OTR (On The Run). These take the Shell Card. |
| White SC pin, dashed edge | Liberty, Westside and Mogas. Only participating sites take the card, so check before filling. |
Only stations within the Shell Card stations within setting are shown. Click a pin for its name, brand, opening hours (when known), how far along and off the route it is, and an Add as stop button (one for each time the route passes it, e.g. on the way out and the way back).
Fuel stops are only ever planned at stations that take the Shell Card (the yellow-pin brands: Shell, Reddy Express / Coles Express, OTR). Other servos, including Liberty, Westside and Mogas, can still be rest stops, but the sheet doesn't count them as fuel. On the trip sheet, a stop with a Shell Card station shows Shell Card fuel (OTR 24 hrs) in the grey line, and the FUEL button offers a fill there; a stop without one shows no fuel. If no Shell Card station is within your fuel range, the sheet says so in red. You can still click no fuel to plan a fill there by hand. The green header shows how many Shell Card stations are within the map setting, and the CSV has a Shell Card column.
How a station's brand is known: its brand in OpenStreetMap, looked up for every station found along the route; otherwise its name (most are named after their brand, e.g. "Shell Ararat"). Matching is by whole word, so "Shellharbour" is not taken for Shell. A station with neither a brand nor a brand-like name recorded won't be highlighted or used for fuel, even if it does take the card; use Add as stop and click its FUEL button if you know it does. In the busiest parts of Melbourne, stations more than about 2 km from the route may be missed.
The list of brands comes from Shell and the trucking press (Shell: What's a fuel card; Big Rigs, 11 Nov 2024). Networks change, so check Shell's own station locator if in doubt.
The search runs when you press Plan trip, before the stops are chosen, so planning takes a little longer than before. If it fails, stops are still chosen, judging stations by their names only, and the status line says so.
The trip sheet
Each row is a stop. The numbers on a row describe the leg that arrives at that stop.
| 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. Destination towns have the funeral director drop-down. A servo or roadhouse that isn't inside a town shows its name and where it is, e.g. Ampol, Horsham or 7-Eleven, near Dimboola. 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 funeral director's address (once chosen), the services found (Shell Card fuel only counts stations that take the card; other servos show as Store), and how far the town is off the route. Shell Card stations show their opening hours when OpenStreetMap has them, otherwise just the brand. If every Shell Card 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. AEDT). |
| 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. |
| Drive | Driving 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, e.g. for the time a delivery takes. |
| Since fuel | Km driven 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 arriving at this stop is driven before sunrise or after sunset. Dusk/dawn if it starts or ends within 30 minutes of either (kangaroo hour). On the start row, and on the leave line of an overnight stop, it shows Leave in dark or Leave at dawn/dusk instead. |
| 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. |
Overnight stops
A stop of 5 hours or more is an overnight and takes two shaded lines: the arrival line (with an Overnight · 11 h 34 min stay label, that evening's sunset and the weather on arrival) and the leave line (the departure time, the next morning's sunrise, the forecast for leaving, and Leave in dark or Leave at dawn/dusk if it applies). A green line under the pair marks the end of the driving day.
Below the table, one day card per driving day shows the distance, driving 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.
- Yellow SC pins are Shell Card stations; white dashed ones are check-first brands.
- Purple FD squares are the funeral directors in your destination towns.
- 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, and to hide the Shell Card or funeral director pins.
Buttons
- Refresh weather: fetch the latest forecasts. It also retries fuel opening hours and the Shell Card search if either failed.
- Copy for Sheets: copy the sheet, then paste it into Google Sheets or Excel.
- Download CSV: the sheet as a CSV file, named after the first destination (e.g.
repat_2026-10-06_Horsham_VIC.csv). The columns are Flag, Location, Km, Speed, Stop, Hours, Arrive, Depart, State, Notes, then Total km, Since fuel, weather, sunrise, sunset, light, the fuel stations' opening hours, whether fuel is open when you arrive, the length of an overnight stay, the light when you leave, Shell Card, Funeral director address and Funeral director phone. - Save plan / Open plan: save the whole plan, including your edits and chosen funeral directors, 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 car profile set to avoid unsealed roads. 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; 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, splitting any leg longer than that.
If Valhalla can't be reached or can't find a sealed route, the planner uses OSRM instead and says so in red. With the box unticked, OSRM is always used.
Choosing stops
- Jump the stop spacing (e.g. 200 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.
- 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.
- Repeat from the chosen stop until the next via or the finish is within about 1.3 × the spacing.
Fuel stops
Fills are only planned at stations that take the Shell Card. "Fuel" in the rules below means a Shell Card station.
- Never drive 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.
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: Valhalla's own road speeds on a sealed-roads route, or limits estimated from OSRM's road speeds otherwise. 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.
Sunrise, sunset and weather
Sunrise and sunset are calculated on your computer (the standard NOAA sunrise equation, accurate to about a minute). Forecasts come from Open-Meteo, up to 16 days ahead, 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; finding the addresses of the funeral directors in your list; towns, fuel and food along the route; every fuel station along the route |
| Nominatim | Fuel station opening hours and brands (looked up by map id); backup for finding places |
| Overpass | Backup for the town, fuel and food search and the fuel station search, and for hours and brands |
| 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
These are kept in the browser's storage on this computer only, under names starting repatPlanner.:
- Your last plan (form, settings, chosen funeral directors, route, stops, edits, weather and Shell Card stations). It is saved after every change and reopened automatically next time.
- Place search results, including the fuel stations found along routes, kept for 30 days.
- Fuel station opening hours and fuel brands already looked up, kept for 30 days.
- Your funeral director list (opened from a file), kept until you delete entries. Back it up with Export list. On the Cloudflare site, the list is on the server instead; the browser keeps only a copy for when the server can't be reached, and the passphrase once given.
Clear trip removes only your last plan. 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. |
| "No funeral director chosen for …" | Choose one in the drop-down under that town in the Stop column, or ignore it if delivering to the town centre is right. |
| "No funeral directors listed for …" | None in your list for that town. Use "+ add funeral director" under the town. Check its Town is spelled the same as the via, or that it's within 10 km. |
| A funeral director shows "not located" and can't be chosen | Its address wasn't found on the map. Open Funeral directors list, edit it, and fix the address or paste latitude and longitude. |
| Your funeral director list is empty | Opened from a file: the browser's site data was cleared, or this is a different browser or computer. Import your last exported funeral-directors.csv. On the Cloudflare site: check you're using the main …pages.dev address, not a preview address. |
| "Not saved: wrong passphrase" | The passphrase doesn't match the EDIT_KEY secret in Cloudflare. It's asked for again at the next change. |
| "Not saved: the server said … not set up" | The FD_KV binding or EDIT_KEY secret is missing, or the site wasn't redeployed after adding them. See Hosting on Cloudflare Pages. |
| "The shared funeral director list could not be reached…" | The server or the internet connection is down. The last copy is shown, read-only. Reload when it's back. |
| "Shell Card stations could not be found…" | The fuel station search failed. Press Refresh weather to try again. |
| "Brands could not be looked up…" | Stations are being judged by name only, so a few may be missed. Press Refresh weather later to try again. |
| "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. |
| "Beyond forecast range" | The arrival is more than 16 days away. |
| Map shows "Access blocked" or "API key required" | A map provider refused. Try the Topographic or Satellite switch. |
Hosting on Cloudflare Pages (shared funeral director list)
The planner works opened straight from a file, but hosted on Cloudflare Pages it can keep one shared funeral director list for everyone. The files are laid out like this, in a GitHub repository:
| File | What it is |
|---|---|
public/index.html |
The planner |
public/README.html |
This guide |
functions/api/funeral-directors.js |
The small server program that stores and returns the shared list, at /api/funeral-directors |
Cloudflare's drag-and-drop upload can't deploy the functions folder, so the site is deployed from GitHub (or with Cloudflare's Wrangler tool).
Set it up once
- Create the storage. In the Cloudflare dashboard, go to Storage & Databases → KV and create a namespace, e.g.
repat-funeral-directors. - Create the site. Go to Workers & Pages → Create, choose Pages and import your GitHub repository, then set: Framework preset None, Build command blank, Build output directory
public. Save and deploy. - Connect the storage. In the Pages project: Settings → Bindings → Add → KV namespace. Variable name
FD_KV(exactly), and choose the namespace from step 1. - Set the passphrase. Settings → Variables and Secrets → Add: name
EDIT_KEY(exactly), type Secret, value your passphrase. Use something long that others won't guess; anyone with the passphrase can change the list. - Redeploy (Deployments → the latest one → Retry deployment, or push any change). The binding and secret only take effect after a redeploy.
- Open the site, open Funeral directors list, and check the window says "Shared list, kept on the server". Then add one or import your CSV; the passphrase is asked for at the first change.
Anyone who has the site's address can see the list and plan trips; only people with the passphrase can change it. To keep the whole site private, turn on Cloudflare Access for the Pages project (in the project's settings), so only listed email addresses can open it.
Use the site's main address (yourproject.pages.dev). Preview builds get their own addresses, which share the server list but keep their own saved trips and passphrase.
Cloudflare's free plan covers this comfortably: each change to the list is one write (importing saves every 10 addresses found), within the free allowance of 1,000 writes a day. A change can take up to about a minute to show on a device in another part of the world.
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: the route model, possible stops, stop scoring, fuel planning, time zones, sunrise and sunset, the sheet and day totals, and the Shell Card brand rules (shellCardStatus). It can be tested on its own in Node.js.- The page script: the Trip form, online lookups, funeral directors, Shell Card stations, stop picking, map, sheet drawing, editing, export and saving.
The shared funeral director list is served by functions/api/funeral-directors.js (Cloudflare Pages Function, stored in KV under the key funeral-directors); its comments describe the requests. The page looks for it on start-up and falls back to the browser's own list without it.
The Shell Card brand lists are SHELL_CARD_YES and SHELL_CARD_CHECK in Core. The coroner's location is in PRESETS in the page script. The funeral director radius is FD_RADIUS_KM (10 km). A list of funeral directors can be built into the file in BUILTIN_FDS: each is copied into the user's list the first time the page opens.
Adapted from the Bike Trip Planner: the calculations are unchanged apart from the car routing profile, the defaults and the additions above.