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.
Ce web service permet de définir des tournées optimales en minimisant les temps et distances de déplacement. L’ordonnancement des points à visiter est optimisé sur base de contraintes géographiques et opérationnelles (plage horaire, durée de la visite…). Il s’appuie sur le graphe paramétré dont le nom a été spécifié dans l’interface d’administration de Geoconcept Web.
Ce web service est une option de Geoconcept Web, veuiller nous contacter pour connaître les modalités d’acquisition.
Les versions précédente du web service sont conservées dans Geoconcept Web pour assurer la compatibilité avec les développements antérieurs. Il est recommandé d’utiliser la version la plus récente.
Changements avec la v3
- Ajout des paramètres en entrée "graphName", "profileId", "profileName", "configName", "snapMethod", "exclusions", "startDateTime", "avoidArea", "computeOptions", "maxCost" et "timeOut".
- Ajout en sortie de la liste des étapes non visitées car non atteignables "unreachableSteps".
Changements avec la v2
- Ajout du paramètre "timewindows/timewindow".
- Les paramètres "totalDistance" et "totalTime" sont renommés respectivement "distanceMeters" et "durationSeconds".
- Le Web service n’est plus disponible en REST GET.
En entrée
paramètre | description | optionnel | défaut |
---|---|---|---|
origin (optimRouteStepV3) |
point d’origine (id,x,y) |
oui |
|
destination (optimRouteStepV3) |
point de destination (id,x,y) |
oui |
|
steps (optimRouteStepV3) |
points à visiter(id,x,y;id,x,y;…) |
non |
|
method |
itinéraire le plus court (distance) ou le plus rapide (time) |
oui |
time |
graphName |
Nom du graphe à utiliser |
oui |
|
profileId |
Identifiant du véhicule (enregistré dans les profils de véhicule) |
oui |
|
profileName |
Profil du véhicule (enregistré dans les profils de véhicule) |
oui |
|
configName |
Nom de la configuration à utiliser (défini dans Geoconcept Web - Administration / Outils / Définitions des graphes) |
oui |
|
snapMethod |
Méthode d’accrochage au graphe |
oui |
standard |
exclusions |
Liste des règles de restrictions à utiliser, séparés par le caractère ; (Exemple : Toll, Tunnel, Bridge) |
oui |
|
startDateTime |
Date et heure de départ (format ISO8601 : heure locale) Exemple : 2014-01-21T09:00:00.000+01:00 (ou 2014-01-21T09:00:00.000%2B01:00) pour un départ le 21 janvier 2014, à 9h à Paris. Attention le caractère + peut être mal interprété par les navigateurs, dans ce cas, il faut le remplacer par %2B. |
oui |
|
avoidArea |
Zone de transit interdit au format WKT (POLYGON ou MULTIPOLYGON) dans la projection (paramètre srs) demandée |
oui |
|
computeOptions |
Liste des options pour le calcul, séparées par le caractère ; |
oui |
|
matrixProvider |
fournisseur de matrice de calcul |
oui |
smartrouting |
matrix |
matrice de temps/distance (id1,id2,temps,distance;…) |
oui |
|
srs |
projection (code EPSG comme epsg:4326 ou wgs84) |
oui |
wgs84 |
directSpeed |
Vitesse par défaut lors de l’utilisation des matrices globe ou euclidean |
oui |
50 |
maxCost |
Coût maximum à ne pas dépasser dans le calcul |
oui |
|
timeOut |
Time out pour le calcul (en millisecondes) |
oui |
Etapes (optimRouteStepV3)
paramètre | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
id du point |
duration |
long |
1/1 |
durée d’une visite, en millisecondes. 0 par défaut |
timeWindows/timeWindow (optimTimeWindow) |
long |
1/1 |
Fenêtres horaires |
Fenêtres horaires (optimTimeWindow)
paramètre | type | min/max | description |
---|---|---|---|
start |
long |
1/1 |
début de plage horaire, en millisecondes. 0 par défaut |
end |
long |
1/1 |
fin de plage horaire, en millisecondes. Long.MAX_VALUE par défaut |
En sortie
paramètre | type | min/max | description |
---|---|---|---|
steps/step |
array (optimRouteStepV3) |
0/illimité |
liste des étapes ordonnancées |
distanceMeters |
long |
1/1 |
distance totale du trajet en mètres |
durationSeconds |
long |
1/1 |
temps total du trajet en secondes |
unreachableSteps |
array (OptimUnreachableStepV3) |
0/illimité |
liste des étapes non atteignables. |
Etapes (optimRouteStepV3)
paramètre | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
id de l'étape |
x |
number |
1/1 |
coordonnée X de l'étape |
y |
number |
1/1 |
coordonnée Y de l'étape |
duration |
long |
1/1 |
durée d’une visite, en millisecondes. 0 par défaut |
effectiveStart |
long |
1/1 |
début effectif d’une visite, en millisecondes |
driveDistanceBefore |
int |
1/1 |
distance de conduite avant l'étape, en mètres |
driveDistanceAfter |
int |
1/1 |
distance de conduite après l'étape, en mètre |
driveTimeBefore |
long |
1/1 |
temps de conduite avant l'étape, en millisecondes |
driveTimeAfter |
long |
1/1 |
temps de conduite après l'étape, en millisecondes |
timeWindows/timeWindow (optimTimeWindow) |
long |
1/1 |
Fenêtres horaires |
Fenêtres horaires (optimTimeWindow)
paramètre | type | min/max | description |
---|---|---|---|
start |
long |
1/1 |
début de plage horaire, en millisecondes. 0 par défaut |
end |
long |
1/1 |
fin de plage horaire, en millisecondes. Long.MAX_VALUE par défaut |
Liste des étapes non atteignables (OptimUnreachableStepV3)
paramètre | type | min/max | description |
---|---|---|---|
id |
string |
1/1 |
id de l'étape |
x |
double |
1/1 |
Longitude de l'étape |
y |
double |
1/1 |
Latitude de l'étape |
WSDL
http://<server>
/<webapp>
/api/ws/optimService?wsdl
Requête
<?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>
Réponse
<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>
Requête
Requête
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>
Réponse
La réponse est toujours encodée en UTF-8.
Format XML
<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>
Cas d’une optimisation effectuée avec succès
<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>
Cas d’un problème avec le graphe : fichier absent, mauvais chemin, etc… ⇒ erreur avec faultstring qui contient la 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>
En entrée
paramètre | description | optionnel | défaut |
---|---|---|---|
origin (optimRouteStepV2) |
point d’origine (id,x,y) |
oui |
|
destination (optimRouteStepV2) |
point de destination (id,x,y) |
oui |
|
steps (optimRouteStepV2) |
points à visiter(id,x,y;id,x,y;…) |
non |
|
method |
itinéraire le plus court (distance) ou le plus rapide (time) |
oui |
time |
matrixProvider |
fournisseur de matrice de calcul |
oui |
smartrouting |
matrix |
matrice de temps/distance (id1,id2,temps,distance;…) |
oui |
|
srs |
projection (code EPSG comme epsg:4326 ou wgs84) |
oui |
wgs84 |
directSpeed |
Vitesse par défaut lors de l’utilisation des matrices globe ou euclidean |
oui |
50 |
Etapes (optimRouteStepV2)
paramètre | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
id du point |
duration |
long |
1/1 |
durée d’une visite, en millisecondes. 0 par défaut |
timeWindows/timeWindow (optimTimeWindow) |
long |
1/1 |
Fenêtres horaires |
Fenêtres horaires (optimTimeWindow)
paramètre | type | min/max | description |
---|---|---|---|
start |
long |
1/1 |
début de plage horaire, en millisecondes. 0 par défaut |
end |
long |
1/1 |
fin de plage horaire, en millisecondes. Long.MAX_VALUE par défaut |
En sortie
paramètre | type | min/max | description |
---|---|---|---|
steps/step |
array (optimRouteStepV2) |
0/illimité |
points à visiter ordonnancés |
distanceMeters |
long |
1/1 |
distance totale du trajet en mètres |
durationSeconds |
long |
1/1 |
temps total du trajet en secondes |
Etapes (optimRouteStepV2)
paramètre | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
id du point |
duration |
long |
1/1 |
durée d’une visite, en millisecondes. 0 par défaut |
effectiveStart |
long |
1/1 |
début effectif d’une visite, en millisecondes |
driveDistanceBefore |
int |
1/1 |
distance de conduite avant l'étape, en mètres |
driveDistanceAfter |
int |
1/1 |
distance de conduite après l'étape, en mètre |
driveTimeBefore |
long |
1/1 |
temps de conduite avant l'étape, en millisecondes |
driveTimeAfter |
long |
1/1 |
temps de conduite après l'étape, en millisecondes |
timeWindows/timeWindow (optimTimeWindow) |
long |
1/1 |
Fenêtres horaires |
Fenêtres horaires (optimTimeWindow)
paramètre | type | min/max | description |
---|---|---|---|
start |
long |
1/1 |
début de plage horaire, en millisecondes. 0 par défaut |
end |
long |
1/1 |
fin de plage horaire, en millisecondes. Long.MAX_VALUE par défaut |
WSDL
http://<server>
/<webapp>
/api/ws/optimService?wsdl
Requête
<?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>
Réponse
<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>
Requête
Requête
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>
Réponse
La réponse est toujours encodée en UTF-8.
Format XML
<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>
Cas d’une optimisation effectuée avec succès
<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>
Cas d’un problème avec le graphe : fichier absent, mauvais chemin, etc… ⇒ erreur avec faultstring qui contient la 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>
En entrée
paramètre | description | optionnel | défaut |
---|---|---|---|
origin |
point d’origine (id,x,y) |
oui |
|
destination |
point de destination (id,x,y) |
oui |
|
steps |
points à visiter(id,x,y;id,x,y;…) |
non |
|
method |
itinéraire le plus court (distance) ou le plus rapide (time) |
oui |
time |
matrixProvider |
founrnisseur de matrice de calcul |
oui |
smartrouting |
matrix |
matrice de temps/distance (id1,id2,temps,distance;…) |
oui |
|
srs |
projection (code EPSG comme epsg:4326 ou wgs84) |
oui |
wgs84 |
directSpeed |
Vitesse par défaut lors de l’utilisation des matrices globe ou euclidean |
oui |
50 |
En sortie
paramètre | type | min/max | description |
---|---|---|---|
steps/step |
array (optimRouteStep) |
0/illimité |
points à visiter ordonnancés |
totalDistance |
long |
1/1 |
distance totale du trajet en mètres |
totalTime |
long |
1/1 |
temps total du trajet en minutes |
Etapes (optimRouteStep)
paramètre | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
id du point |
duration |
long |
1/1 |
durée d’une visite, en millisecondes. 0 par défaut |
timeWindowStart |
long |
1/1 |
début de plage horaire, en millisecondes. 0 par défaut |
timeWindowEnd |
long |
1/1 |
fin de plage horaire, en millisecondes. Long.MAX_VALUE par défaut |
effectiveStart |
long |
1/1 |
début effectif d’une visite, en millisecondes |
driveDistanceBefore |
int |
1/1 |
distance de conduite avant l'étape, en mètres |
driveDistanceAfter |
int |
1/1 |
distance de conduite après l'étape, en mètre |
driveTimeBefore |
long |
1/1 |
temps de conduite avant l'étape, en millisecondes |
driveTimeAfter |
long |
1/1 |
temps de conduite après l'étape, en millisecondes |
WSDL
http://<server>
/<webapp>
/api/ws/optimService?wsdl
Requête
<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>
Réponse
<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>
Requête
Requête
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>
Réponse
La réponse est toujours encodée en UTF-8.
Format XML
<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>
Requête
Requête JSON
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
Requête JSON-P
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
Requête XML
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
Réponse
La réponse est toujours encodée en UTF-8.
Format JSON
{ "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 }
Format JSON-P
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 });
Format XML
<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>
Cas d’une optimisation effectuée avec succès
<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>
Cas d’un problème avec le graphe : fichier absent, mauvais chemin, etc… ⇒ erreur avec faultstring qui contient la 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. Peut-on forcer une étape de départ et/ou d’arrivée dans le calcul de la tournée ?
- 2. Comment préciser, pour chaque étape, une durée et une plage horaire de visite ?