Multimap logo Multimap API V1.2 Web Services Documentation - Routing


Routing Overview

The Multimap API V1.2 Routing web service module allows you to generate driving or walking (where available) directions between a set of locations, provided as points, addresses or search criteria (which find the specific latitude and longitude for an address or search result). In addition to textual information about the route, the service returns a route vector which can be passed to the draggable-maps API to render a highlight of the route over the map.

The Multimap API Routing web service enables you to generate routes between two or more locations, specifying options such as language, optimization method, road exclusions and mode of travel.

The Multimap API can now also include information about carbon emissions in the directions it returns for journeys by road; if you wish your service to contain this additional option, please contact your Multimap account manager.

Route structure

The Multimap API models routes in a structured format as described below:

Term Description
Route This term describes the series of one or more route stages, each containing one or more route steps, between two or more locations. Every route has a start point and an end point and may contain one or more intermediate 'via' points.
Stage This term denotes a series of one or more route steps that link any two points along a route. A separate route stage exists between every pair of points that have been specified along the route, including 'via' points.
Step This term denotes a portion of a route stage containing one instruction, such as "Depart on Hazlitt Road for 0.1 miles".

For a full description of all attributes and elements of the Multimap API route structure, please see the Route Structure page.

Please see the Notes on Response 1 section of this web page for a example of a typical route structure contained in an XML response.

'Snap to' feature

Where the start or end point of a route does not correspond to a point on a recognized route network, the Multimap API attempts to 'snap' that point's coordinates to the nearest road within one kilometer. Since a location that has been 'snapped' any distance greater than this is unlikely to bear much resemblance to the location that was originally requested, the Multimap API Routing web service returns an Error code if a user specifies a location more than one kilometer away from the nearest road (for example, in an extremely rural area or out at sea).


Routing Parameters

The Routing module accepts parameters that both define the points that a route should include (up to ten) and set various options about the route.
The route points can be specified as addresses, coordinate pairs of latitude and longitude or search criteria.

Each point must be numbered consecutively from "1" in the format parameter_n where n is the point number. For example, a route from a coordinate point to the postcode EC4A 2DY, via the postcode SM6 0AZ, in Great Britain would be specified as:

&lat_1=51.3652&lon_1=-0.0763&qs_2=sm60az&qs_3=ec4a2dy

Similarly, to use search criteria to specify a point, you must specify a data source to search on. This is done by including the dataSource_n parameter, (where n is the point number) with a value as described in the Searching Parameters section of this document. A single-field filter parameter must also be used. So, for example:

&dataSource_2=mm.clients.[datasource1]&fieldname_2=id&operator_2=eq&value_2=2

This example would search the specified data source for a row with an identifier of "2". This search result would be used as the second route point (since "_2" is used on each parameter).

[Note: Please replace "parameter_[COUNTER]" with incremental numbers such as parameter_1,parameter_2,...,parameter_n.
In these examples, parameter_1 is used for the first route point and parameter_2 for the second route point.]

The Routing web service parameters, description and values are as follows:

Table 1. Routing parameters

ParameterDescription Valid values Mandatory
excludeThis parameter specifies whether to try to avoid highways or motorways.* "highways" or "motorways" No
key This parameter refers to a Multimap route key which encapsulates the route points and options. String No
lat_[COUNTER] This parameter refers to the latitude coordinate, such as lat_1 or lat_2. Here, lat_1 is used for the first route point and lat_2 for the second route point. FloatNo
locale This parameter determines the language of route instructions, appearance of labels and other text on a static map, based on settings for language and geographic area. Any of the set of codes prescribed in the list of permissible locale values No
lon_[COUNTER]This parameter refers to the longitude coordinate, such as lon_1 or lon_2. Here, lon_1 is used for the first route point and lon_2 for the second route point. FloatNo
mode This parameter specifies whether to generate a driving or walking route (where available); it gives a driving route by default. Comma-separated list; "driving" or "walking" No
optimizeFor This parameter specifies whether to generate the quickest or shortest route; it shows the quickest by default. "distance" or "time"No
optimizeIntermediate This parameter enables you to control the order of the 'via' points of a route or to 'optimize' them by ordering them automatically.* "true" or "false"No

