Matrix calculation

[Warning] Warning

This web service is deprecated use compact matrix calculation web service instead.

Basic principles

This web service calculates a route matrix for a series of points and returns a distance matrix. The distance and time computations are based on the actual road network.

Matrix example

{
   "url":"https://api.geoconcept.com/EU/GCW/geoconcept-web/api/lbs/matrix/v4.json",
   "method": "POST",
   "body":
   {
      "origins": [
         {
            "x": 6.961438,
            "y": 50.932713
         },
         {
            "x": 6.942641,
            "y": 50.92259
         }
      ],
      "destinations": [
         {
            "x": 6.973438,
            "y": 50.939732
         },
         {
            "x": 7.106549,
            "y": 50.879707
         }
      ],
      "srs": "WGS84",
      "method": "time",
   }
}

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. The pairs of coordinates are separated by the ";" character.

yes

destinations

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

yes

method

shortest (distance) or fastest (time) route

yes

time

exclusions

List of restriction rules to use, separated by the ; character
Available exclusion rules:
- Toll
- Infrastructure (Tunnel, Bridge)
- Hazardous material (Flammable, Dangerous, Pollutant, Toxic)
- ZFE (Zone � faible �mission, France-only) - …
- Detailled list available on the FAQ bellow.

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 walkways…)
- nearest: to the nearest road section only
- unrestricted: without any restriction rules
- nodes: snap directly to nodes supplied by the originNode originNode, destinationNode and waypointNodes parameters or, if these first ones are not filled, snap directly to the nearest nodes 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:
- bicycle (not available for Japan)
- bus
- car
- delivery light vehicle
- delivery truck vehicle
- emergency truck
- emergency vehicle
- pedestrian (not available for Japan)
- taxi
- truck

yes

computeOptions

Selection of variables to use in calculations, using semi-colons ; as separators:
- speedPattern: utilization as a speed pattern. Use: "speedPattern:slow-speed"
- length: maximum authorised length in centimeters. Use: "length:950"
- width: maximum authorised width in centimeters. Use: "width:255"
- height: maximum authorised height in centimeters. Use: "height:360"
- weight: maximum authorised weight in kilograms. Use: "weight:18000"
- axles: maximum authorised number of axels. Use: "axles:2"
- weightPerAxle: maximum authorised weight per axel in kilograms. Use: "weightPerAxle:9000"
- fuelType: fuel type used to calculate carbon footprint for the journey. Available values are: "UndefinedFuelType", "NoFuel", "Diesel", "UnleadedFuel", "LGP", "CustomFuelType" and "Electrical". Use: "fuelType:Diesel"
- averageConsumption: average consumption in litres for 100 kilometers or Wh per kilometers if electrical vehicle. Use: "averageConsumption:6.45"
- cityAverageConsumption: average consumption value in city mode, in litres per 100 kilometers, or Wh per kilometers if electrical vehicle. Use: "cityAverageConsumption:4.65"
- combinedAverageConsumption: average consumption value in combined mode, in litres per 100 kilometers, or Wh per kilometers if electrical vehicle. Use: "combinedAverageConsumption:5.12"
- highwayAverageConsumption: average consumption value in highway mode, in value in litres per 100 kilometers, or Wh per kilometers if electrical vehicle. Use: "highwayAverageConsumption:5.64" - customAverageCO2UnitEmission: defines the carbon footprint in kilograms per litre. Use: "customAverageCO2UnitEmission:2.724"
- snapSpeed: snap-to-graph speed in kilometers per hour. Use: "snapSpeed:10"

yes

Output

Matrix (matrixResult)

parameter type min/max description

origins

Array of string

0/unlimited

List of the origin positions. Every position is a string of the longitude and latitude coordinates separated by the "," character.

destinations

Array of string

0/unlimited

List of the destination positions. Every position is a string of the longitude and latitude coordinates separated by the "," character.

srs

string

0/1

projection passed as input (EPSG code such as epsg:4326 or wgs84)

rows

Array of matrixRow

0/unlimited

Matrix line

Matrix line (matrixRow)

parameter type min/max description

cells

Array of matrixCell

0/unlimited

Matrix cell

Matrix cell (matrixCell)

parameter type min/max description

distanceMeters

double

1/1

Matrix cell distance (in meters)

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

Possible returns

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

{
  "message": null,
  "status": "OK",
  "origins": [
    "6.961438,50.932713",
    "6.942641,50.92259"
  ],
  "destinations": [
    "6.973438,50.939732",
    "7.106549,50.879707"
  ],
  "srs": "epsg:4326",
  "rows": [
    {
      "cells": [
        {
          "distanceMeters": 2119.74,
          "durationSeconds": 332.65,
          "status": "OK"
        },
        {
          "distanceMeters": 14177.7,
          "durationSeconds": 1014.98,
          "status": "OK"
        }
      ]
    },
    {
      "cells": [
        {
          "distanceMeters": 3702.02,
          "durationSeconds": 559.35,
          "status": "OK"
        },
        {
          "distanceMeters": 15231.24,
          "durationSeconds": 1181.95,
          "status": "OK"
        }
      ]
    }
  ]
}

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

{
  "message":"Origins and destinations must be not null",
  "status":"ERROR"
}

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

