Introduction to spans parameter

Introduction to spans parameter

0:00 - 00:22 Introduction

00:24 - 01:19 Routing response structure in v7

01:20 - 03:09 Routing response structure in v8

03:10 - 03:44 Sample usecase

03:45 - 05:12 Comparison between v7 and v8 for a usecase

05:13 - 06:58 Spans parameter

06:59 - 07:19 User Guide


Welcome to the migration learning series. In this video, we will talk about one of the important changes in the Routing API request and response structure ie. Spans parameter.

Request & Response Structure

Routing Response in Routing v7 was structured to be Route -> Leg -> Maneuver -> Link bookended by meta info and route summary info.

In Routing v8 the response is structured to be Routes -> sections and meta info. Inside each section actions, summary, polyline (Geometry), notices, and spans (if requested) are nested.

When more detailed attributes about a section is required, then we can request spans. The travel portion of a section is split into spans. The split is made whenever there is a change in the value.

Demo Use Case

Let’s see an example in our routing demo tool:

We have a use case to get the length info by country for a route. In Routing V7 you would have used the Route Attribute Summary by Country to get this info. In Routing V8 whereas you would use spans for this purpose, and you must request for country code and length to get this data.


Once I click on submit , I will be able to see my route generated with the response details on my right.

Similarly, you can see multiple use cases in the Developer Guide.

Hope you found this video useful. Thank you.

Generic Resources

Important place to visit for all other generic help.