(*Please note that the exclude and optimizeIntermediate parameters do not currently apply to routes in North America.)

Table 2. Geocode parameters for Routing

ParameterDescription Valid values Mandatory
city_[COUNTER] This parameter refers to the city, town or suburb for the input address, such as city_1 or city_2. String No
countryCode_[COUNTER] This parameter refers to a two-letter ISO country code for the input address, such as countryCode_1 or countryCode_2. Two-letter ISO country codeNo
postalCode_[COUNTER] This parameter refers to the postal code for the input address, such as postalCode_1 or postalCode_2. StringNo
qs_[COUNTER] This parameter refers to an address or place name entered as a single string, usually including a country code, such as qs_1 or qs_2. StringNo
region_[COUNTER] This parameter refers to the region for the input address, such as region_1 or region_2; it is a synonym for state. StringNo
state_[COUNTER] This parameter refers to the state for the input address, such as state_1 or state_2; it is a synonym for region. StringNo
street_[COUNTER] This parameter refers to the street (optionally including a building number) for the input address, such as street_1 or street_2. StringNo

Table 3. Search parameters for Routing

ParameterDescription Valid valuesMandatory
bb_[COUNTER] This parameter refers to a string that specifies the bounding box for a search, such as bb_1 or bb_2. String of format: min_lon,min_lat;max_lon,max_lat No
compoundOrder_[COUNTER] This parameter refers to the order in which the operators should be applied, such as compoundOrder_1,compoundOrder_2,...,compoundOrder_n. Comma-separated listNo
compoundThreshold_[COUNTER] This parameter refers to the number of records the compound query should try to retrieve. If set to "0", the compound query stops as soon as one of the operators matches at least one row. If set to "10", the compound query continues to run until at least ten matches are found, or there are no more operators to use. IntegerNo
dataSource_[COUNTER] This parameter specifies the data source to use for a particular route point, such as dataSource_1 or dataSource_2. StringNo
distanceUnits_[COUNTER] This parameter specifies the units in which the maxDistance and minDistance parameters are shown, such as distanceUnits_1 or distanceUnits_2. "KM" or "miles"No
fieldname_[COUNTER] This parameter specifies the name of the field in the data source to filter on, such as fieldname_1 or fieldname_2. StringNo
maxDistance_[COUNTER] This parameter specifies the maximum distance a record must be from the specified search point ("KM" by default), such as maxDistance_1 or maxDistance_2. FloatNo
minDistance_[COUNTER] This parameter specifies the minimum distance a record must be from the specified search point ("KM" by default), such as minDistance_1 or minDistance_2. FloatNo
operator_[COUNTER] This parameter specifies the operator to be used in the field filter, such as operator_1 or operator_2. StringNo
orderByFields_[COUNTER] This parameter specifies a comma-separated list of field names by which ordering should be applied, such as orderByFields_1 or orderByFields_2. String or comma-separated listNo
orderByOrder_[COUNTER] This parameter specifies a comma-separated list of orders by which ordering should be applied. This should match with the orderByFields value. Comma-separated list of ascending or descending valuesNo
returnFields_[COUNTER] This parameter specifies a comma-separated list of field names that should appear on the results page, such as returnFields_1 or returnFields_2. All fields are returned by default. String or comma-separated listNo
searchFirstAlt_[COUNTER] If set to 1, the first result of a multiple-match search is used as the route point. 1 or 0No
startIndex_[COUNTER] This parameter specifies the index of the first record to display (starting at and defaulting to 1), such as startIndex_1 or startIndex_2. IntegerNo
value_[COUNTER] This parameter specifies the value used in a field-filter search, such as value_1 or value_2. StringNo

Table 4. Carbon-emission parameters for Routing (additional option)

If your Multimap API Routing service includes the "Carbon Emissions" option, your XML responses contain emission-related information for a series of default vehicle types; you can also specify your own custom types of vehicle using the parameters described in this section.

Parameter Description Valid values Mandatory
emissions This parameter determines whether the XML response should return carbon-emission details (where they are available). "true" or "false" (default is "false") emissions=true
custom_value_[COUNTER] This parameter represents the amount of fuel burned per custom unit (see below). Floatcustom_value_1=35
custom_unit_[COUNTER] This parameter describes the type of unit in which carbon emissions are be measured:
  • miles per gallon (US gallon);
  • miles per gallon (Imperial gallon); or
  • liters per 100 kilometers.
