(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.
This web service allows you to define optimum routes while minimising travel times and distances. The ordering of points to visit is optimised on the basis of geographic and operational constraints (time slots, duration of the visit..;). It is based on the configured graph, the name of which has been specified in the Geoconcept Web administration interface.
This web service is a Geoconcept Web option: please contact us to know how to purchase this service.
Earlier versions of the web service are conserved in Geoconcept Web to ensure compatibility with earlier software versioning and development. We recommend using the most recent version.
Changes in relation to V3
- Addition of various input parameters: "graphName", "profileId", "profileName", "configName", "snapMethod", "exclusions", "startDateTime", "avoidArea", "computeOptions", "maxCost" and "timeOut".
- Addition in output of the list of "unreachableSteps", these being the route stops that could not be visited.
Changes in relation to V2
- Addition of the "timewindows/timewindow" parameter.
- The "totalDistance" and "totalTime" parameters have been renamed "distanceMeters" and "durationSeconds" respectively.
- The Web service is no longer available in REST GET.
Input
parameter | description | optional | default |
---|---|---|---|
origin (optimRouteStepV3) |
origin point (id,x,y) |
yes |
|
destination (optimRouteStepV3) |
destination point (id,x,y) |
yes |
|
steps (optimRouteStepV3) |
points to visit (id,x,y;id,x,y;…) |
no |
|
method |
shortest (distance) or fastest (time) route |
yes |
time |
graphName |
"Name of the graph to use |
yes |
|
profileId |
Vehicle identifier (saved in the vehicle profiles) |
yes |
|
profileName |
Vehicle profile (saved in the vehicle profiles) |
yes |
|
configName |
Name of the configuration to use (defined in Geoconcept Web - Administration / Tools / Road graphs) |
yes |
|
snapMethod |
Snap to graph method |
yes |
standard |
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 departure date on 21 Januray 2014, at 9.00am in Paris. Caution: the + character may be misinterpreted by some browsers, and in this instance, you will need to replace it with %2B. |
yes |
|
avoidArea |
Forbidden transit zone in WKT format (POLYGON or MULTIPOLYGON) in the requested projection (srs parameter) |
yes |
|
computeOptions |
List of options for the calculation,separated by ; characters |
yes |
|
matrixProvider |
matrix calculation provider |
yes |
smartrouting |
matrix |
time/distance matrix (id1,id2,temps,distance;…) |
yes |
|
srs |
projection (EPSG code such as epsg:4326 or wgs84) |
yes |
wgs84 |
directSpeed |
Default speed during utilisation of globe or euclidean matrices |
yes |
50 |
maxCost |
Maximum cost not to exceed in the calculation |
yes |
|
timeOut |
Time out for the calculation (in milliseconds) |
yes |
(optimRouteStepV3) steps
parameter | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
point id |
duration |
long |
1/1 |
duration of a visit, in milliseconds. O by default |
timeWindows/timeWindow (optimTimeWindow) |
long |
1/1 |
Time windows |
Time windows (optimTimeWindow)
parameter | type | min/max | description |
---|---|---|---|
start |
long |
1/1 |
start of the time window, in milliseconds. 0 by default. |
end |
long |
1/1 |
time window end, in milliseconds. Long.MAX_VALUE by default |
Output
parameter | type | min/max | description |
---|---|---|---|
steps/step |
array (optimRouteStepV3) |
0/unlimited |
list of route stops in sequence |
distanceMeters |
long |
1/1 |
total journey distance in meters |
durationSeconds |
long |
1/1 |
total journey time in seconds |
unreachableSteps |
array (OptimUnreachableStepV3) |
0/unlimited |
list of unreachable route stops. |
(optimRouteStepV3) steps
parameter | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
route stop ID |
x |
number |
1/1 |
route stop’s X coordinate |
y |
number |
1/1 |
route stop’s Y coordinate |
duration |
long |
1/1 |
duration of a visit, in milliseconds. O by default |
effectiveStart |
long |
1/1 |
effective start time for a visit, in milliseconds |
driveDistanceBefore |
int |
1/1 |
drive time before the step, in metres |
driveDistanceAfter |
int |
1/1 |
drive distance after the step, in metres |
driveTimeBefore |
long |
1/1 |
drive time before the step, in milliseconds |
driveTimeAfter |
long |
1/1 |
drive time after the step, in milliseconds |
timeWindows/timeWindow (optimTimeWindow) |
long |
1/1 |
Time windows |
Time windows (optimTimeWindow)
parameter | type | min/max | description |
---|---|---|---|
start |
long |
1/1 |
start of the time window, in milliseconds. 0 by default. |
end |
long |
1/1 |
time window end, in milliseconds. Long.MAX_VALUE by default |
List of unreachable route stops (OptimUnreachableStepV3)
parameter | type | min/max | description |
---|---|---|---|
id |
string |
1/1 |
route stop ID |
x |
double |
1/1 |
Route stop’s Longitudinal position |
y |
double |
1/1 |
Route stop’s Latitudinal position |
WSDL
http://<server>
/<webapp>
/api/ws/optimService?wsdl
Query
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas"> <soapenv:Header /> <soapenv:Body> <sch:optimRouteV3> <request> <origin> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <id>1</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </origin> <destination> <x>-1.5405963750884433</x> <y>47.19752774053115</y> <id>5</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </destination> <steps> <step> <x>-1.5315788375137436</x> <y>47.209701524818236</y> <id>2</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> <timeWindows> <!--Zero or more repetitions:--> <timeWindow> <start>0</start> <end>9223372036854775807</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5391738246474214</x> <y>47.193576663578824</y> <id>3</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> <timeWindows> <!--Zero or more repetitions:--> <timeWindow> <start>0</start> <end>9223372036854775807</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5562968681202867</x> <y>47.21808294131743</y> <id>4</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </step> </steps> <srs>epsg:4326</srs> <method>time</method> </request> </sch:optimRouteV3> </soapenv:Body> </soapenv:Envelope>
Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:optimRouteV3Response xmlns:ns2="http://geoconcept.com/gc/schemas"> <OptimRouteResult> <steps> <step> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <id>1</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>1779</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>372710</driveTimeAfter> <timeWindows/> </step> <step> <x>-1.5391738246474214</x> <y>47.193576663578824</y> <id>3</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>1779</driveDistanceBefore> <driveDistanceAfter>3486</driveDistanceAfter> <driveTimeBefore>372710</driveTimeBefore> <driveTimeAfter>752870</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>9223372036854775807</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5562968681202867</x> <y>47.21808294131743</y> <id>4</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>3486</driveDistanceBefore> <driveDistanceAfter>3175</driveDistanceAfter> <driveTimeBefore>752870</driveTimeBefore> <driveTimeAfter>662230</driveTimeAfter> <timeWindows/> </step> <step> <x>-1.5315788375137436</x> <y>47.209701524818236</y> <id>2</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>3175</driveDistanceBefore> <driveDistanceAfter>2713</driveDistanceAfter> <driveTimeBefore>662230</driveTimeBefore> <driveTimeAfter>520090</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>9223372036854775807</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5405963750884433</x> <y>47.19752774053115</y> <id>5</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>2713</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>520090</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> <timeWindows/> </step> </steps> <distanceMeters>11153</distanceMeters> <durationSeconds>2307</durationSeconds> </OptimRouteResult> </ns2:optimRouteV3Response> </soap:Body> </soap:Envelope>
Query
Query
http://<server>/<webapp>/api/lbs/optim/route.xml
Data (XML)
<?xml version="1.0" encoding="UTF-8"?> <optimRouteRequestV3> <origin> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <!--Optional:--> <id>1</id> <timeWindows> <timeWindow> <start>09:00</start> <end>20:00</end> </timeWindow> </timeWindows> </origin> <destination> <x>-1.5405963750884433</x> <y>47.19752774053115</y> <!--Optional:--> <id>5</id> </destination> <steps> <step> <x>-1.5315788375137436</x> <y>47.209701524818236</y> <id>2</id> <timeWindows> <timeWindow> <start>09:00</start> <end>20:00</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5391738246474214</x> <y>47.193576663578824</y> <id>3</id> </step> <step> <x>-1.5562968681202867</x> <y>47.21808294131743</y> <id>4</id> </step> </steps> <method>time</method> <srs>epsg:4326</srs> <matrixProvider>SMARTROUTING</matrixProvider> </optimRouteRequestV3>
Response
The response is always in UTF-8 format
XML Format
<optimRouteResultV3> <steps> <step> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <id>1</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>1779</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>372710</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>0</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5391738246474214</x> <y>47.193576663578824</y> <id>3</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>1779</driveDistanceBefore> <driveDistanceAfter>3486</driveDistanceAfter> <driveTimeBefore>372710</driveTimeBefore> <driveTimeAfter>752870</driveTimeAfter> <timeWindows/> </step> <step> <x>-1.5562968681202867</x> <y>47.21808294131743</y> <id>4</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>3486</driveDistanceBefore> <driveDistanceAfter>3175</driveDistanceAfter> <driveTimeBefore>752870</driveTimeBefore> <driveTimeAfter>662230</driveTimeAfter> <timeWindows/> </step> <step> <x>-1.5315788375137436</x> <y>47.209701524818236</y> <id>2</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>3175</driveDistanceBefore> <driveDistanceAfter>2713</driveDistanceAfter> <driveTimeBefore>662230</driveTimeBefore> <driveTimeAfter>520090</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>0</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5405963750884433</x> <y>47.19752774053115</y> <id>5</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>2713</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>520090</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> <timeWindows/> </step> </steps> <distanceMeters>11153</distanceMeters> <durationSeconds>2307</durationSeconds> </optimRouteResultV3>
case of an optimization applied successfully
<optimRouteResultV3> <steps> <step> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <id>1</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>1779</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>372710</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>0</end> </timeWindow> </timeWindows> </step> <step> [...] </step> </steps> <distanceMeters>11153</distanceMeters> <durationSeconds>2307</durationSeconds> </optimRouteResultV3>
Case of a problem with the graph: absent file, faulty filepath, etc ⇒ error with faultstring containing the description
<soap:Fault> <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode> <faultstring>Error in matrix computation Error in smartrouting datasource is null</faultstring> </soap:Fault>
Input
parameter | description | optional | default |
---|---|---|---|
origin (optimRouteStepV2) |
origin point (id,x,y) |
yes |
|
destination (optimRouteStepV2) |
destination point (id,x,y) |
yes |
|
steps (optimRouteStepV2) |
points to visit (id,x,y;id,x,y;…) |
no |
|
method |
shortest (distance) or fastest (time) route |
yes |
time |
matrixProvider |
matrix calculation provider |
yes |
smartrouting |
matrix |
time/distance matrix (id1,id2,temps,distance;…) |
yes |
|
srs |
projection (EPSG code such as epsg:4326 or wgs84) |
yes |
wgs84 |
directSpeed |
Default speed during utilisation of globe or euclidean matrices |
yes |
50 |
(optimRouteStepV2) steps
parameter | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
point id |
duration |
long |
1/1 |
duration of a visit, in milliseconds. O by default |
timeWindows/timeWindow (optimTimeWindow) |
long |
1/1 |
Time windows |
Time windows (optimTimeWindow)
parameter | type | min/max | description |
---|---|---|---|
start |
long |
1/1 |
start of the time window, in milliseconds. 0 by default. |
end |
long |
1/1 |
time window end, in milliseconds. Long.MAX_VALUE by default |
Output
parameter | type | min/max | description |
---|---|---|---|
steps/step |
array (optimRouteStepV2) |
0/unlimited |
ordered points to visit |
distanceMeters |
long |
1/1 |
total journey distance in meters |
durationSeconds |
long |
1/1 |
total journey time in seconds |
(optimRouteStepV2) steps
parameter | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
point id |
duration |
long |
1/1 |
duration of a visit, in milliseconds. O by default |
effectiveStart |
long |
1/1 |
effective start time for a visit, in milliseconds |
driveDistanceBefore |
int |
1/1 |
drive time before the step, in metres |
driveDistanceAfter |
int |
1/1 |
drive distance after the step, in metres |
driveTimeBefore |
long |
1/1 |
drive time before the step, in milliseconds |
driveTimeAfter |
long |
1/1 |
drive time after the step, in milliseconds |
timeWindows/timeWindow (optimTimeWindow) |
long |
1/1 |
Time windows |
Time windows (optimTimeWindow)
parameter | type | min/max | description |
---|---|---|---|
start |
long |
1/1 |
start of the time window, in milliseconds. 0 by default. |
end |
long |
1/1 |
time window end, in milliseconds. Long.MAX_VALUE by default |
WSDL
http://<server>
/<webapp>
/api/ws/optimService?wsdl
Query
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas"> <soapenv:Header /> <soapenv:Body> <sch:optimRouteV2> <request> <origin> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <id>1</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </origin> <destination> <x>-1.5405963750884433</x> <y>47.19752774053115</y> <id>5</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </destination> <steps> <step> <x>-1.5315788375137436</x> <y>47.209701524818236</y> <id>2</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> <timeWindows> <!--Zero or more repetitions:--> <timeWindow> <start>0</start> <end>9223372036854775807</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5391738246474214</x> <y>47.193576663578824</y> <id>3</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> <timeWindows> <!--Zero or more repetitions:--> <timeWindow> <start>0</start> <end>9223372036854775807</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5562968681202867</x> <y>47.21808294131743</y> <id>4</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </step> </steps> <srs>epsg:4326</srs> <method>time</method> </request> </sch:optimRouteV2> </soapenv:Body> </soapenv:Envelope>
Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:optimRouteV2Response xmlns:ns2="http://geoconcept.com/gc/schemas"> <OptimRouteResult> <steps> <step> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <id>1</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>1779</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>372710</driveTimeAfter> <timeWindows/> </step> <step> <x>-1.5391738246474214</x> <y>47.193576663578824</y> <id>3</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>1779</driveDistanceBefore> <driveDistanceAfter>3486</driveDistanceAfter> <driveTimeBefore>372710</driveTimeBefore> <driveTimeAfter>752870</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>9223372036854775807</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5562968681202867</x> <y>47.21808294131743</y> <id>4</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>3486</driveDistanceBefore> <driveDistanceAfter>3175</driveDistanceAfter> <driveTimeBefore>752870</driveTimeBefore> <driveTimeAfter>662230</driveTimeAfter> <timeWindows/> </step> <step> <x>-1.5315788375137436</x> <y>47.209701524818236</y> <id>2</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>3175</driveDistanceBefore> <driveDistanceAfter>2713</driveDistanceAfter> <driveTimeBefore>662230</driveTimeBefore> <driveTimeAfter>520090</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>9223372036854775807</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5405963750884433</x> <y>47.19752774053115</y> <id>5</id> <duration>3600000</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>2713</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>520090</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> <timeWindows/> </step> </steps> <distanceMeters>11153</distanceMeters> <durationSeconds>2307</durationSeconds> </OptimRouteResult> </ns2:optimRouteV2Response> </soap:Body> </soap:Envelope>
Query
Query
http://<server>/<webapp>/api/lbs/optim/route.xml
Data (XML)
<?xml version="1.0" encoding="UTF-8"?> <optimRouteRequestV2> <origin> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <!--Optional:--> <id>1</id> <timeWindows> <timeWindow> <start>09:00</start> <end>20:00</end> </timeWindow> </timeWindows> </origin> <destination> <x>-1.5405963750884433</x> <y>47.19752774053115</y> <!--Optional:--> <id>5</id> </destination> <steps> <step> <x>-1.5315788375137436</x> <y>47.209701524818236</y> <id>2</id> <timeWindows> <timeWindow> <start>09:00</start> <end>20:00</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5391738246474214</x> <y>47.193576663578824</y> <id>3</id> </step> <step> <x>-1.5562968681202867</x> <y>47.21808294131743</y> <id>4</id> </step> </steps> <method>time</method> <srs>epsg:4326</srs> <matrixProvider>SMARTROUTING</matrixProvider> </optimRouteRequestV2>
Response
The response is always in UTF-8 format
XML Format
<optimRouteResultV2> <steps> <step> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <id>1</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>1779</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>372710</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>0</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5391738246474214</x> <y>47.193576663578824</y> <id>3</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>1779</driveDistanceBefore> <driveDistanceAfter>3486</driveDistanceAfter> <driveTimeBefore>372710</driveTimeBefore> <driveTimeAfter>752870</driveTimeAfter> <timeWindows/> </step> <step> <x>-1.5562968681202867</x> <y>47.21808294131743</y> <id>4</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>3486</driveDistanceBefore> <driveDistanceAfter>3175</driveDistanceAfter> <driveTimeBefore>752870</driveTimeBefore> <driveTimeAfter>662230</driveTimeAfter> <timeWindows/> </step> <step> <x>-1.5315788375137436</x> <y>47.209701524818236</y> <id>2</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>3175</driveDistanceBefore> <driveDistanceAfter>2713</driveDistanceAfter> <driveTimeBefore>662230</driveTimeBefore> <driveTimeAfter>520090</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>0</end> </timeWindow> </timeWindows> </step> <step> <x>-1.5405963750884433</x> <y>47.19752774053115</y> <id>5</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>2713</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>520090</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> <timeWindows/> </step> </steps> <distanceMeters>11153</distanceMeters> <durationSeconds>2307</durationSeconds> </optimRouteResultV2>
case of an optimization applied successfully
<optimRouteResultV2> <steps> <step> <x>-1.5291995940651142</x> <y>47.19158811606974</y> <id>1</id> <duration>0</duration> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>1779</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>372710</driveTimeAfter> <timeWindows> <timeWindow> <start>0</start> <end>0</end> </timeWindow> </timeWindows> </step> <step> [...] </step> </steps> <distanceMeters>11153</distanceMeters> <durationSeconds>2307</durationSeconds> </optimRouteResultV2>
Case of a problem with the graph: absent file, faulty filepath, etc ⇒ error with faultstring containing the description
<soap:Fault> <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode> <faultstring>Error in matrix computation Error in smartrouting datasource is null</faultstring> </soap:Fault>
Input
parameter | description | optional | default |
---|---|---|---|
origin |
origin point (id,x,y) |
yes |
|
destination |
destination point (id,x,y) |
yes |
|
steps |
points to visit (id,x,y;id,x,y;…) |
no |
|
method |
shortest (distance) or fastest (time) route |
yes |
time |
matrixProvider |
matrix calculation provider |
yes |
smartrouting |
matrix |
time/distance matrix (id1,id2,temps,distance;…) |
yes |
|
srs |
projection (EPSG code such as epsg:4326 or wgs84) |
yes |
wgs84 |
directSpeed |
Default speed during utilisation of globe or euclidean matrices |
yes |
50 |
Output
parameter | type | min/max | description |
---|---|---|---|
steps/step |
array (optimRouteStep) |
0/unlimited |
ordered points to visit |
totalDistance |
long |
1/1 |
total journey distance in meters |
totalTime |
long |
1/1 |
total journey time in minutes |
Steps (optimRouteStep)
parameter | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
point id |
duration |
long |
1/1 |
duration of a visit, in milliseconds. O by default |
timeWindowStart |
long |
1/1 |
start of the time window, in milliseconds. 0 by default. |
timeWindowEnd |
long |
1/1 |
time window end, in milliseconds. Long.MAX_VALUE by default |
effectiveStart |
long |
1/1 |
effective start time for a visit, in milliseconds |
driveDistanceBefore |
int |
1/1 |
drive time before the step, in metres |
driveDistanceAfter |
int |
1/1 |
drive distance after the step, in metres |
driveTimeBefore |
long |
1/1 |
drive time before the step, in milliseconds |
driveTimeAfter |
long |
1/1 |
drive time after the step, in milliseconds |
WSDL
http://<server>
/<webapp>
/api/ws/optimService?wsdl
Query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas"> <soapenv:Header/> <soapenv:Body> <sch:optimRoute> <!--Optional:--> <request> <!--Optional:--> <origin> <x>-1.55306</x> <y>47.21812</y> <!--Optional:--> <id>0</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>0</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </origin> <!--Optional:--> <destination> <x>-2.2164099</x> <y>47.2806206</y> <!--Optional:--> <id>1</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>0</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </destination> <!--Optional:--> <steps> <!--Zero or more repetitions:--> <step> <x>-2.02616</x> <y>47.2835503</y> <!--Optional:--> <id>2</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>0</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </step> </steps> <!--Optional:--> <srs>wgs84</srs> <!--Optional:--> <method>time</method> <!--Optional:--> <matrixProvider>SMARTROUTING</matrixProvider> <!--Optional:--> <matrix> <!--Optional:--> <elements> <!--Zero or more repetitions:--> <element> <!--Optional:--> <origin></origin> <!--Optional:--> <destination></destination> <time>1</time> <distance>1</distance> </element> </elements> </matrix> <directSpeed>0</directSpeed> </request> </sch:optimRoute> </soapenv:Body> </soapenv:Envelope>
Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:optimRouteResponse xmlns:ns2="http://geoconcept.com/gc/schemas"> <OptimRouteResult> <steps> <step> <x>-1.55306</x> <y>47.21812</y> <id>0</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>0</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>47085</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>3139890</driveTimeAfter> </step> <step> <x>-2.02616</x> <y>47.2835503</y> <id>2</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>0</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>47085</driveDistanceBefore> <driveDistanceAfter>22124</driveDistanceAfter> <driveTimeBefore>3139890</driveTimeBefore> <driveTimeAfter>1488050</driveTimeAfter> </step> <step> <x>-2.2164099</x> <y>47.2806206</y> <id>1</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>0</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>22124</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>1488050</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </step> </steps> <totalDistance>69209</totalDistance> <totalTime>77</totalTime> </OptimRouteResult> </ns2:optimRouteResponse> </soap:Body> </soap:Envelope>
Query
Query
http://<server>/<webapp>/api/lbs/optim/route.xml
Data (XML)
<?xml version="1.0" encoding="UTF-8"?> <optimRouteRequest> <steps> <step> <x>-1.55306</x> <y>47.21812</y> <id>0</id> </step> <step> <x>-2.2164099</x> <y>47.2806206</y> <id>1</id> </step> <step> <x>-2.02616</x> <y>47.2835503</y> <id>2</id> </step> </steps> <method>time</method> <srs>wgs84</srs> <matrixProvider>SMARTROUTING</matrixProvider> </optimRouteRequest>
Response
The response is always in UTF-8 format
XML Format
<optimRouteResult> <steps> <step> <x>-2.02616</x> <y>47.2835503</y> <id>2</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>9223372036854775807</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>22124</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>1488050</driveTimeAfter> </step> <step> <x>-2.2164099</x> <y>47.2806206</y> <id>1</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>9223372036854775807</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>22124</driveDistanceBefore> <driveDistanceAfter>63139</driveDistanceAfter> <driveTimeBefore>1488050</driveTimeBefore> <driveTimeAfter>2992570</driveTimeAfter> </step> <step> <x>-1.55306</x> <y>47.21812</y> <id>0</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>9223372036854775807</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>63139</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>2992570</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </step> </steps> <totalDistance>85263</totalDistance> <totalTime>74</totalTime> </optimRouteResult>
Query
JSON query
http://<server>/<webapp>/api/lbs/optim/route.json?steps=0,-1.55306,47.21812;1,-2.2164099,47.2806206;2,-2.02616,47.2835503&method=time&srs=wgs84
JSON-P query
http://<server>/<webapp>/api/lbs/optim/route.json?steps=0,-1.55306,47.21812;1,-2.2164099,47.2806206;2,-2.02616,47.2835503&method=time&srs=wgs84&callback=myCallback
XML query
http://<server>/<webapp>/api/lbs/optim/route.xml?steps=0,-1.55306,47.21812;1,-2.2164099,47.2806206;2,-2.02616,47.2835503&method=time&srs=wgs84
Response
The response is always in UTF-8 format
JSON format
{ "steps": [ { "x": -2.02616, "y": 47.2835503, "id": "2", "duration": 0, "timeWindowStart": 0, "timeWindowEnd": 9223372036854775807, "effectiveStart": 0, "driveDistanceBefore": 0, "driveDistanceAfter": 22124, "driveTimeBefore": 0, "driveTimeAfter": 1488050 }, { "x": -2.2164099, "y": 47.2806206, "id": "1", "duration": 0, "timeWindowStart": 0, "timeWindowEnd": 9223372036854775807, "effectiveStart": 0, "driveDistanceBefore": 22124, "driveDistanceAfter": 63139, "driveTimeBefore": 1488050, "driveTimeAfter": 2992570 }, { "x": -1.55306, "y": 47.21812, "id": "0", "duration": 0, "timeWindowStart": 0, "timeWindowEnd": 9223372036854775807, "effectiveStart": 0, "driveDistanceBefore": 63139, "driveDistanceAfter": 0, "driveTimeBefore": 2992570, "driveTimeAfter": 0 } ], "totalDistance": 85263, "totalTime": 74 }
JSON-P format
myCallback({ "steps": [ { "x": -2.02616, "y": 47.2835503, "id": "2", "duration": 0, "timeWindowStart": 0, "timeWindowEnd": 9223372036854775807, "effectiveStart": 0, "driveDistanceBefore": 0, "driveDistanceAfter": 22124, "driveTimeBefore": 0, "driveTimeAfter": 1488050 }, { "x": -2.2164099, "y": 47.2806206, "id": "1", "duration": 0, "timeWindowStart": 0, "timeWindowEnd": 9223372036854775807, "effectiveStart": 0, "driveDistanceBefore": 22124, "driveDistanceAfter": 63139, "driveTimeBefore": 1488050, "driveTimeAfter": 2992570 }, { "x": -1.55306, "y": 47.21812, "id": "0", "duration": 0, "timeWindowStart": 0, "timeWindowEnd": 9223372036854775807, "effectiveStart": 0, "driveDistanceBefore": 63139, "driveDistanceAfter": 0, "driveTimeBefore": 2992570, "driveTimeAfter": 0 } ], "totalDistance": 85263, "totalTime": 74 });
XML Format
<optimRouteResult> <steps> <step> <x>-2.02616</x> <y>47.2835503</y> <id>2</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>9223372036854775807</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>22124</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>1488050</driveTimeAfter> </step> <step> <x>-2.2164099</x> <y>47.2806206</y> <id>1</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>9223372036854775807</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>22124</driveDistanceBefore> <driveDistanceAfter>63139</driveDistanceAfter> <driveTimeBefore>1488050</driveTimeBefore> <driveTimeAfter>2992570</driveTimeAfter> </step> <step> <x>-1.55306</x> <y>47.21812</y> <id>0</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>9223372036854775807</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>63139</driveDistanceBefore> <driveDistanceAfter>0</driveDistanceAfter> <driveTimeBefore>2992570</driveTimeBefore> <driveTimeAfter>0</driveTimeAfter> </step> </steps> <totalDistance>85263</totalDistance> <totalTime>74</totalTime> </optimRouteResult>
case of an optimization applied successfully
<ns2:optimRouteResponse xmlns:ns2="http://geoconcept.com/gc/schemas"> <OptimRouteResult> <steps> <step> <x>-1.55306</x> <y>47.21812</y> <id>0</id> <duration>0</duration> <timeWindowStart>0</timeWindowStart> <timeWindowEnd>0</timeWindowEnd> <effectiveStart>0</effectiveStart> <driveDistanceBefore>0</driveDistanceBefore> <driveDistanceAfter>47085</driveDistanceAfter> <driveTimeBefore>0</driveTimeBefore> <driveTimeAfter>3139890</driveTimeAfter> </step> <step> ... </step> </steps> <totalDistance>69209</totalDistance> <totalTime>77</totalTime> </OptimRouteResult> </ns2:optimRouteResponse>
Case of a problem with the graph: absent file, faulty filepath, etc ⇒ error with faultstring containing the description
<soap:Fault> <faultcode xmlns:ns1="geoconcept.com">ns1:8</faultcode> <faultstring>Error in matrix computation Error in smartrouting datasource is null</faultstring> </soap:Fault>
- 1. Can you force a start and/or arrival step in the calculation of a route?
- 2. How can you specify, for each step, a visit duration and a visit time window?