Long Earth SocietyLong Earth Society

Misc · Tool · Oct 2026 · free

Halftank.

How far can you drive on what's left? Type in the miles your gauge shows, gas or electric, and Halftank draws them as a circle around you. Everything inside is still in reach. The circle follows you and shrinks a mile for every mile you drive, so a glance mid-trip shows every place you could still turn off and go.

Open Halftank → How it works

RANGE15 mi leftTrailheadLakeWorkMILE 0 · CIRCLE 15 MIRANGE10 mi leftTrailheadLake ✕WorkMILE 5 · CIRCLE 10 MIRANGE5 mi leftTrailhead ✕Lake ✕WorkMILE 10 · CIRCLE 5 MI
Three moments on one drive (illustration). The circle starts at 15 miles and loses a mile for every mile driven. Places turn grey when they fall outside it.
Works with
Gas or EV
Runs in
Your browser
Your location
Stays on your phone
Cost
Free

Why a circle

Range anxiety isn't about the number. Every car already tells you "42 miles left". What it doesn't tell you is where 42 miles gets you: the lake, the next town, the charger on the far side of the valley. You do that math in your head, usually while driving.

Halftank does it on the map. It's deliberately a plain circle, all 360 degrees, even across a canal or a desert with no road. A circle is honest about what it is: straight-line distance, so the drive is always a bit longer than the circle says. In return it's instant, works anywhere, and needs no downloads, accounts or route planning. Turn on There & back and a second circle at half your range shows everywhere you can reach and still return from.

How to use it

  1. Read the gauge. Enter the miles your car says are left.
  2. Press Start. Your phone's GPS puts you on the map with your circle around you.
  3. Drive. The circle follows you and shrinks with every mile. Parked GPS drift and sudden jumps don't count.
  4. Tap anywhere. See how far that spot is, and whether you'd make it or how many miles short you'd be.
  5. Filled up or charged? Enter the new number and press Update range.

Mount the phone or hand it to a passenger; don't work it while driving. On iPhone, keep the screen on: Halftank asks the phone not to sleep, because a locked phone stops giving web pages its location.

How it works: the core of the tooljavascript
// The whole tool: a circle of remaining range, centred on you, shrinking as you drive.
navigator.geolocation.watchPosition(pos => {
  const here = L.latLng(pos.coords.latitude, pos.coords.longitude);
  const acc = pos.coords.accuracy;                       // metres
  if (last && acc < 50) {
    const d = haversine(last, here);
    const secs = (Date.now() - last.t) / 1000;
    if (d < Math.max(12, acc * 0.6)) return;             // GPS jitter while parked: ignore
    if (d / secs > 90) { last = stamp(here); return; }   // a jump, not a drive: don't count it
    driven += d / 1609.344;
  }
  last = stamp(here);
  const left = Math.max(0, startRange - driven);
  circle.setLatLng(here).setRadius(left * 1609.344);     // inside = still reachable
  half.setRadius(left / 2 * 1609.344);                   // inside = reachable and back
}, null, { enableHighAccuracy: true });

Everything runs on your phone. Your position goes from the GPS to the map and nowhere else; the page remembers only your starting range and miles driven, so a refresh doesn't reset the trip.

Where it's going