"mpg", "mpg_imp" or "lper100km"custom_unit_2=mpg_imp
custom_type_[COUNTER] This parameter describes the type of fuel used. "diesel" or "gas" (default is "gas") custom_type_3=diesel
custom_name_[COUNTER] This parameter contains the name or label by which you wish to denote this type of vehicle. String custom_name_4=GreenCar

Please follow this link to see an example of an XML response including Carbon Emissions.


Routing Examples

Example 1

Here is an example of a URL requesting details of a route in Great Britain between the postcode EC4A 2DY (latitude 51.52055 and longitude -0.10939) and the partial postcode WC1X, with the mode of travel set to "walking":

http://clients.multimap.com/API/route/1.2/[api_key]
?lat_1=51.4485&lon_1=-0.9729&qs_1=RG20AT&countryCode_1=GB&qs_2=RG1
&countryCode_2=GB&mode=walking

(In this example, the qs_1 parameter is used to provide a label for the address at the beginning of the route.)

Response 1

The URL shown above returns the following response:

<?xml version="1.0" encoding="UTF-8" ?> 
<Route xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/
Schema/route_1.2.xsd"
key="DC,-0.97290:51.44850;-0.97050:51.45446,8" reverseKey="DC,-0.97050:
51.45446;-0.97290:51.44850,8"
> <Duration> <Minutes>13</Minutes> </Duration> <Distance> <Miles>0.65</Miles> <KM>1.05</KM> </Distance> <Bounds> <NorthEast> <Lat>51.45448</Lat> <Lon>-0.96715</Lon> </NorthEast> <SouthWest> <Lat>51.44836</Lat> <Lon>-0.97307</Lon> </SouthWest> </Bounds> <Stages> <Stage id="1" stepCount="8" summary="A4 (Pell Street) > A327 (London Street) > Yield
Hall Place"
mode="walking"> <StartAddress> <qs>RG20AT</qs> <CountryCode>GB</CountryCode> </StartAddress> <StartPoint> <Lat>51.44847</Lat> <Lon>-0.97307</Lon> </StartPoint> <EndAddress> <PostalCode>RG1</PostalCode> <DisplayName>RG1</DisplayName> <CountryCode>GB</CountryCode> </EndAddress> <EndPoint> <Lat>51.45448</Lat> <Lon>-0.97037</Lon> </EndPoint> <Duration> <Minutes>13</Minutes> </Duration> <Distance> <Miles>0.65</Miles> <KM>1.05</KM> </Distance> <Bounds> <NorthEast /> <SouthWest /> </Bounds> <Steps> <Step> <Instruction>Depart on</Instruction> <RoadName>Katesgrove Lane</RoadName> <RoadNumber /> <Distance> <Miles>0.01</Miles> <KM>0.02</KM> </Distance> <Duration> <Minutes>0</Minutes> </Duration> <Bearing>S</Bearing> <Information> <Info type="country_code">GB</Info> <Info type="road_class">tertiary</Info> </Information> <StartPoint> <Lat>51.44847</Lat> <Lon>-0.97307</Lon> </StartPoint> <EndPoint> <Lat>51.44836</Lat> <Lon>-0.97302</Lon> </EndPoint> </Step> ... <Step> <Instruction>Arrive at your destination</Instruction> <RoadName /> <RoadNumber /> <Distance> <Miles>0.01</Miles> <KM>0.02</KM> </Distance> <Duration> <Minutes>0</Minutes> </Duration> <Bearing /> <Information /> <StartPoint> <Lat>51.45448</Lat> <Lon>-0.97037</Lon> </StartPoint> <EndPoint> <Lat>51.45448</Lat> <Lon>-0.97037</Lon> </EndPoint> </Step> </Steps> </Stage> </Stages> <Vector>-97290,5144850,-17,-3,5,-11,123,25,18,11,19,37,17,19,39,20,91,40,52,19,136,17,78,12,12
,8,2,6,-13,31,-73,122,-24,46,-6,45,-9,45,-7,24,-37,22,-117,50,-5,2,-23,1,-5,4,-3,6,-13,-2
</
Vector
> <Copyright>Powered by deCarta</Copyright> <Disclaimer>http://www.multimap.com/static/route_disclaimer.htm</Disclaimer> </Route>

