Pickup and delivery

Basic principles

The pickup and delivery service can be used to list the best solutions for pickup/collection and drop-off/delivery, whether for the transport of people or of goods.

The web service takes two types of data input:

  • Existing journeys
  • Pickup/collection points and drop-off/delivery points

The algorithm explores the solutions to find a pair that includes one pick-up point and one drop-off point in the existing journeys. It returns, for each journey, the best detours possible among the candidates (pick-up and drop-off points).

In the case where only one candidate (pickup or drop-off) is available, the web service tries to insert one step in existing journeys instead of two.

pickup and delivery example

{
        "url":"https://api.geoconcept.com/EU/GCW/geoconcept-web/api/lbs/pickupDelivery.json",
        "method":"POST",
        "body":
    {
      "routes" : [ {
        "id" : "trip_1",
        "departure" : {
          "lat" : "47.333990",
          "lon" : "-1.805604"
        },
        "arrival" : {
          "lat" : "47.479740",
          "lon" : "-1.095251"
        },
        "waypoints" : [ {
          "id" : "waypoint_1",
          "location" : {
            "lat" : "47.157530",
            "lon" : "-1.421958"
          }
        }]
      }],
      "pickupPoints" : [ {
        "id" : "depMeet_1",
        "location" : {
          "lat" : "47.228659",
          "lon" : "-1.600995"
        }
      }],
      "deliveryPoints" : [ {
        "id" : "arrMeet_1",
        "location" : {
          "lat" : "47.293823",
          "lon" : "-1.480789"
        }
      }],
      "constraints" : {
        "maxDetourDuration" : 3600,
        "minSharedDistance" : 0.1
      },
      "sortOptions" : {
        "routesAndCandidatesSortCriterium" : "MIN_DETOUR_DURATION"
      },
      "configName":"car",
      "size" : {
        "routes" : 1,
        "candidates" : 1
      }
    }
}

Parameters / properties

Input

parameter type optional description

routes

array of routes/route (pickupDeliveryRouteInput)

No

Table of journeys as input. Pre-existing journeys in which candidates must be inserted.

pickupPoints

array of pickupPoints/pickupPoint (wayPoint)

Yes

Table of candidate pick-up points to insert in journeys.

deliveryPoints

array of deliveryPoints/deliveryPoint (wayPoint)

Yes

Table of possible drop-off candidates to insert in journeys.

constraints

(pickupDeliveryConstraints)

Yes

Definition of constraints to filter the journeys to use.

sortOptions

(pickupDeliverySortingOptions)

Yes

Definition of the sort on the results.

srs

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

yes

configName

Name of the configuration to use:
- car
- truck

yes

snapMethod

Snap to graph method
- standard: to the nearest connectable road segment
- 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 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

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

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

size

(pickupDeliverySizes)

No

Number of journeys and candidates to return.

dataVersionHash

string

Yes

Graph identifier (non-utilised)

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

(pickupDeliveryRouteInput) journeys as input

parameter type optional description

id

string

No

Journey identifier

departure

(location)

No

Start point coordinates

arrival

(location)

No

Finish point coordinates

distance

long

Yes

Journey distance (in meters)

duration

long

Yes

Journey duration (in seconds)

waypoints

Array of wayPoint

Yes

List of journey steps

(wayPoint) steps

parameter type optional description

id

string

No

Step identifier

location

(location)

No

Step coordinates

stopoverPosition

long

Yes

Position of the step in the journey, if the step is a stop. If no values are assigned, this step is just a waypoint.

(location) coordinates

parameter type optional description

lat

double

No

Latitude of the point (in wgs84)

long

double

No

Longitude of the point (in wgs84)

nodeId

string

Yes

Graph node. Caution: a physical node does not have the same ID in another graph.

(pickupDeliveryConstraints) contraintes

parameter type optional description

maxDetourDuration

long

Yes

Maximum duration of detour (in seconds). Only resulting journeys for which the duration added is less than this limit will be returned by the web service.
The detour duration is defined as:
(duration with detour) - (duration without detour)

minSharedDistance

long

Yes

Minimum value of common distance ratio. Only those resulting journeys for which the common distance ratio exceeds this limit will be returned by the web service.
The common distance ratio is defined as:
(common distance) / (total distance with detour)

(pickupDeliverySortingOptions) sort

parameter type optional description

routesAndCandidatesSortCriterium

(sortCriteriaEnum)

Yes

Sort options:
- MIN_DETOUR_DURATION = sort (ascending) results according to detour duration
- MIN_DETOUR_DISTANCE = sort (ascending) results according to detour distance
- MAX_SHARED_DISTANCE = sort (descending) results according to common distance ratio

(pickupDeliverySizes) number of returns

parameter type optional description

routes

long

No

Maximum number of journeys to return.

candidates

long

No

Maximum number of candidates to return for each journey.

Output

parameter type description

results

array of results/result (pickupDeliveryRouteResult)

List of journeys calculated.

(pickupDeliveryRouteResult) list of journeys calculated

parameter type description

routeId

string

List of journeys calculated.

candidates

array of candidates/candidate (pickupDeliveryRouteCandidate)

List of possible detours for the journey.

(pickupDeliveryRouteCandidate) list of detours possible for the journey

parameter type description

pickup

(meetingPointCandidate)

Pick-up candidate.

delivery

(meetingPointCandidate)

Drop-off candidate.

sharedRouteDuration

long

Common journey duration (in seconds).

sharedRouteDistance

long

Common journey distance (in meters).

totalDurationWithDetour

long

Total journey duration including the detour (in seconds).

totalDistanceWithDetour

long

Total journey distance including the detour (in meters).

detourDuration

long

Detour duration = (duration with detour) - (original journey duration)

detourDistance

long

Detour distance = (distance with detour) - (original journey distance)

sharedDistance

double

Common distance = ratio between (common distance) and (Total journey distance including the detour)

(meetingPointCandidate) candidates

parameter type description

meetingPointId

string

Identifier for the pickup/drop-off location

duration

long

For a pickup link: duration from the journey departure point to the pickup point (in seconds)
For a drop-off point: duration from the journey drop-off point to the arrival point (in seconds)

distance

long

For a pickup link: distance from the journey departure point to the pickup point (in meters)
For a drop-off point: the distance from the journey drop-off point to the arrival point (in meters)

meetingPointSubPath

int

Optimum segment position (in the journey) for the pickup/drop-off point.

Possible returns

Case of an optimization applied successfully 

{
   "steps": [
      {
        "x": 2.33906,
        "y": 48.84467,
        "id": "1",
        "duration": 600000,
        "effectiveStart": 0,
        "driveDistanceBefore": 0,
        "driveDistanceAfter": 5057,
        "driveTimeBefore": 0,
        "driveTimeAfter": 737740,
        "timeWindows": [
          {
            "start": 0,
            "end": 3600000
          },
          [...]
        ]
      },
      [...]
   ],
   "distanceMeters": 13502,
   "durationSeconds": 2015
}

FAQ

1. How perform a route calculation without including any road tolls?
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 perform a route calculation without including any road tolls?

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