Skip to content
Showing Trail

How we compute: travel time to work

How the distance and the times by car and by public transit from a home to a work address are worked out: the site's own list of Ontario addresses, the straight line, the free route services in turns, the site's own transit calculator over the agencies' timetables, and what each cannot tell you.

How each figure is worked out

  1. A work address is picked from suggestions as it is typed, with any unit or suite number taken out first. The suggestions come from the site's own list on this server: Ontario's civic addresses from Statistics Canada's National Address Register, without units, and OpenStreetMap's named places (offices, campuses, hospitals, stations), each in a table of its own. Only when the list has no match is the typed text sent on to one outside search: Photon, then LocationIQ or Geoapify where the site has their free keys. The address's point is the register's (the building, or the road access to it), the named place's, or the outside search's.
  2. The distance on a card or a pin is the straight line between the listing's map point and the work address's point, by the haversine formula on a sphere of 6,371 km (the earth's mean radius). The "Within N km of my work" filter uses the same line.
  3. The time and the kilometres by car are a route service's answer for the fastest road route between the two points, each rounded to three decimals of a degree (about 100 m); nothing else is sent, never an address, a name or anything of the listing. FOSSGIS's OSRM server and, where the site has its free key, Geoapify take turns, weighted 6 to 4 by what each has answered that day; LocationIQ answers when neither does. Each is held to its own limits, counted on this server: FOSSGIS one request every 2 seconds, one at a time and at most 1,500 a day; Geoapify one a second and 2,000 a day; LocationIQ one a second and 2,500 a day. A service that fails three times in a row, or says it has had too many requests, is left out for 15 minutes.
  4. A listing's page or pin asks only a route service whose turn it is now, and gives it about 2.5 seconds; when none is free (FOSSGIS's 2 seconds between calls) or none answers in time, it shows at once a time estimated from the straight line, and says so: the line × 1.3 for the roads, at 40 km/h, plus 5 minutes. An email being sent waits for a service's turn instead, within its few seconds, until FOSSGIS has used half its day; the CRM's pages and the client's own page show what is kept and have the rest worked out after they are drawn. An estimate is never kept, so the next view asks again.
  5. An answer is kept for up to 7 days by its two rounded points (one from LocationIQ for up to 48 hours, as its free plan allows), so a second view asks nothing again; it shows the service's credit and the day it was worked out.
  6. Public transit: the time is worked out on this server by the site's own calculator, from the timetables the transit agencies publish (GTFS files), so nothing is sent anywhere for it. Once a week, at night, the site asks each agency whether its file has changed and downloads it only if it has, one agency at a time; it then makes one timetable of a regular weekday morning from them all: the next weekday that most agencies run as a normal weekday (a holiday is passed over; an agency whose file does not cover that day gives its own nearest regular weekday, the same day of the week first).
  7. The transit time is door to door for an arrival by 9:00: the walk to a stop within about 800 m of the home, the rides, the changes (at least 2 minutes, more where an agency's own file says so, none where it forbids one; a walk between stops within about 250 m), and the walk from the last stop to the work address, each walk the straight line × 1.25 at 4.8 km/h. The calculator, a round-based search (the RAPTOR method of Delling, Pajor and Werneck, 2012), finds the latest one can leave home and still arrive by 9:00 for each number of vehicles, then the journey itself. Of the journeys it finds, it gives the one with the shortest time door to door, counting half of any time arriving before 9:00 and 5 minutes for each vehicle: a change must save 5 minutes, and a fast train a little earlier wins over a slow bus that arrives at 8:59, but not one that leaves 40 minutes earlier to save 7. Walking the whole way is the answer when it is quicker (within 2 km). With no journey within two hours, there is no transit time.
  8. The transit directions link opens Google Maps' transit directions between the two points, a plain link that needs no key, beside the time or in its place; this site fetches nothing from it. Each transit time shows the credit line of each agency whose timetable it used, as its licence asks (Metrolinx's legend for its timetables).
  9. York Region Transit (YRT/Viva) and Barrie Transit ask whoever downloads their timetables to accept their terms first, in the business's name, so they are read once the site's owner has; Grand River Transit's download page did not answer when this was written; and OC Transpo, Niagara Region Transit and the Hamilton Street Railway are not read until their terms are confirmed. Until then a trip that needs them is missed or shown longer.

What it cannot tell you

  • No free route service has traffic: a car time is the time without traffic, and rush hour usually takes longer.
  • The routes follow OpenStreetMap's roads, which can lag a new road or a closure; a map error can be reported at openstreetmap.org/fixthemap.
  • The register's point can be a building's road access or driveway, a new building reaches the register some months after it is finished, and OpenStreetMap's named places are as complete as its volunteers have made them.
  • Both points are rounded to about 100 m, so a time is for the block, not the door; a listing whose map point is approximate gives an approximate distance and time, and says so.
  • A transit time is the agencies' scheduled times for one regular weekday: it knows no delay, detour, crowding or cancellation, the walks are estimated from the straight line rather than the streets, and a timetable can be up to a week behind a change the agency has just made.
  • Timetables the site does not read are not in it: VIA Rail, intercity coaches, and the agencies named above until they are read.
  • An estimate of a commute, not an assurance of one: check it before you rely on it.

Map search · Every method

Figures from the public sources named above, as published on the dates shown; they may be out of date or differ from the source, and this site is not the source, so check with it before you rely on a figure.

Udit Gupta, Sales Representative

Your REALTOR®

Udit Gupta

Sales Representative, EXIT Realty Apex, Brokerage

Questions about a home, a building, a school or a neighbourhood on this page? Ask me directly: I answer myself, usually the same day.

About Udit