Notes on Response 1

Code Notes
<?xml version="1.0" encoding="UTF-8" ?> The XML declaration specifies the XML version being used and makes a reference to UTF-8 (eight-bit Unicode Transformation Format), which supports any character in the Unicode standard.
<Route xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/route_1.2.xsd"
key="GBW,-0.97290:51.44850;-0.97069:51.45488,0"
reverseKey="GBW,-0.97069:51.45488;-0.97290:51.44850,0">
This section refers to the parent element of the document and defines the XML name space.
The xsi:schemaLocation section defines the XML location schema.
The key element is a unique identifier for the route that refers to the short reference for the route. This Multimap route key encapsulates the route points and options.
The reversekey element is a unique identifier for the reverse route.
<Duration>
<Minutes>13</Minutes>
</Duration>
The Duration element refers to the total time duration of the entire journey, which in this example is measured in minutes.
<Distance>
<Miles>0.66</Miles>
<KM>1.06</KM>
</Distance>
The Distance element refers to the total distance of the entire journey, which in this example is measured both in miles and kilometers.
<Bounds>
<NorthEast>
<Lat>51.45488</Lat>
<Lon>-0.96993</Lon>
</NorthEast>
<SouthWest>
<Lat>51.44838</Lat>
<Lon>-0.97370</Lon>
</SouthWest>
</Bounds>
The Bounds element refers to the rectangular area defined by two points, north-east and south-west.
The lat element refers to the latitude coordinate for a route.
The lon element refers to the longitude coordinate for a route.
<Stages>
<Stage id="1" stepCount="8" summary="A4 (Pell Street) >
A327 (Southampton Street) > Bridge Street > Gun Street >
Minster Street" mode="walking">
The Stages element refers to the point-to-point mapping of the entire route. It displays information pertaining to number of stages, total number of steps in the entire journey, and the mode of travel.
The mode element specifies whether to generate a driving or walking route (where available). The default value is "driving".
<StartAddress>
<qs>RG20AT</qs>
<CountryCode>GB</CountryCode>
</StartAddress>
The StartAddress element provides details of the address from where the route initiates.
The qs element refers to an address or place name entered as a single string. It is preferably used in conjunction with CountryCode.
The CountryCode element refers to the two-letter ISO country code for the input address.
The StartAddress element closes here.
<StartPoint>
<Lat>51.44847</Lat>
<Lon>-0.97307</Lon>
</StartPoint>
The StartPoint element refers to the coordinate location in latitude and longitude at the beginning of each step in the route.
<EndAddress>
<PostalCode>RG1</PostalCode>
<DisplayName>RG1</DisplayName>
<CountryCode>GB</CountryCode>
</EndAddress>
The EndAddress element provides details of the address at which the route terminates.
The PostalCode element refers to the postal code for the input address.
The CountryCode element refers to the two-letter ISO country code for the input address.
The EndAddress element closes here.
<EndPoint>
<Lat>51.45448</Lat>
<Lon>-0.97037</Lon>
</EndPoint>
The EndPoint element refers to the coordinate location in latitude and longitude at the end of each step in the route.
<Duration>
<Minutes>13</Minutes>
<Duration>
<Distance> <Miles>0.65</Miles>
<KM>1.05</KM>
</Distance>
<Bounds>
<NorthEast />
<SouthWest />
</Bounds>
The Duration element refers to the total duration of the current stage of the journey, which in this example is measured in minutes.
The Distance element refers to the total distance of the current stage of the journey, which in this example is measured both in miles and kilometers.
The Bounds element refers to the rectangular area defined by two points, north-east and south-west.
<Steps>
<Step>
<Instruction>Depart on</Instruction>
<RoadName>Katesgrove Lane</RoadName>
<RoadNumber />
<Distance>
<Miles>0.01</Miles>
<KM>0.02</KM>
</Distance>
<Duration>
<Minutes>0</Minutes>
<Duration>
The Steps element refers to the different phases or steps on the entire route.
The Instruction element refers to the directions provided for the route.
The RoadNumber element refers to the number of the road.
The Distance element refers to the total distance of the current step of the journey, which in this example is measured both in miles and kilometers.
The Duration element refers to the total duration of the current step of the journey, which in this example is measured in minutes.
<Bearing>E</Bearing> The Bearing element refers to the direction of the route.
</Steps>
</Stage>
</Stages>
The Steps, Stage and Stages elements close here.
<Vector>-97290,5144850,-17,-3,5,-11,123,25,18,11,19,37,17,19,39,20,91,40,52,19,136,17,78,12,12,8,2,6,-13,31,-73,122,-24,46,-6,45,-9,45,-7,24,-37,22,-117,50,-5,2,-23,1,-5,4,-3,6,-13,-2</Vector> The Vector element refers to the polyline that highlights the route over the map.
<Copyright>Powered by MapInfo</Copyright> The Copyright element contains the map data providers' copyright-notice text.
<Disclaimer>http://www.multimap.com/static/route_disclaimer.htm<
/Disclaimer>
The Disclaimer element contains a link to the Multimap page that shows the full terms and conditions of the map and data use.
</Route> The Route element closes here.