{
  "message":"NumberFormatException: For input string: \"ghs5\"",
  "status":"ERROR"
}

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

{
  "message": null,
  "status": "OK",
  "origins": [
    "6.961438,50.932713",
    "50.92259,6.942641"
  ],
  "destinations": [
    "6.973438,50.939732",
    "7.106549,50.879707"
  ],
  "srs": "epsg:4326",
  "rows": [
    {
      "cells": [
        {
          "distanceMeters": 2119.74,
          "durationSeconds": 332.65,
          "status": "OK"
        },
        {
          "distanceMeters": 14177.7,
          "durationSeconds": 1014.98,
          "status": "OK"
        }
      ]
    },
    {
      "cells": [
        {
          "distanceMeters": -1,
          "durationSeconds": -1,
          "status": "KO"
        },
        {
          "distanceMeters": -1,
          "durationSeconds": -1,
          "status": "KO"
        }
      ]
    }
  ]
}

FAQ

1. How can I perform a toll-free route matrix calculation?
2. What are the maximum values allowed by predefined configName?
3. What are the exclusions available?
4. What are the Hazardous material exclusions?
5. What are Speed Patterns? How are they used?
6. How do you use heavy goods vehicle attributes?

1.

How can I perform a toll-free route matrix calculation?

Place the exclusion Toll in exclusions.

2.

What are the maximum values allowed by predefined configName?

See list below:

configName axles weightPerAxle weight height length width

bicycle

bus

2

9500

19000

350

1350

250

car

delivery light vehicle

2

1700

3400

300

680

220

delivery truck vehicle

2

9500

19000

350

1350

250

emergency truck vehicle

2

9000

18000

360

920

255

emergency vehicle

pedestrian

taxi

truck

4

19000

39000

387

1850

255

3.

What are the exclusions available?

See list below:

Exclusion Description

Toll

if added on exclusions toll road sections are not used.

BoatFerry

if added on exclusions ferry itineraries (shipping) over water are not used.

RailFerry

if added on exclusions ferry (or train) itineraries (over water and land respectively) are not used.

Tunnel

if added on exclusions tunnels are not used.

Bridge

if added on exclusions bridges are not used.

Frontage

if added on exclusions Frontage roads (local roads running parallel to a higher-speed, limited-access road) are not used.

Paved

if added on exclusions tarmac road sections are not used.

Private

if added on exclusions road sections for which maintenance is provided by a private organization are not used.

Pedestrians

if added on exclusions road sections unauthorised for pedestrian use are not used. The configName parameter with a value of pedestrian uses this exclusion.

Automobiles

if added on exclusions road sections with restricted automobile access are not used. The configName parameter with a value of car uses this exclusion.

Trucks

if added on exclusions road sections with restricted access for lorries are not used. The configName with a value of truck or delivery truck vehicle or emergency truck uses this exclusion.

Bus

if added on exclusions road sections with restricted access for buses are not used. The configName with a value of bus uses this exclusion.

Deliveries

if added on exclusions road sections with restricted access for deliveries are not used. The configName with a value of delivery light vehicle or delivery truck vehicle uses this exclusion.

Taxis

if added on exclusions road sections with restricted access for taxis are not used. The configName with a value of taxi uses this exclusion.

Emergencies

if added on exclusions road sections with restricted access for emergencies are not used. The configName with a value of emergency truck or emergency vehicle uses this exclusion.

Carpools

if added on exclusions road sections with restricted access for carpools are not used.

Throughtraffic

if added on exclusions road sections with restricted access for non-local traffic are not used.

ZFE

if added on exclusions low carbon emmission areas in France will be excluded

(Hazardous material)

See description bellow.

4.

What are the Hazardous material exclusions?

Hazardous material defines a restriction to a road for any vehicle carrying the specific hazardous material. Hazardous material restrictions are government regulations and can be different per country.

  • Flammable: explosives, flammable, gas, combustible, …
  • Pollutant: goods harmful for water
  • Toxic: organic, poison, radioactive, corrosive, …
  • Dangerous: tunnel categories and others restrictions

5.

What are Speed Patterns? How are they used?

With the aim of suggesting journey times that take traffic conditions into account as accurately as possible, cars and trucks have 5 speed profiles (Speed Patterns) so various levels of road congestion can be taken into account over the timespan of a whole day:

  • standard normal-speed corresponds to the speed at a time when the traffic congestion is moderate (11h)
  • night fast-speed corresponds to very fluid traffic conditions, most often found at night time (3h)
  • busy slow-speed corresponds to the times when traffic congestion is at its densest (8h)
  • peak travel time very-slow-speed corresponds to times when traffic is densest in urban areas, and is slower than the category given above (8h)
  • default default corresponds to average speeds over a whole day

To use these, you will need to pass to parameter, when calling the web service, the following parameter computeOptions with the option speedPattern and specify the value of the Speed Pattern requested, always remembering to include a vehicle configName.
Example:

&computeOptions=speedPattern:fast-speed&configName=car

6.

How do you use heavy goods vehicle attributes?

You need to calculate an itinerary using either a vehicle configName using the restrictions, or by overwriting the call to the web service using the parameter computeOptions with the options length, width, height, weight, axles and/or weightPerAxle.
Example for a journey with a vehicle with a height of 4.5m:

&computeOptions=height:450