How to calculate travel door to door with and without an API

by Niharika Sisodia
on Oct 23, 2018

What is a routing map?

A routing map shows you the route from a starting point to a destination. A simple example would be calculating a route from your home address to your local supermarket. The map below uses the TravelTime to show the route from Kennington to the UK supermarket, Tesco.

Click

travel-door-to-door

The TravelTime returns routing information between a starting point and the destinations. You can do a departure or arrival search from the search origin to up to two destination points. For example, arrive at London King’s Cross station at 9am or depart at 9am.

travel-time-search

The example below shows the shortest route from King’s Cross to the British Museum departing at 9am.

travel-door-to-door

The user could also do an arrival search.

travel-time-search

The example below shows the shortest route from King’s Cross to the British Museum arriving at 9am.

travel-door-to-door

The TravelTime platform supports the following modes of transport:

  • Cycling
  • Driving
  • Driving+train
  • Public transport
  • Walking
  • Coach
  • Bus
  • Train
  • Ferry
  • Driving+ferry
  • Cycling+ferry

Using routing on TravelTime Maps tool

Try it yourself. Travel door to door using the TravelTime.

Routing can also be integrated into websites as part of a business solution. For example, a cinema chain could use routing on a cinema finder page. The below map uses Time Map and Time Filter, powered by the TravelTime Search API.

In this example, the user can find out which cinemas are easiest to reach. They enter their preferred mode of transport (public transport in the example below) and the journey times to each location is shown. Time Map produces the isochrone shape on the map. Time Filter produces the journey time information in a list on the left side of the page. The below example shows all cinemas within 15 minutes of central London by public transport.

travel-door-to-door

From the map or the list, the user would select their preferred cinema. They would then select ‘directions to here’.

travel-time-search

 

 

 

 

 

 

 

This would provide them with a route.

travel-door-to-door

Time Filter can return travel time and directions for up to 100,000 points from the search origin. Time Filter requires a defined travel time limit of up to 4 hours. This allows it to show only the results that are relevant to the user and to filter out unreachable locations.

Learn more about Time Filter and how the TravelTime Search API can support your business.

How do I code a route?

Before you begin, you first need to request an API key and ID.

The example below shows you how to code a departure search. The point of origin is the centre of London. The destination points are Hyde Park and ZSL London Zoo. The mode of transport is driving. In the example, the departure date is 2018-09-17 and the departure time is 08:00. The request is for travel time, distance and route.

Request

First, you need to create the request.

Add locations

Then, you need to add locations to your request by entering the geo-coordinates. In this case, we will use 51.508930, -0.131387 as the centre of London, 51.508824, -0.167093 as Hyde Park and 51.536067, -0.153596 as ZSL London Zoo. Take a look at our free geocoder tool if you don’t have lat/longs.

This request has both a departure and arrival search example.

For the departure search, the API returns travel times, route details and fares for public transport. It also shows the distance for other modes from one departure point to up to two destination points.

Departure search

travel-door-to-door

travel-door-to-door

For the arrival search, the API returns 1 result for this journey within a range of 1800 seconds (30 minutes). This means the user can arrive within a 30-minute window, rather than arrive at a specific time. The API can also return up to 5 alternative results, like on the screenshot below.

Arrival search

travel-time-search

travel-time-search

travel-time-search

travel-time-search

Response

The response for this request contains the departure and arrival search results with routes information. Look at the code here.

Click

Get in touch to learn more about calculating travel door to door using the TravelTime.

 

Related

Google Maps Drive Time Polygon Tutorial - A Guide to Driving Radius

Visualise ‘how far can I travel’ on a Google Map within a drive time limit, for example a 30 minute driving radius. Follow the free developer guide using an API or use our quick tool to build without code.

Evelina Bezubec Sep 11, 2020
READ

Totaljobs launch with TravelTime, increase conversions 10%

How one of the largest UK job portals, Totaljobs, implemented TravelTime on their website to increase conversions by 10%.

Evelina Bezubec Apr 22, 2020
READ

The Telegraph use TravelTime to highlight access to hospitals across the UK

The Telegraph used TravelTime analysis to identify how many people in the UK do not have access to a coronavirus test centre within 1 hour drive times. Explore the case study.

Louisa Bainbridge May 7, 2020
READ

Creating a population radius using TravelTime

Catchment area analysis: a distance-based radius doesn’t reflect accessibility to the location. TravelTime allows search based on time instead of distance.

Chris Hutchinson Feb 17, 2020
READ

5 ways to do geocoding for free

Discover solutions that do geocoding for free. Find out which free geocoders have the best functionality. Convert addresses and postcodes into coordinates.

Evelina Bezubec Sep 9, 2019
READ

5 Google Places API alternatives for points of interest data

Find Google Places API alternatives. Connect to a reliable 'points of interest' database via an API. Improve user experience and perfect your location search tool.

Louisa Bainbridge Jun 14, 2019
READ