Example 2

Here is an example of a URL requesting details of a route in Great Britain between the postcodes NW9 5LL and EN5 4BE via the postcode EC4A 2DY. This example illustrates a route that involves an entry into and out of the London Congestion Charge Zone to reach the end point:

http://clients.multimap.com/API/route/1.2/[api_key]
?qs_1=NW95LL&countryCode_1=GB&qs_2=EC4A2DY&countryCode_2=GB
&qs_3=EN54BE&countryCode_3=GB

Response 2

The URL shown above returns the following response:

  <?xml version="1.0" encoding="UTF-8" ?> 
 <Route xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema
/route_1.2.xsd"
key="DC,-0.23816:51.59894;-0.10845:51.51453;-0.20235:51.65282,0" reverseKey="
DC,-0.20235:51.65282;-0.10845:51.51453;-0.23816:51.59894,0"
> <Duration> <Hours>1</Hours> <Minutes>6</Minutes> </Duration> <Distance> <Miles>38.67</Miles> <KM>62.23</KM> </Distance> <Bounds> <NorthEast> <Lat>51.67234</Lat> <Lon>-0.10838</Lon> </NorthEast> <SouthWest> <Lat>51.51310</Lat> <Lon>-0.37137</Lon> </SouthWest> </Bounds> <Stages> <Stage id="1" stepCount="24" summary="M1 > A1 (Great North Way) > A400 (Junction Road)
> A4200 (Eversholt Street)"
mode="driving"> <StartAddress> <PostalCode>NW9 5LL</PostalCode> <DisplayName>NW9 5LL</DisplayName> <CountryCode>GB</CountryCode> </StartAddress> <StartPoint> <Lat>51.59917</Lat> <Lon>-0.23658</Lon> </StartPoint> <EndAddress> <PostalCode>EC4A 2DY</PostalCode> <DisplayName>EC4A 2DY</DisplayName> <CountryCode>GB</CountryCode> </EndAddress> <EndPoint> <Lat>51.51423</Lat> <Lon>-0.10838</Lon> </EndPoint> <Duration> <Minutes>38</Minutes> </Duration> <Distance> <Miles>26.92</Miles> <KM>43.32</KM> </Distance> <Bounds> <NorthEast /> <SouthWest /> </Bounds> <Steps> <Step> <Instruction>Depart on</Instruction> <RoadName /> <RoadNumber>M1</RoadNumber> <Distance> <Miles>8.17</Miles> <KM>13.15</KM> </Distance> <Duration> <Minutes>8</Minutes> </Duration> <Bearing>N</Bearing> <Information> <Info type="country_code">GB</Info> <Info type="road_class">primary</Info> </Information> <StartPoint> <Lat>51.59917</Lat> <Lon>-0.23658</Lon> </StartPoint> <EndPoint> <Lat>51.66929</Lat> <Lon>-0.36447</Lon> </EndPoint> </Step> ... <Step> <Instruction>Turn left onto</Instruction> <RoadName>Aldwych</RoadName> <RoadNumber>A4</RoadNumber> <Distance> <Miles>0.10</Miles> <KM>0.16</KM> </Distance> <Duration> <Minutes>0</Minutes> </Duration> <Bearing>E</Bearing> <TurnDirection>L</TurnDirection> <Information> <Info type="country_code">GB</Info> <Info type="road_class">secondary</Info> <Info type="london_congestion_charge">within</Info> </Information> <StartPoint> <Lat>51.51335</Lat> <Lon>-0.11750</Lon> </StartPoint> <EndPoint> <Lat>51.51310</Lat> <Lon>-0.11522</Lon> </EndPoint> </Step> ... <Step> <Instruction>Arrive at your destination</Instruction> <RoadName /> <RoadNumber /> <Distance> <Miles>0.01</Miles> <KM>0.02</KM> </Distance> <Duration> <Minutes>0</Minutes> </Duration> <Bearing /> <Information /> <StartPoint> <Lat>51.65301</Lat> <Lon>-0.20234</Lon> </StartPoint> <EndPoint> <Lat>51.65301</Lat> <Lon>-0.20234</Lon> </EndPoint> </Step> </Steps> </Stage> </Stages> <Vector>-23816,5159894,158,23,-3,9,-12,26,-25,58,-39,65,-13,23,-8,12,-11,17,-9,14,-3,5,-6,8,
-19,30,-110,138,-45,47,-91,96,-38,33,-112,119,-26,27,-69,70,-183,187,-75,77,-76,77,-288,294,
-30,31,-5,5...2,-23,2,-35,3,-13,1,-181,1,-1,-19
</Vector> <Copyright>Powered by deCarta</Copyright> <Disclaimer>http://www.multimap.com/static/route_disclaimer.htm</Disclaimer> </Route>

