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

by Niharika Sisodia
on Oct 31, 2018 9:23:02 AM

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 platform to show the route from Kennington to the UK supermarket, Tesco.

TRY APP NOW

travel-door-to-door

The TravelTime platform 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 platform.

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.

GET AN API KEY

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

 

Related

What is geocoding? Use geocoding to display postcodes on a map

What is geocoding and how does it work. Use a geocoder to convert place names and postcodes into coordinates. Display coordinates on a map. Use geocoding to improve routing and map display.

Niharika Sisodia Nov 22, 2018 9:26:41 AM
READ

Alternatives to the google driving distance matrix api

Cost effective alternative to the Google driving distance matrix API. Calculate driving times using the TravelTime Search API. Search from a single origin to 100,000 potential locations.

Niharika Sisodia Oct 3, 2018 11:17:58 AM
READ

How to create a GeoJSON isochrone

What is GeoJSON? Learn how to create GeoJSON isochrone step by step.

Niharika Sisodia Sep 17, 2018 9:26:37 AM
READ

Free geocoding using the TravelTime API

Use the free geocoder and reverse geocoder. Change coordinates to an address. Learn about free geocoding. Fre geocoding using the TravelTime API.

Niharika Sisodia Aug 23, 2018 4:17:17 PM
READ

Tutorial: how to build a store finder

Create your own store locator. Use TravelTime API to filter store finder by shortest journey time.

Niharika Sisodia Aug 6, 2018 8:14:06 AM
READ