Matrix calculation

(fr) Cette page n’est plus maintenue depuis la version 2022 de Geoconcept Web. Pour accéder à la documentation à jour de ce web service, veuillez suivre ce lien.

Basic principles

This web service calculates a route matrix for a series of points, and returns a distance matrix. Calculations are based on a configured graph, the name of which has been specified in the Geoconcept Web administration interface. See also, compact matrix calculation web service.

Availability

This web service is available at all times when a road network or graph is present with Geoconcept Web.

Version change

Earlier versions of the web service are conserved in Geoconcept Web to ensure compatibility with previous developments. We recommend using the most recent version.

Changes in relation to V4

  • Addition of "timeOut" and "computeOptions" parameters.
  • Addition in the "nodes" snapMethod of snap to the nearest nodes.

Changes in relation to V3

  • Addition of the notion of node, which is faster, to snap to graph nodes rather than to geographic coordinates. Addition of the following items: "originNodes", "destinationNodes" and "nodes" in the snapMethod.
  • Addition of the "maxCost" parameter

Changes in relation to V2

  • Addition of the "snapMethod" parameter
  • Addition of the "startDateTime" parameter
  • Deletion of the "RejectFlags" parameter, replaced by "exclusions"
  • The "distance" and "duration" parameters have been renamed "distanceMeters" and "durationSeconds" respectively

V4

Parameters / properties

Input

parameter description optional default

srs

projection (ESPG code such as epsg:4326 or wgs84)

yes

origins

List of coordinates of points of origin. The longitude and latitude coordinates are separated by the ,, character

yes *

originNodes

List of origin ids nodes. ids nodes are separated by , characters. Care: a physical node does not have the same ID in another graph.

yes *

destinations

List of coordinates of destination points. The latitude and longitude cooordinates are separated by the , character.

yes *

destinationNodes

List of destination ids nodes. ids nodes are separated by , characters. Care: a physical node does not have the same ID in another graph.

yes *

graphName (depreciated)

Name of the graph to use
This parameter is omitted if the configName parameter is used.

yes

method

shortest (distance) or fastest (time) route

yes

time

profileId (depreciated)

Vehicle identifier (saved under vehicle profiles)
This parameter is omitted if the configName parameter is used.

yes

profileName (depreciated)

Vehicle profile (saved under vehicle profiles)
This parameter is omitted if the configName parameter is used.

yes

exclusions

List of restriction rules to use, separated by the ; character (Example: Toll, Tunnel, Bridge)

yes

startDateTime

Departure date and time (format ISO8601: local time). Example: 2014-01-21T09:00:00.000+01:00 (or 2014-01-21T09:00:00.000%2B01:00) for a start on 21 January 2014, at 9.00am in Paris. Caution: the + character may be misinterpreted by browsers, and so it is best replaced by %2B.

yes

snapMethod

Snap to graph method
- standard: to the nearest connectable road section
- extended: via restricted road sections (pedestrian routes…)
- nearest: to the nearest road section only
- unrestricted: without any restriction rules
- nodes: Snap directly to nodes supplied by the originNode, destinationNode and waypointNodes parameters, or, if these parameters have not been set, to the nearest nodes sourced by the origin, destination and waypoint parameters

yes

standard

avoidArea

Forbidden transit zone in WKT format (POLYGON or MULTIPOLYGON) in the requested projection (srs parameter)
Example in wgs84 : POLYGON ((-1.556892 47.21689, -1.556892 47.216904, [...] -1.556892 47.21689)) - MULTIPOLYGON (((-1.556892 47.21689, -1.556892 47.216904, [...] -1.556892 47.21689)), ((-1.558639 47.218144, -1.558639 47.218193, [...] -1.558639 47.218144)))
Care: WKT geometries must be closed.

yes

configName

Name of the configuration to use (defined in Geoconcept Web - Administration / Tools / Road graphs)
This replaces use of graphName, profileId and profileName

yes

computeOptions