Example 3

In response to a request for a route between two locations in Great Britain with multiple intermediate 'via' points (without an optimizeIntermediate parameter):

http://clients.multimap.com/API/route/1.2/[api_key]
?qs_1=ec1n2ns&qs_2=ct27rs&qs_3=w1a1aa&qs_4=hitchin

Response 3

<?xml version="1.0" encoding="UTF-8" ?> 
 <Route xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema
/route_1.2.xsd"
key="DC,-0.11102:51.51842;1.07550:51.28544;-0.14377:51.51856;-0.26667:
51.95000,0"
reverseKey="DC,-0.26667:51.95000;-0.14377:51.51856;1.07550:51.28544;-0.11102:
51.51842,0"
> <Duration> <Hours>3</Hours> <Minutes>32</Minutes> </Duration> <Distance> <Miles>163.10</Miles> <KM>262.48</KM> </Distance> <Bounds> <NorthEast> <Lat>51.97497</Lat> <Lon>1.07532</Lon> </NorthEast> <SouthWest> <Lat>51.28127</Lat> <Lon>-0.26966</Lon> </SouthWest> </Bounds> <Stages> <Stage id="1" stepCount="27" summary="A102 (Blackwall Tunnel Approach) > A2 (Rochester Way
Relief Road) > M2 > A2 (Boughton Bypass)"
mode="driving"> <StartAddress> <PostalCode>EC1N 2NS</PostalCode> <DisplayName>EC1N 2NS</DisplayName> <CountryCode>GB</CountryCode> </StartAddress> <StartPoint> <Lat>51.51842</Lat> <Lon>-0.11069</Lon> </StartPoint> <EndAddress> <PostalCode>CT2 7RS</PostalCode> <DisplayName>CT2 7RS</DisplayName> <CountryCode>GB</CountryCode> </EndAddress> <EndPoint> <Lat>51.28551</Lat> <Lon>1.07532</Lon> </EndPoint> <Duration> <Hours>1</Hours> <Minutes>15</Minutes> </Duration> <Distance> <Miles>60.85</Miles> <KM>97.93</KM> </Distance> <Bounds> <NorthEast /> <SouthWest /> </Bounds> <Steps> <Step> <Instruction>Depart on</Instruction> <RoadName>Brooke Street</RoadName> <RoadNumber /> <Distance> <Miles>0.02</Miles> <KM>0.03</KM> </Distance> <Duration> <Minutes>0</Minutes> </Duration> <Bearing>S</Bearing> <Information> <Info type="country_code">GB</Info> <Info type="road_class">tertiary</Info> <Info type="london_congestion_charge">entering</Info> </Information> <StartPoint> <Lat>51.51842</Lat> <Lon>-0.11069</Lon> </StartPoint> <EndPoint> <Lat>51.51814</Lat> <Lon>-0.11069</Lon> </EndPoint> </Step> ... <Step> <Instruction>Continue onto</Instruction> <RoadName /> <RoadNumber>A1(M)</RoadNumber> <Distance> <Miles>13.54</Miles> <KM>21.79</KM> </Distance> <Duration> <Minutes>14</Minutes> </Duration> <Bearing>NE</Bearing> <Information> <Info type="country_code">GB</Info> <Info type="road_class">primary</Info> </Information> <StartPoint> <Lat>51.77626</Lat> <Lon>-0.22530</Lon> </StartPoint> <EndPoint> <Lat>51.95959</Lat> <Lon>-0.20800</Lon> </EndPoint> </Step> ... <Step> <Instruction>Arrive at your destination</Instruction> <RoadName /> <RoadNumber /> <Distance> <Miles>0.04</Miles> <KM>0.06</KM> </Distance> <Duration> <Minutes>0</Minutes> </Duration> <Bearing /> <Information /> <StartPoint> <Lat>51.95056</Lat> <Lon>-0.26653</Lon> </StartPoint> <EndPoint> <Lat>51.95056</Lat> <Lon>-0.26653</Lon> </EndPoint> </Step> </Steps> </Stage> </Stages> <Vector>-11102,5151842,33,0,0,-6,0,-22,-2,-11,-18,2,-10,8,-14,1,-21,3,-16,31,-3,5,-19,32,-24,
43,-25,43,-32,54,-29,...-191,-21,-2,-8,-13,-6,-11,1,-7,3,-4,5,-44,-7,-33,-3,-16,-2,-59,-7,-68,
-26,-47,-18,-15,-7,-25,-17,-13,-7,-1,-2,-2,-2,-3,-2,-20,-23,-14,-16,-26,-24,-79,-52,-134,-73,-29,
-13,-105,-37,-69,-24,1,-2,1,-2,0,-2,-1,-1,0,-2,-2,-2,-1,-1,12,-7,61,-10,240,-22,-14,-56
</Vector> <Copyright>Powered by deCarta</Copyright> <Disclaimer>http://www.multimap.com/static/route_disclaimer.htm</Disclaimer> </Route>