Typing in your range works today. Two upgrades would make it better:

  • Pick your car. A vehicle profile (tank size and mpg, or an EV's rated range) plus your fuel or charge level, so you don't have to read the gauge.
  • Ask the car. Connected-car services can report remaining range directly, especially for EVs. That's the version I'd most like to build.

The bigger wall is where the circle lives. It's best on the map you're already navigating with, and Google Maps, Apple Maps and Waze don't let other apps draw on their maps. A web page can't show on CarPlay or Android Auto either. The real fix is a full navigation app with the circle built in, which is a much bigger project. The same wall killed a related idea, a one-tap button for reporting wrecks and speed traps; that one has its own post.

Where it started · Jul 2026

The reach map: which roads can you actually ride?

Halftank began as a different question: how far can a 50cc scooter that tops out at 40 mph actually get around the East Valley? On a map everything looks close. On the ground, nearly every through-road in the Phoenix suburbs is posted at 45, and a small scooter, e-bike or moped either isn't allowed on them or shouldn't be. The distance was fine; the roads were the problem.

Two reach maps from downtown Mesa on a 20-mile round trip. With a 35 mph ceiling, a lopsided patch of residential streets is reachable and most of the grid is grey. With a 45 mph ceiling, the whole diamond-shaped area is colored.
35 mph ceiling · 1,590 road-miles45 mph ceiling · 6,029 road-miles
SPEED
LIMIT
≤20
SPEED
LIMIT
25
SPEED
LIMIT
30
SPEED
LIMIT
35
SPEED
LIMIT
40
SPEED
LIMIT
45
SPEED
LIMIT
50+
over the ceiling
Same start (downtown Mesa), same 20-mile round trip, real OpenStreetMap roads. On the left the vehicle won't go on anything posted above 35; on the right, 45. Grey is road you could reach by distance but not at that speed. The diamond shape is the street grid: ten miles on a grid gets you about ten miles along an axis, not along a diagonal.

That first version was a single web page that did four things in the browser:

  1. Pull the roads. It asked OpenStreetMap's public query service for every road in a box around the pin, with geometry and tags.
  2. Read the limit. Each segment got a speed: the posted maxspeed if someone mapped it, otherwise a default by road type, flagged as a guess.
  3. Build a graph. Every point where segments meet became a node; every segment an edge weighted by its length in miles.
  4. Search outward. Dijkstra's shortest-path algorithm expanded from the pin, skipped every edge above the vehicle's ceiling, and stopped when the distance budget ran out. Round trip halved the budget.
Dijkstra with a speed ceilingjavascript
// Shortest-path outward from the start, but some edges simply don't exist for you.
function reach(graph, start, budgetMiles, ceilingMph) {
  const dist = new Map([[start, 0]]);
  const pq = new MinHeap([[0, start]]);
  while (pq.size) {
    const [d, u] = pq.pop();
    if (d > dist.get(u) || d > budgetMiles) continue;
    for (const { to, miles, mph } of graph.get(u)) {
      if (mph > ceilingMph) continue;            // too fast for this vehicle: not an option
      const nd = d + miles;
      if (nd <= budgetMiles && nd < (dist.get(to) ?? Infinity)) {
        dist.set(to, nd);
        pq.push([nd, to]);
      }
    }
  }
  return dist;                                    // every node you can reach, and how far it took
}

const budget = roundTrip ? range / 2 : range;    // there and back without stopping
35 MPH≤20 mph: 763 road-miles25 mph: 712 road-miles30 mph: 38 road-miles35 mph: 77 road-miles1,590 mi45 MPH≤20 mph: 3,079 road-miles25 mph: 1,972 road-miles30 mph: 120 road-miles35 mph: 272 road-miles40 mph: 234 road-miles45 mph: 353 road-miles6,029 miROAD-MILES IN REACH, BY POSTED LIMIT
Road-miles in reach, colored by posted limit. Raising the ceiling from 35 to 45 doesn't just add the 45 mph roads (353 miles of them); it connects everything behind them. Reach nearly quadruples.

Two honest caveats sit inside those numbers. A lot of the "≤20" miles are parking aisles, alleys and service drives, which count as road in the data but not in a rider's head. And only 37% of road segments in this area have a speed limit in OpenStreetMap at all; the rest are guessed from the road's type.

When the limit isn't mappedjavascript
// Most roads have no posted limit in OpenStreetMap. Fall back to the road's class.
const ASSUMED = {
  motorway: 65, trunk: 55, primary: 45, secondary: 40, tertiary: 35,
  unclassified: 30, residential: 25, living_street: 15, service: 15,
};
function mph(tags) {
  const m = /(\d+)/.exec(tags.maxspeed || "");
  if (m) return { mph: +m[1], mapped: true };
  return { mph: ASSUMED[tags.highway] ?? 25, mapped: false };   // counted toward "% guessed"
}

The reach map answered its question, but it was slow (it downloads every road around you), it needed good speed-limit data that mostly doesn't exist, and it only mattered to small vehicles. Stripping it down to the one thing every driver wants to know turned out to be the better tool: the circle.

What I learned

  • The simple version won. Roads, speed limits and Dijkstra made a clever map. A circle made a useful one.
  • Constraints beat distance. For a small vehicle, the question isn't how far but which roads: one rule (no roads over 35) removed three-quarters of the reachable network.
  • Be honest on screen. The reach map showed how much of its data was guessed; the circle says it's straight-line.
  • Platforms decide. The best place for a feature is inside the app people already use, and that app has to let you in.

Open Halftank →

Map data © OpenStreetMap contributors. Reach-map figures computed Oct 18, 2026 from a 20-mile round trip starting in downtown Mesa, AZ. Questions or ideas: Discord.