List of options for the calculation,separated by ; characters
- trafficPatterns: uses routing statistics (you will need to supply a value for the startDateTime parameter and use a graph that includes traffic patterns information)
- speedPattern (M18): uses a speed pattern as defined in the SmartRoutingVehicles.xml file, located in the `‘<GEOCONCEPT_WEB_HOME>’'\smartrouting\jee\smartrouting\conf\ folder. Use as follows: "speedPattern:slow-speed"
- length (M18): maximum authorised length in centimeters (you need to use a graph that includes Heavy Goods Vehicle attributes). Use as follows: "length:950"
- width (M18): maximum authorised width in centimeters (You will need to use a graph that includes Heavy Goods Vehicle attributes). Use as follows: "width:255"
- height (M18): maximum authorised height in centimeters (you will need to use a graph that includes Heavy Goods Vehicle attributes). Use as follows: "height:360"
- weight (M18): maximum authorised weight in kilograms (you will need to use a graph that includes Heavy Goods Vehicle attributes). Use as follows: "weight:18000"
- axles (M18): maximum authorised number of axles (you will need to use a graph that includes Heavy Goods Vehicle attributes). Use as follows: "axles:2"
- weightPerAxle (M18): maximum authorised weight per axle in kilograms (you will need to use a graph that includes Heavy Goods Vehicle attributes). Use as follows: "weightPerAxle:9000"
- snapSpeed: snap-to-graph speed in kilometers per hour. Use as follows: "snapSpeed:10"

yes

maxCost

Maximum cost not to exceed in the results
-1: no maximum cost to take into account
0: take the default value defined in the SmartRouting Server configuration
if not: value in metres if method=distance or in seconds if method=time

yes

timeOut

Time out for the calculation (in milliseconds)

yes

(*) At least one of the two pairs of parameters origins/destinations or originNodes/destinationsNodes must have values assigned.

(M18) Available from version M18 and later versions of graphs supplied by GEOCONCEPT SAS.

Output

Matrix (matrixResultV3)

parameter type min/max description

origins/origin (or origins in JSON / JSON-P)

string (or array of origins/origin in JSON / JSON-P)

0/unlimited

origin positions.

destinations/destination (or destinations in JSON / JSON-P)

string (or array of destinations/destination in JSON / JSON-P)

0/unlimited

destination positions.

rows/row (or rows in JSON / JSON-P)

matrixRowV3 (or array of rows/row (matrixRow) in JSON / JSON-P)

0/unlimited

Matrix line

Matrix line (matrixRowV3)

parameter type min/max description

cells/cell (or cells in JSON / JSON-P)

matrixCellV3 (or array of cells/cell (matrixCellV3) in JSON / JSON-P)

0/unlimited

Matrix cell

Matrix cell (matrixCellV3)

parameter type min/max description

distanceMeters

double

1/1

Matrix cell distance (in metres)

durationSeconds

double

1/1

Matrix cell duration (in seconds)

status

string

0/1

Matrix cell status:
- OK: the itinerary has been found for this cell
- KO: no itinerary found for this cell

SOAP

WSDL

http://<server>/<webapp>/api/ws/matrixService?wsdl

Query

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas">
   <soapenv:Header/>
   <soapenv:Body>
      <sch:matrixV4>
         <!--Optional:-->
         <request>
            <!--Optional:-->
            <srs>epsg:27572</srs>
            <!--Optional:-->
            <origins>
               <!--1 or more repetitions:-->
               <origin>
                  <x>315846.96</x>
                  <y>2254268.35</y>
               </origin>
                <origin>
                              <x>313584.77</x>
                  <y>2251648.97</y>
               </origin>
            </origins>
            <!--Optional:-->
            <originNodes>
               <!--1 or more repetitions:-->
               <originNode></originNode>
            </originNodes>
            <!--Optional:-->
            <destinations>
               <!--1 or more repetitions:-->
               <destination>
                  <x>321442.89</x>
                  <y>2251013.98</y>
               </destination>
                <destination>
                  <x>318982.27</x>
                  <y>2248315.22</y>
               </destination>
            </destinations>
            <!--Optional:-->
            <destinationNodes>
               <!--1 or more repetitions:-->
               <destinationNode></destinationNode>
            </destinationNodes>
            <!--Optional:-->
            <graphName></graphName>
            <!--Optional:-->
            <method>time</method>
            <!--Optional:-->
            <profileId></profileId>
            <!--Optional:-->
            <profileName></profileName>
            <!--Optional:-->
            <exclusions>
               <!--Zero or more repetitions:-->
               <exclusion></exclusion>
            </exclusions>
            <!--Optional:-->
            <startDateTime></startDateTime>
            <!--Optional:-->
            <snapMethod></snapMethod>
            <!--Optional:-->
            <avoidArea></avoidArea>
            <!--Optional:-->
            <configName></configName>
            <!--Optional:-->
            <computeOptions></computeOptions>
            <!--Optional:-->
            <timeOut></timeOut>
                        <!--Optional:-->
                        <maxCost>0</maxCost>
         </request>
      </sch:matrixV4>
   </soapenv:Body>
</soapenv:Envelope>

Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:matrixV4Response xmlns:ns2="http://geoconcept.com/gc/schemas">
         <MatrixResult>
            <status>OK</status>
            <origins>
               <origin>315846.96,2254268.35</origin>
               <origin>313584.77,2251648.97</origin>
            </origins>
            <destinations>
               <destination>321442.89,2251013.98</destination>
               <destination>318982.27,2248315.22</destination>
            </destinations>
            <srs>epsg:27572</srs>
            <rows>
               <row>
                  <cells>
                     <cell>
                        <distanceMeters>8109.0</distanceMeters>
                        <durationSeconds>564.66</durationSeconds>
                        <status>OK</status>
                     </cell>
                     <cell>
                        <distanceMeters>11249.39</distanceMeters>
                        <durationSeconds>816.38</durationSeconds>
                        <status>OK</status>
                     </cell>
                  </cells>
               </row>
               <row>
                  <cells>
                     <cell>
                        <distanceMeters>11736.89</distanceMeters>
                        <durationSeconds>856.77</durationSeconds>
                        <status>OK</status>
                     </cell>
                     <cell>
                        <distanceMeters>7636.69</distanceMeters>
                        <durationSeconds>526.1</durationSeconds>
                        <status>OK</status>
                     </cell>
                  </cells>
               </row>
            </rows>
         </MatrixResult>
      </ns2:matrixV4Response>
   </soap:Body>
</soap:Envelope>
REST

Query

JSON query 

http://<server>/<webapp>/api/lbs/matrix/v4.json?origins=315846.96,2254268.35;313584.77,2251648.97&destinations=321442.89,2251013.98;318982.27,2248315.22&srs=epsg:27572&method=time

JSON-P query 

http://<server>/<webapp>/api/lbs/matrix/v4.json?origins=315846.96,2254268.35;313584.77,2251648.97&destinations=321442.89,2251013.98;318982.27,2248315.22&srs=epsg:27572&method=time&callback=myCallback

XML query 

http://<server>/<webapp>/api/lbs/matrix/v4.xml?origins=315846.96,2254268.35;313584.77,2251648.97&destinations=321442.89,2251013.98;318982.27,2248315.22&srs=epsg:27572&method=time

Response

The response is always in UTF-8 format.

JSON format 

{
   "message":null,
   "status":"OK",
   "origins":[
      "315846.96,2254268.35",
      "313584.77,2251648.97"
   ],
   "destinations":[
      "321442.89,2251013.98",
      "318982.27,2248315.22"
   ],
   "srs":"epsg:27572",
   "rows":[
      {
         "cells":[
            {
               "distanceMeters":8109.0,
               "durationSeconds":656.74,
               "status":"OK"
            },
            {
               "distanceMeters":11249.37,
               "durationSeconds":888.57,
               "status":"OK"
            }
         ]
      },
      {
         "cells":[
            {
               "distanceMeters":11736.89,
               "durationSeconds":959.9,
               "status":"OK"
            },
            {
               "distanceMeters":7636.67,
               "durationSeconds":609.35,
               "status":"OK"
            }
         ]
      }
   ]
}

JSON-P format 

MyCallBack({
   "message":null,
   "status":"OK",
   "origins":[
      "315846.96,2254268.35",
      "313584.77,2251648.97"
   ],
   "destinations":[
      "321442.89,2251013.98",
      "318982.27,2248315.22"
   ],
   "srs":"epsg:27572",
   "rows":[
      {
         "cells":[
            {
               "distanceMeters":8109.0,
               "durationSeconds":656.74,
               "status":"OK"
            },
            {
               "distanceMeters":11249.37,
               "durationSeconds":888.57,
               "status":"OK"
            }
         ]
      },
      {
         "cells":[
            {
               "distanceMeters":11736.89,
               "durationSeconds":959.9,
               "status":"OK"
            },
            {
               "distanceMeters":7636.67,
               "durationSeconds":609.35,
               "status":"OK"
            }
         ]
      }
   ]
});

XML format 

<?xml version="1.0" encoding="UTF-8"?>
<matrixResultV4>
   <status>OK</status>
   <origins>
      <origin>315846.96,2254268.35</origin>
      <origin>313584.77,2251648.97</origin>
   </origins>
   <destinations>
      <destination>321442.89,2251013.98</destination>
      <destination>318982.27,2248315.22</destination>
   </destinations>
   <srs>epsg:27572</srs>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>8109.0</distanceMeters>
               <durationSeconds>656.74</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>11249.37</distanceMeters>
               <durationSeconds>888.57</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>11736.89</distanceMeters>
               <durationSeconds>959.9</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>7636.67</distanceMeters>
               <durationSeconds>609.35</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV4>

Possible responses

Case of an itinerary that has been found (matrixResultV3/status is OK) 

<?xml version="1.0" encoding="UTF-8"?>
<matrixResultV4>
   <status>OK</status>
   <origins>
      <origin>315846.96,2254268.35</origin>
      <origin>313584.77,2251648.97</origin>
   </origins>
   <destinations>
      <destination>321442.89,2251013.98</destination>
      <destination>318982.27,2248315.22</destination>
   </destinations>
   <srs>epsg:27572</srs>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>8109.0</distanceMeters>
               <durationSeconds>656.74</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>11249.37</distanceMeters>
               <durationSeconds>888.57</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>11736.89</distanceMeters>
               <durationSeconds>959.9</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>7636.67</distanceMeters>
               <durationSeconds>609.35</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV4>

Case of forgotten origin and destination specification(matrixResultV3/status is ERROR) 

<matrixResultV4>
   <message>Origins and destinations must be not null</message>
   <status>ERROR</status>
</matrixResultV4>

Case of a faulty type (serviceResult/status is ERROR) 

<serviceResult>
        <message>NumberFormatException: For input string: "AAA"</message>
        <status>ERROR</status>
</serviceResult>

Case of a snap-to-graph error (matrixResultV3/status is OK) / (cell/status est KO) 

<matrixResultV4>
   <status>OK</status>
   <origins>
      <origin>-0.36147,49.18392</origin>
      <origin>7.26132,43.70629</origin>
   </origins>
   <destinations>
      <destination>146.08821,48.43253</destination>
      <destination>2.34878,48.86473</destination>
   </destinations>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>0.0</distanceMeters>
               <durationSeconds>0.0</durationSeconds>
               <status>KO</status>
            </cell>
            <cell>
               <distanceMeters>234196.77000000002</distanceMeters>
               <durationSeconds>9451.57</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>0.0</distanceMeters>
               <durationSeconds>0.0</durationSeconds>
               <status>KO</status>
            </cell>
            <cell>
               <distanceMeters>930934.64</distanceMeters>
               <durationSeconds>31773.440000000002</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV4>

Case of a problem with the graph: absent file, faulty filepath, etc… (serviceResult/status is ERROR) 

<serviceResult>
   <message>ServiceException: Error in matrix computation
Error in smartrouting
datasource is null</message>
   <status>ERROR</status>
</serviceResult>

V3

Parameters / properties

Input

parameter description optional default

srs

projection (ESPG code such as epsg:4326 or wgs84)

yes

origins

List of coordinates of points of origin. The longitude and latitude coordinates are separated by the ,, character

yes *

originNodes

List of origin ids nodes. ids nodes are separated by , characters. Care: a physical node does not have the same ID in another graph.

yes *

destinations

List of coordinates of destination points. The latitude and longitude cooordinates are separated by the , character.

yes *

destinationNodes

List of destination ids nodes. ids nodes are separated by , characters. Care: a physical node does not have the same ID in another graph.

yes *

graphName

Name of the graph to use
This parameter is omitted if the configName parameter is used.

yes

method

shortest (distance) or fastest (time) route

yes

time

profileId

Vehicle identifier (saved under vehicle profiles)
This parameter is omitted if the configName parameter is used.

yes

profileName

Vehicle profile (saved under vehicle profiles)
This parameter is omitted if the configName parameter is used.

yes

exclusions

List of restriction rules to use, separated by the , or ; character (Example: "Toll", "Tunnel", "Bridge")

yes

startDateTime

Departure date and time (format ISO8601: local time). Example: 2014-01-21T09:00:00.000+01:00 (or 2014-01-21T09:00:00.000%2B01:00) for a start on 21 January 2014, at 9.00am in Paris. Caution: the + character may be misinterpreted by browsers, and so it is best replaced by %2B.

yes

snapMethod

Snap-to-graph method
- standard: to the nearest connectable road section
- extended: via restricted road sections (pedestrian routes…)
- nearest: to the nearest road section only
- unrestricted: without any restriction rules - nodes: snap directly to nodes indicated by locationNode and the node parameters of resources

yes

standard

avoidArea

Forbidden transit zone in WKT format (POLYGON or MULTIPOLYGON) in the requested projection (srs parameter)
Example in wgs84 : POLYGON ((-1.556892 47.21689, -1.556892 47.216904, [...] -1.556892 47.21689)) - MULTIPOLYGON (((-1.556892 47.21689, -1.556892 47.216904, [...] -1.556892 47.21689)), ((-1.558639 47.218144, -1.558639 47.218193, [...] -1.558639 47.218144)))
Care: WKT geometries must be closed.

yes

configName

Name of the configuration to use (defined in Geoconcept Web - Administration / Tools / Road graphs)
This replaces use of graphName, profileId and profileName

yes

maxCost

Maximum cost not to exceed in the results
-1: no maximum cost to take into account
0: take the default value defined in the SmartRouting Server configuration
if not: value in metres if method=distance or in seconds if method=time

yes

(*) At least one of the two pairs of parameters origins/destinations or originNodes/destinationsNodes must have values assigned.

Output

Matrix (matrixResultV3)

parameter type min/max description

origins/origin (or origins in JSON / JSON-P)

string (or array of origins/origin in JSON / JSON-P)

0/unlimited

origin positions.

destinations/destination (or destinations in JSON / JSON-P)

string (or array of destinations/destination in JSON / JSON-P)

0/unlimited

destination positions.

rows/row (or rows in JSON / JSON-P)

matrixRowV3 (or array of rows/row (matrixRow) in JSON / JSON-P)

0/unlimited

Matrix line

Matrix line (matrixRowV3)

parameter type min/max description

cells/cell (or cells in JSON / JSON-P)

matrixCellV3 (or array of cells/cell (matrixCellV3) in JSON / JSON-P)

0/unlimited

Matrix cell

Matrix cell (matrixCellV3)

parameter type min/max description

distanceMeters

double

1/1

Matrix cell distance (in metres)

durationSeconds

double

1/1

Matrix cell duration (in seconds)

status

string

0/1

Matrix cell status:
- OK: the itinerary has been found for this cell
- KO: no itinerary found for this cell

SOAP

WSDL

http://<server>/<webapp>/api/ws/matrixService?wsdl

Query

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas">
   <soapenv:Header/>
   <soapenv:Body>
      <sch:matrixV3>
         <!--Optional:-->
         <request>
            <!--Optional:-->
            <srs>epsg:27572</srs>
            <!--Optional:-->
            <origins>
               <!--1 or more repetitions:-->
               <origin>
                  <x>315846.96</x>
                  <y>2254268.35</y>
               </origin>
                <origin>
                              <x>313584.77</x>
                  <y>2251648.97</y>
               </origin>
            </origins>
            <!--Optional:-->
            <originNodes>
               <!--1 or more repetitions:-->
               <originNode></originNode>
            </originNodes>
            <!--Optional:-->
            <destinations>
               <!--1 or more repetitions:-->
               <destination>
                  <x>321442.89</x>
                  <y>2251013.98</y>
               </destination>
                <destination>
                  <x>318982.27</x>
                  <y>2248315.22</y>
               </destination>
            </destinations>
            <!--Optional:-->
            <destinationNodes>
               <!--1 or more repetitions:-->
               <destinationNode></destinationNode>
            </destinationNodes>
            <!--Optional:-->
            <graphName></graphName>
            <!--Optional:-->
            <method>time</method>
            <!--Optional:-->
            <profileId></profileId>
            <!--Optional:-->
            <profileName></profileName>
            <!--Optional:-->
            <exclusions>
               <!--Zero or more repetitions:-->
               <exclusion></exclusion>
            </exclusions>
            <!--Optional:-->
            <startDateTime></startDateTime>
            <!--Optional:-->
            <snapMethod></snapMethod>
            <!--Optional:-->
            <avoidArea></avoidArea>
            <!--Optional:-->
            <configName></configName>
            <!--Optional:-->
            <maxCost>0</maxCost>
         </request>
      </sch:matrixV3>
   </soapenv:Body>
</soapenv:Envelope>

Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:matrixV3Response xmlns:ns2="http://geoconcept.com/gc/schemas">
         <MatrixResult>
            <status>OK</status>
            <origins>
               <origin>315846.96,2254268.35</origin>
               <origin>313584.77,2251648.97</origin>
            </origins>
            <destinations>
               <destination>321442.89,2251013.98</destination>
               <destination>318982.27,2248315.22</destination>
            </destinations>
            <srs>epsg:27572</srs>
            <rows>
               <row>
                  <cells>
                     <cell>
                        <distanceMeters>8109.0</distanceMeters>
                        <durationSeconds>564.66</durationSeconds>
                        <status>OK</status>
                     </cell>
                     <cell>
                        <distanceMeters>11249.37</distanceMeters>
                        <durationSeconds>816.38</durationSeconds>
                        <status>OK</status>
                     </cell>
                  </cells>
               </row>
               <row>
                  <cells>
                     <cell>
                        <distanceMeters>11736.89</distanceMeters>
                        <durationSeconds>856.77</durationSeconds>
                        <status>OK</status>
                     </cell>
                     <cell>
                        <distanceMeters>7636.67</distanceMeters>
                        <durationSeconds>526.1</durationSeconds>
                        <status>OK</status>
                     </cell>
                  </cells>
               </row>
            </rows>
         </MatrixResult>
      </ns2:matrixV3Response>
   </soap:Body>
</soap:Envelope>
REST

Query

JSON query 

http://<server>/<webapp>/api/lbs/matrix/v3.json?origins=315846.96,2254268.35;313584.77,2251648.97&destinations=321442.89,2251013.98;318982.27,2248315.22&srs=epsg:27572&method=time

JSON-P query 

http://<server>/<webapp>/api/lbs/matrix/v3.json?origins=315846.96,2254268.35;313584.77,2251648.97&destinations=321442.89,2251013.98;318982.27,2248315.22&srs=epsg:27572&method=time&callback=myCallback

XML query 

http://<server>/<webapp>/api/lbs/matrix/v3.xml?origins=315846.96,2254268.35;313584.77,2251648.97&destinations=321442.89,2251013.98;318982.27,2248315.22&srs=epsg:27572&method=time

Response

The response is always in UTF-8 format.

JSON format 

{
   "message":null,
   "status":"OK",
   "origins":[
      "315846.96,2254268.35",
      "313584.77,2251648.97"
   ],
   "destinations":[
      "321442.89,2251013.98",
      "318982.27,2248315.22"
   ],
   "srs":"epsg:27572",
   "rows":[
      {
         "cells":[
            {
               "distanceMeters":8109.0,
               "durationSeconds":656.74,
               "status":"OK"
            },
            {
               "distanceMeters":11249.37,
               "durationSeconds":888.57,
               "status":"OK"
            }
         ]
      },
      {
         "cells":[
            {
               "distanceMeters":11736.89,
               "durationSeconds":959.9,
               "status":"OK"
            },
            {
               "distanceMeters":7636.67,
               "durationSeconds":609.35,
               "status":"OK"
            }
         ]
      }
   ]
}

JSON-P format 

MyCallBack({
   "message":null,
   "status":"OK",
   "origins":[
      "315846.96,2254268.35",
      "313584.77,2251648.97"
   ],
   "destinations":[
      "321442.89,2251013.98",
      "318982.27,2248315.22"
   ],
   "srs":"epsg:27572",
   "rows":[
      {
         "cells":[
            {
               "distanceMeters":8109.0,
               "durationSeconds":656.74,
               "status":"OK"
            },
            {
               "distanceMeters":11249.37,
               "durationSeconds":888.57,
               "status":"OK"
            }
         ]
      },
      {
         "cells":[
            {
               "distanceMeters":11736.89,
               "durationSeconds":959.9,
               "status":"OK"
            },
            {
               "distanceMeters":7636.67,
               "durationSeconds":609.35,
               "status":"OK"
            }
         ]
      }
   ]
});

XML format 

<?xml version="1.0" encoding="UTF-8"?>
<matrixResultV3>
   <status>OK</status>
   <origins>
      <origin>315846.96,2254268.35</origin>
      <origin>313584.77,2251648.97</origin>
   </origins>
   <destinations>
      <destination>321442.89,2251013.98</destination>
      <destination>318982.27,2248315.22</destination>
   </destinations>
   <srs>epsg:27572</srs>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>8109.0</distanceMeters>
               <durationSeconds>656.74</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>11249.37</distanceMeters>
               <durationSeconds>888.57</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>11736.89</distanceMeters>
               <durationSeconds>959.9</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>7636.67</distanceMeters>
               <durationSeconds>609.35</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV3>

Possible responses

Case of an itinerary that has been found (matrixResultV3/status is OK) 

<?xml version="1.0" encoding="UTF-8"?>
<matrixResultV3>
   <status>OK</status>
   <origins>
      <origin>315846.96,2254268.35</origin>
      <origin>313584.77,2251648.97</origin>
   </origins>
   <destinations>
      <destination>321442.89,2251013.98</destination>
      <destination>318982.27,2248315.22</destination>
   </destinations>
   <srs>epsg:27572</srs>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>8109.0</distanceMeters>
               <durationSeconds>656.74</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>11249.37</distanceMeters>
               <durationSeconds>888.57</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>11736.89</distanceMeters>
               <durationSeconds>959.9</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>7636.67</distanceMeters>
               <durationSeconds>609.35</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV3>

Case of forgotten origin and destination specification(matrixResultV3/status is ERROR) 

<matrixResultV3>
   <message>Origins and destinations must be not null</message>
   <status>ERROR</status>
</matrixResultV3>

Case of a faulty type (serviceResult/status is ERROR) 

<serviceResult>
        <message>NumberFormatException: For input string: "AAA"</message>
        <status>ERROR</status>
</serviceResult>

Case of a snap-to-graph error (matrixResultV3/status is OK) / (cell/status est KO) 

<matrixResultV3>
   <status>OK</status>
   <origins>
      <origin>-0.36147,49.18392</origin>
      <origin>7.26132,43.70629</origin>
   </origins>
   <destinations>
      <destination>146.08821,48.43253</destination>
      <destination>2.34878,48.86473</destination>
   </destinations>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>0.0</distanceMeters>
               <durationSeconds>0.0</durationSeconds>
               <status>KO</status>
            </cell>
            <cell>
               <distanceMeters>234196.77000000002</distanceMeters>
               <durationSeconds>9451.57</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>0.0</distanceMeters>
               <durationSeconds>0.0</durationSeconds>
               <status>KO</status>
            </cell>
            <cell>
               <distanceMeters>930934.64</distanceMeters>
               <durationSeconds>31773.440000000002</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV3>

Case of a problem with the graph: absent file, faulty filepath, etc… (serviceResult/status is ERROR) 

<serviceResult>
   <message>ServiceException: Error in matrix computation
Error in smartrouting
datasource is null</message>
   <status>ERROR</status>
</serviceResult>

V2

Parameters / properties

Input

parameter description optional default

srs

projection (ESPG code such as epsg:4326 or wgs84)

yes

origins

List of coordinates of points of origin. The longitude and latitude coordinates are separated by the ,, character

yes

destinations

List of coordinates of destination points. The latitude and longitude cooordinates are separated by the , character.

yes

graphName

Name of the graph to use

yes

method

shortest (distance) or fastest (time) route

yes

time

profileId

Vehicle identifier (saved under vehicle profiles) to use

yes

profileName

Vehicle profile (saved under vehicle profiles) to use

yes

exclusions

List of restriction rules to use, separated by the , or ; character (Example: "Toll", "Tunnel", "Bridge")

yes

startDateTime

Start Date and Time (format ISO8601: local time). Example: 2014-01-21T09:00:00.000+01:00 (or 2014-01-21T09:00:00.000%2B01:00) for a start on 21 January 2014, at 9.00am in Paris

yes

snapMethod

Snap-to-graph method
- standard: to the nearest connectable road section
- extended: via restricted road sections (pedestrian routes…)
- nearest: to the nearest road section only
- unrestricted: without any restriction rules

yes

standard

Output

Matrix (matrixResultV2)

parameter type min/max description

origins/origin (or origins in JSON / JSON-P)

string (or array of origins/origin in JSON / JSON-P)

0/unlimited

origin positions.

destinations/destination (or destinations in JSON / JSON-P)

string (or array of destinations/destination in JSON / JSON-P)

0/unlimited

destination positions.

rows/row (or rows in JSON / JSON-P)

matrixRowV2 (or array of rows/row (matrixRow) in JSON / JSON-P)

0/unlimited

Matrix line

Matrix line (matrixRowV2)

parameter type min/max description

cells/cell (or cells in JSON / JSON-P)

matrixCellV2 (or array of cells/cell (matrixCellV2) in JSON / JSON-P)

0/unlimited

Matrix cell

Matrix cell (matrixCellV2)

parameter type min/max description

distanceMeters

double

1/1

Matrix cell distance (in metres)

durationSeconds

double

1/1

Matrix cell duration (in seconds)

status

string

0/1

Matrix cell status:
- OK: the itinerary has been found for this cell
- KO: no itinerary found for this cell

SOAP

WSDL

http://<server>/<webapp>/api/ws/matrixService?wsdl

Query

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas">
   <soapenv:Header/>
   <soapenv:Body>
      <sch:matrixV2>
         <!--Optional:-->
         <request>
            <!--Optional:-->
            <srs>epsg:27572</srs>
            <!--Optional:-->
            <origins>
               <!--1 or more repetitions:-->
               <origin>
                  <x>315846.96</x>
                  <y>2254268.3500000001</y>
               </origin>
                <origin>
                           <x>313584.77</x>
                  <y>2251648.9700000002</y>
               </origin>
            </origins>
            <!--Optional:-->
            <destinations>
               <!--1 or more repetitions:-->
               <destination>
                  <x>321442.89</x>
                  <y>2251013.98</y>
               </destination>
                <destination>
                  <x>318982.27</x>
                  <y>2248315.2200000002</y>
               </destination>
            </destinations>
            <!--Optional:-->
            <graphName></graphName>
            <!--Optional:-->
            <method>time</method>
            <!--Optional:-->
            <profileId></profileId>
            <!--Optional:-->
            <profileName></profileName>
            <!--Optional:-->
            <exclusions>
               <!--Zero or more repetitions:-->
               <exclusion></exclusion>
            </exclusions>
            <!--Optional:-->
            <startDateTime></startDateTime>
            <!--Optional:-->
            <snapMethod></snapMethod>
         </request>
      </sch:matrixV2>
   </soapenv:Body>
</soapenv:Envelope>

Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:matrixV2Response xmlns:ns2="http://geoconcept.com/gc/schemas">
         <MatrixResult>
            <status>OK</status>
            <origins>
               <origin>315846.96,2254268.35</origin>
               <origin>313584.77,2251648.97</origin>
            </origins>
            <destinations>
               <destination>321442.89,2251013.98</destination>
               <destination>318982.27,2248315.22</destination>
            </destinations>
            <srs>epsg:27572</srs>
            <rows>
               <row>
                  <cells>
                     <cell>
                        <distanceMeters>8109.04</distanceMeters>
                        <durationSeconds>894.48</durationSeconds>
                        <status>OK</status>
                     </cell>
                     <cell>
                        <distanceMeters>11127.53</distanceMeters>
                        <durationSeconds>873.21</durationSeconds>
                        <status>OK</status>
                     </cell>
                  </cells>
               </row>
               <row>
                  <cells>
                     <cell>
                        <distanceMeters>11736.87</distanceMeters>
                        <durationSeconds>1158.04</durationSeconds>
                        <status>OK</status>
                     </cell>
                     <cell>
                        <distanceMeters>7514.82</distanceMeters>
                        <durationSeconds>615.79</durationSeconds>
                        <status>OK</status>
                     </cell>
                  </cells>
               </row>
            </rows>
         </MatrixResult>
      </ns2:matrixV2Response>
   </soap:Body>
</soap:Envelope>
REST

Query

JSON query 

http://<server>/<webapp>/api/lbs/matrix/v2.json?origins=315846.96,2254268.3500000001;313584.77,2251648.9700000002&destinations=321442.89,2251013.98;318982.27,2248315.2200000002&srs=epsg:27572&method=time

JSON-P query 

http://<server>/<webapp>/api/lbs/matrix/v2.json?origins=315846.96,2254268.3500000001;313584.77,2251648.9700000002&destinations=321442.89,2251013.98;318982.27,2248315.2200000002&srs=epsg:27572&method=time&callback=myCallback

XML query 

http://<server>/<webapp>/api/lbs/matrix/v2.xml?origins=315846.96,2254268.3500000001;313584.77,2251648.9700000002&destinations=321442.89,2251013.98;318982.27,2248315.2200000002&srs=epsg:27572&method=time

Response

The response is always in UTF-8 format.

JSON format 

{
   "message":null,
   "status":"OK",
   "origins":[
      "315846.96,2254268.35",
      "313584.77,2251648.97"
   ],
   "destinations":[
      "321442.89,2251013.98",
      "318982.27,2248315.22"
   ],
   "srs":"epsg:27572",
   "rows":[
      {
         "cells":[
            {
               "distanceMeters":8109.04,
               "durationSeconds":894.48,
               "status":"OK"
            },
            {
               "distanceMeters":11127.53,
               "durationSeconds":873.21,
               "status":"OK"
            }
         ]
      },
      {
         "cells":[
            {
               "distanceMeters":11736.87,
               "durationSeconds":1158.04,
               "status":"OK"
            },
            {
               "distanceMeters":7514.82,
               "durationSeconds":615.79,
               "status":"OK"
            }
         ]
      }
   ]
}

JSON-P format 

MyCallBack({
   "message":null,
   "status":"OK",
   "origins":[
      "315846.96,2254268.35",
      "313584.77,2251648.97"
   ],
   "destinations":[
      "321442.89,2251013.98",
      "318982.27,2248315.22"
   ],
   "srs":"epsg:27572",
   "rows":[
      {
         "cells":[
            {
               "distanceMeters":8109.04,
               "durationSeconds":894.48,
               "status":"OK"
            },
            {
               "distanceMeters":11127.53,
               "durationSeconds":873.21,
               "status":"OK"
            }
         ]
      },
      {
         "cells":[
            {
               "distanceMeters":11736.87,
               "durationSeconds":1158.04,
               "status":"OK"
            },
            {
               "distanceMeters":7514.82,
               "durationSeconds":615.79,
               "status":"OK"
            }
         ]
      }
   ]
});

XML format 

<matrixResultV2>
   <status>OK</status>
   <origins>
      <origin>-0.36147,49.18392</origin>
      <origin>7.26132,43.70629</origin>
   </origins>
   <destinations>
      <destination>0.08821,48.43253</destination>
      <destination>2.34878,48.86473</destination>
   </destinations>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>107526.06</distanceMeters>
               <durationSeconds>4906.25</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>234196.77000000002</distanceMeters>
               <durationSeconds>9451.57</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>1103695.95</distanceMeters>
               <durationSeconds>37887.43</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>930934.64</distanceMeters>
               <durationSeconds>31773.440000000002</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV2>

Possible responses

Case of a found itinerary (matrixResultV2/status is OK) 

<?xml version="1.0" encoding="UTF-8"?>
<matrixResultV2>
   <status>OK</status>
   <origins>
      <origin>315846.96,2254268.35</origin>
      <origin>313584.77,2251648.97</origin>
   </origins>
   <destinations>
      <destination>321442.89,2251013.98</destination>
      <destination>318982.27,2248315.22</destination>
   </destinations>
   <srs>epsg:27572</srs>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>8109.04</distanceMeters>
               <durationSeconds>894.48</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>11127.53</distanceMeters>
               <durationSeconds>873.21</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>11736.87</distanceMeters>
               <durationSeconds>1158.04</durationSeconds>
               <status>OK</status>
            </cell>
            <cell>
               <distanceMeters>7514.82</distanceMeters>
               <durationSeconds>615.79</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV2>

Case of forgotten origin or destination specification (matrixResultV2/status is ERROR) 

<matrixResultV2>
   <message>Origins and destinations must be not null</message>
   <status>ERROR</status>
</matrixResultV2>

Case of a faulty type (serviceResult/status is ERROR) 

<serviceResult>
        <message>NumberFormatException: For input string: "AAA"</message>
        <status>ERROR</status>
</serviceResult>

Case of a snap-to-graph error (matrixResultV2/status is OK) / (cell/status est KO) 

<matrixResultV2>
   <status>OK</status>
   <origins>
      <origin>-0.36147,49.18392</origin>
      <origin>7.26132,43.70629</origin>
   </origins>
   <destinations>
      <destination>146.08821,48.43253</destination>
      <destination>2.34878,48.86473</destination>
   </destinations>
   <rows>
      <row>
         <cells>
            <cell>
               <distanceMeters>0.0</distanceMeters>
               <durationSeconds>0.0</durationSeconds>
               <status>KO</status>
            </cell>
            <cell>
               <distanceMeters>234196.77000000002</distanceMeters>
               <durationSeconds>9451.57</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
      <row>
         <cells>
            <cell>
               <distanceMeters>0.0</distanceMeters>
               <durationSeconds>0.0</durationSeconds>
               <status>KO</status>
            </cell>
            <cell>
               <distanceMeters>930934.64</distanceMeters>
               <durationSeconds>31773.440000000002</durationSeconds>
               <status>OK</status>
            </cell>
         </cells>
      </row>
   </rows>
</matrixResultV2>

Case of a problem with the graph: absent file, faulty filepath, etc… (serviceResult/status is ERROR) 

<serviceResult>
   <message>ServiceException: Error in matrix computation
Error in smartrouting
datasource is null</message>
   <status>ERROR</status>
</serviceResult>

V1

Parameters / properties

Input

parameter description optional default

srs

projection (ESPG code such as epsg:4326 or wgs84)

yes

origins

List of coordinates of points of origin. The longitude and latitude coordinates are separated by the ,, character

yes

destinations

List of coordinates of destination points. The latitude and longitude cooordinates are separated by the , character.

yes

graphName

Name of the graph to use

yes

method

shortest (distance) or fastest (time) route

yes

time

profileId

Vehicle identifier (saved under vehicle profiles) to use

yes

profileName

Vehicle profile (saved under vehicle profiles) to use

yes

rejectFlags

Deprecated, replaced by exclusions

exclusions

List of restriction rules to use, separated by the , or ; character (Example: "Toll", "Tunnel", "Bridge")

yes

Output

Matrix (matrixResult)

parameter type min/max description

originLocations/originLocation (or originLocations in JSON / JSON-P)

string (or array of originLocations/originLocation in JSON / JSON-P)

0/unlimited

origin positions

destinationLocations/destinationLocation (or destinationLocations in JSON / JSON-P)

string (or array of destinationLocations/destinationLocation in JSON / JSON-P)

0/unlimited

destination positions

rows/row (or rows in JSON / JSON-P)

matrixRow (or array of rows/row (matrixRow) in JSON / JSON-P)

0/unlimited

Matrix line

Matrix line (matrixRow)

parameter type min/max description

cells/cell (or cells in JSON / JSON-P)

matrixCell (or array of cells/cell (matrixCell) in JSON / JSON-P)

0/unlimited

Matrix cell

Matrix cell (matrixCell)

parameter type min/max description

distance

double

1/1

Matrix cell distance (in metres)

duration

double

1/1

Matrix cell duration (in seconds)

status

string

0/1

Matrix cell status:
- OK: the itinerary has been found for this cell
- KO: no itinerary found for this cell

SOAP

WSDL

http://<server>/<webapp>/api/ws/matrixService?wsdl

Query

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas">
   <soapenv:Header/>
   <soapenv:Body>
      <sch:matrix>
         <!--Optional:-->
         <request>
            <!--Optional:-->
            <srs></srs>
            <!--Optional:-->
            <origins>
               <!--1 or more repetitions:-->
               <origin>
                  <x>-0.361470</x>
                  <y>49.183920</y>
               </origin>
               <origin>
                  <x>7.261320</x>
                  <y>43.706290</y>
               </origin>
            </origins>
            <!--Optional:-->
            <destinations>
               <!--1 or more repetitions:-->
               <destination>
                  <x>0.088210</x>
                  <y>48.432530</y>
               </destination>
               <destination>
                  <x>2.348780</x>
                  <y>48.864730</y>
               </destination>
            </destinations>
            <!--Optional:-->
            <graphName></graphName>
            <!--Optional:-->
            <method></method>
            <!--Optional:-->
            <profileId></profileId>
            <!--Optional:-->
            <profileName></profileName>
            <!--Optional:-->
            <exclusions></exclusions>
         </request>
      </sch:matrix>
   </soapenv:Body>
</soapenv:Envelope>

Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:matrixResponse xmlns:ns2="http://geoconcept.com/gc/schemas">
         <MatrixResult>
            <status>OK</status>
            <originLocations>
                                <originLocation>-0,361470;49,183920</originLocation>
                                <originLocation>7,261320;43,706290</originLocation>
            </originLocations>
            <destinationLocations>
                                <destinationLocation>0,088210;48,432530</destinationLocation>
                                <destinationLocation>2,348780;48,864730</destinationLocation>
            </destinationLocations>
            <rows>
               <row>
                  <cells>
                     <cell>
                        <distance>107898.07</distance>
                        <duration>3592.48</duration>
                        <status>OK</status>
                     </cell>
                     <cell>
                        <distance>233393.72</distance>
                        <duration>7063.8</duration>
                        <status>OK</status>
                     </cell>
                  </cells>
               </row>
               <row>
                  <cells>
                     <cell>
                        <distance>1105102.84</distance>
                        <duration>32465.86</duration>
                        <status>OK</status>
                     </cell>
                     <cell>
                        <distance>931394.85</distance>
                        <duration>27277.25</duration>
                        <status>OK</status>
                     </cell>
                  </cells>
               </row>
            </rows>
         </MatrixResult>
      </ns2:matrixResponse>
   </soap:Body>
</soap:Envelope>
REST

Query

JSON query 

http://<server>/<webapp>/api/lbs/matrix.json?origins=-0.36147,49.18392;7.26132,43.70629&destinations=0.08821,48.43253;2.34878,48.86473

JSON-P query 

http://<server>/<webapp>/api/lbs/matrix.json?origins=-0.36147,49.18392;7.26132,43.70629&destinations=0.08821,48.43253;2.34878,48.86473&callback=myCallback

XML query 

http://<server>/<webapp>/api/lbs/matrix.xml?origins=-0.36147,49.18392;7.26132,43.70629&destinations=0.08821,48.43253;2.34878,48.86473

Response

The response is always in UTF-8 format.

JSON format 

{
   "message":null,
   "status":"OK",
   "originLocations":[
      "-0,361470;49,183920",
      "7,261320;43,706290"
   ],
   "destinationLocations":[
      "0,088210;48,432530",
      "2,348780;48,864730"
   ],
   "rows":[
      {
         "cells":[
            {
               "distance":107528.37,
               "duration":5139.2300000000005,
               "status":"OK"
            },
            {
               "distance":234732.19,
               "duration":9880.54,
               "status":"OK"
            }
         ]
      },
      {
         "cells":[
            {
               "distance":1103920.65,
               "duration":38946.42,
               "status":"OK"
            },
            {
               "distance":930731.03,
               "duration":32689.65,
               "status":"OK"
            }
         ]
      }
   ]
}

JSON-P format 

myCallback(
        {
           "message":null,
           "status":"OK",
           "originLocations":[
                  "-0,361470;49,183920",
                  "7,261320;43,706290"
           ],
           "destinationLocations":[
                  "0,088210;48,432530",
                  "2,348780;48,864730"
           ],
           "rows":[
                  {
                         "cells":[
                                {
                                   "distance":107528.37,
                                   "duration":5139.2300000000005,
                                   "status":"OK"
                                },
                                {
                                   "distance":234732.19,
                                   "duration":9880.54,
                                   "status":"OK"
                                }
                         ]
                  },
                  {
                         "cells":[
                                {
                                   "distance":1103920.65,
                                   "duration":38946.42,
                                   "status":"OK"
                                },
                                {
                                   "distance":930731.03,
                                   "duration":32689.65,
                                   "status":"OK"
                                }
                         ]
                  }
           ]
        }
);

XML format 

<matrixResult>
        <status>OK</status>
        <originLocations>
                <originLocation>-0,361470;49,183920</originLocation>
                <originLocation>7,261320;43,706290</originLocation>
        </originLocations>
        <destinationLocations>
                <destinationLocation>0,088210;48,432530</destinationLocation>
                <destinationLocation>2,348780;48,864730</destinationLocation>
        </destinationLocations>
        <rows>
                <row>
                        <cells>
                                <cell>
                                        <distance>107528.37</distance>
                                        <duration>5139.2300000000005</duration>
                                        <status>OK</status>
                                </cell>
                                <cell>
                                        <distance>234732.19</distance>
                                        <duration>9880.54</duration>
                                        <status>OK</status>
                                </cell>
                        </cells>
                </row>
                <row>
                        <cells>
                                <cell>
                                        <distance>1103920.65</distance>
                                        <duration>38946.42</duration>
                                        <status>OK</status>
                                </cell>
                                <cell>
                                        <distance>930731.03</distance>
                                        <duration>32689.65</duration>
                                        <status>OK</status>
                                </cell>
                        </cells>
                </row>
        </rows>
</matrixResult>

Possible responses

Case of an itinerary that has been found (matrixResult/status is OK) 

<matrixResult>
        <status>OK</status>
        <originLocations>
                <originLocation>-0,361470;49,183920</originLocation>
                <originLocation>7,261320;43,706290</originLocation>
        </originLocations>
        <destinationLocations>
                <destinationLocation>0,088210;48,432530</destinationLocation>
                <destinationLocation>2,348780;48,864730</destinationLocation>
        </destinationLocations>
        <rows>
                <row>
                        <cells>
                                <cell>
                                        <distance>107528.37</distance>
                                        <duration>5139.2300000000005</duration>
                                        <status>OK</status>
                                </cell>
                                <cell>
                                        <distance>234732.19</distance>
                                        <duration>9880.54</duration>
                                        <status>OK</status>
                                </cell>
                        </cells>
                </row>
                <row>
                        <cells>
                                <cell>
                                        <distance>1103920.65</distance>
                                        <duration>38946.42</duration>
                                        <status>OK</status>
                                </cell>
                                <cell>
                                        <distance>930731.03</distance>
                                        <duration>32689.65</duration>
                                        <status>OK</status>
                                </cell>
                        </cells>
                </row>
        </rows>
</matrixResult>

Case of forgetting to specify the origin and destination (matrixResult/status is OK) 

<matrixResult>
        <status>OK</status>
        <originLocations/>
        <destinationLocations/>
</matrixResult>

Case of a faulty type (serviceResult/status is ERROR) 

<serviceResult>
        <message>NumberFormatException: For input string: "AAA"</message>
        <status>ERROR</status>
</serviceResult>

Case of a snap-to-graph error (matrixResult/status is OK) / (matrixCell/status is KO) 

<matrixResult>
        <status>OK</status>
        <originLocations>
                <originLocation>-0,361470;49,183920</originLocation>
                <originLocation>57,261320;43,706290</originLocation>
        </originLocations>
        <destinationLocations>
                <destinationLocation>0,088210;48,432530</destinationLocation>
                <destinationLocation>2,348780;48,864730</destinationLocation>
        </destinationLocations>
        <rows>
                <row>
                        <cells>
                                <cell>
                                        <distance>107528.37</distance>
                                        <duration>5139.2300000000005</duration>
                                        <status>OK</status>
                                </cell>
                                <cell>
                                        <distance>234732.19</distance>
                                        <duration>9880.54</duration>
                                        <status>OK</status>
                                </cell>
                        </cells>
                </row>
                <row>
                        <cells>
                                <cell>
                                        <distance>0.0</distance>
                                        <duration>0.0</duration>
                                        <status>KO</status>
                                </cell>
                                <cell>
                                        <distance>0.0</distance>
                                        <duration>0.0</duration>
                                        <status>KO</status>
                                </cell>
                        </cells>
                </row>
        </rows>
</matrixResult>

Case of a problem with the graph: absent file, faulty filepath, etc… (serviceResult/status is ERROR) 

<serviceResult>
   <message>ServiceException: Error in matrix computation
Error in smartrouting
datasource is null</message>
   <status>ERROR</status>
</serviceResult>

FAQ

1. Can I use aliases instead of .siti file names to call a datasource?
2. How can I use route statistics?
3. How can I perform a route matrix calculation excluding toll roads?
4. What are Speed Patterns? How can I use them?

1.

Can I use aliases instead of .siti file names to call a datasource?

Yes, refer to details in the FAQ of the reverse geocoding Web Service.

2.

How can I use route statistics?

Check that the graph does contain these statistics and use these two parameters: computeOptions with a value of trafficPatterns and startDateTime to specify the departure date/time.

3.

How can I perform a route matrix calculation excluding toll roads?

If the Toll constraint has been included in the graph, place an exclusion in exclusions:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas">
   <soapenv:Header/>
   <soapenv:Body>
      <sch:matrix>
         <!--Optional:-->
         <request>
            <!--Optional:-->
            <srs></srs>
            <!--Optional:-->
            <origins>
               <!--1 or more repetitions:-->
               <origin>
                  <x>-0.361470</x>
                  <y>49.183920</y>
               </origin>
               <origin>
                  <x>7.261320</x>
                  <y>43.706290</y>
               </origin>
            </origins>
            <!--Optional:-->
            <destinations>
               <!--1 or more repetitions:-->
               <destination>
                  <x>0.088210</x>
                  <y>48.432530</y>
               </destination>
               <destination>
                  <x>2.348780</x>
                  <y>48.864730</y>
               </destination>
            </destinations>
            <!--Optional:-->
            <graphName></graphName>
            <!--Optional:-->
            <method></method>
            <!--Optional:-->
            <profileId></profileId>
            <!--Optional:-->
            <profileName></profileName>
            <!--Optional:-->
            <exclusions>Toll</exclusions>
         </request>
      </sch:matrix>
   </soapenv:Body>
</soapenv:Envelope>

4.

What are Speed Patterns? How can I use them?

In order to propose journey times that are as accurate as possible and reflect changing traffic conditions, graphs supplied by GEOCONCEPT SAS include, from version M18 upwards, 5 speed profiles (Speed Patterns) for cars and lorries, to take into account the different levels of congestion during the course of one day:

  • standard normal-speed corresponds to the speed at a time when the roads have an average congestion level (eg 11.00am)
  • night fast-speed corresponds to a very fluid traffic situation, often experienced at night-time (3.00am)
  • congested slow-speed corresponds to the times when traffic is densest (8.00am)
  • rush hour very-slow-speed corresponds to times when traffic is densest in urban and built-up areas, and is slower than the speed above (8.00am)
  • default default corresponds to speeds averaged out over an entire day

To use them, you need to pass to parameter, when calling the web service, the computeOptions parameter with the speedPattern option and specify the value of the Speed Pattern requested, without forgetting a vehicle profile
Example:

+

&computeOptions=speedPattern:fast-speed&profileId=1
How to use Heavy Goods Vehicle attributes?

The graph must include the attributes for Heavy Goods Vehicles (as standard in the graphs supplied by GEOCONCEPT SAS from version M18 upwards) and either calculate an itinerary using a vehicle profile using restrictions (cf. the catalogue of vehicles, editable, defined in the SmartRoutingVehicles.xml file, stored in the folder `‘<GEOCONCEPT_WEB_HOME>’'\smartrouting\jee\smartrouting\conf\ ), or overwrite the call to the web service by using the computeOptions parameter with the options length, width, height, weight, axles and/or weightPerAxle.
Example for a journey with a vehicle 4.5 metres high:

&computeOptions=height:450