Example 4

In response to a request for a route between two locations in Great Britain with multiple intermediate 'via' points (with an optimizeIntermediate parameter):

http://clients.multimap.com/API/route/1.2/[api_key]
?qs_1=ec1n2ns&qs_2=ct27rs&qs_3=w1a1aa&qs_4=hitchin
&optimizeIntermediates=true

Response 4

<?xml version="1.0" encoding="UTF-8" ?> 
 <Route xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema
/route_1.2.xsd"
key="DC,-0.11102:51.51842;1.07550:51.28544;-0.14377:51.51856;
-0.26667:51.95000,4"
reverseKey="DC,-0.26667:51.95000;-0.14377:51.51856;1.07550:51.28544;
-0.11102:51.51842,4"
> <Duration> <Hours>3</Hours> <Minutes>22</Minutes> </Duration> <Distance> <Miles>275.93</Miles> <KM>444.07</KM> </Distance> <Bounds> <NorthEast> <Lat>51.95088</Lat> <Lon>1.07532</Lon> </NorthEast> <SouthWest> <Lat>51.28127</Lat> <Lon>-0.27061</Lon> </SouthWest> </Bounds> <Stages> <Stage id="1" stepCount="10" summary="Brooke Street > Riding House Street > Langham Street
"
mode="driving"> <StartAddress> <PostalCode>EC1N 2NS</PostalCode> <DisplayName>EC1N 2NS</DisplayName> <CountryCode>GB</CountryCode> </StartAddress> <StartPoint> <Lat>51.51842</Lat> <Lon>-0.11069</Lon> </StartPoint> <EndAddress> <PostalCode>W1A 1AA</PostalCode> <DisplayName>W1A 1AA</