Search ALong

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

Basic principles

The Search Along web service allows you to identify the best candidates from which to select the next nearest step in a pre-existing itinerary.

The algorithm explores all possible solutions before returning the best candidate selected as a function of best score for the requested criteria.

Availability

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

Parameters / properties

Input

parameter description optional default

routes array of routes/route (inputRoute)

Table of journey input data. Pre-existing itineraries in which candidate steps must be inserted.

yes *

routeNodes array of routeNodes/routeNode (inputRouteNode)

Table of journey input data based on graph nodes (for the fastest calculation). Caution: a physical node does not have the same ID in another graph.

yes *

resources

Table of candidates

yes

method

Shortest (distance) or fastest (time) route

yes

time

exclusions

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

yes

snapMethod

Snap-to-graph method
- standard: to the nearest connectable road section
- extended: via restricted road sections (pedestrian routes…)
- nearest: to the nearest road section only
- unrestricted: without any restriction rules
- nodes: Snap directly to nodes provided by the locationNode parameter or, if no value has been assigned, to the node nearest to the location parameter

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)))
NOTE: WKT geometries must be closed.

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

graphName (depreciated)

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

yes

srs

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

yes

profileId (depreciated)

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

yes

profileName (depreciated)

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

yes

configName

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

yes

computeOptions

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

yes

maxDetourDurationSeconds

Filter: maximum detour authorised (in seconds)

yes

maxDetourDistanceMeters

Filter: maximum detour authorised (in metres)

yes

maxDetourOriginDurationSeconds

Filter: maximum authorised duration between the journey start point and the candidate (in seconds)

yes

maxDetourOriginDistanceMeters

Filter: maximum authorised detour between the candidate and the journey arrival point (in metres)

yes

maxDetourDestinationDurationSeconds

Filter: maximum authorised duration between the candidate and the journey arrival point (in seconds)

yes

maxDetourDestinationDistanceMeters

Filter: maximum authorised detour from the arrival point (in metres)

yes

timeOut

Time out for the calculation (in milliseconds)

yes

(*) At least one of the two parameters routes and routeNodes must be assigned a value.

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

Journeys in input (inputRoute)

parameter description optional default

id

Journey identifier

No

departurePoint (geographicPoint)

Coordinates of the journey departure point

No

arrivalPoint (geographicPoint)

Coordinates of the journey arrival point

No

Coordinates (geographicPoint)

parameter description optional default

x

First coordinate or longitude

No

y

Second coordonnée or latitude

No

Journeys in input based on the graph nodes (inputRouteNode)

parameter description optional default

id

Journey identifier

No

departureNode (geographicPoint)

Journey departure node

No

arrivalNode (geographicPoint)

Journey arrival node

No

Candidates (searchAlongResource)

parameter description optional default

id

Candidate identifier

No

x

First coordinate or longitude

No

y

Second coordonnée or latitude

No

node

Candidate node

Yes

priority1

Priority 1

Yes

0

priority2

Priority 2

Yes

0

Output

parameter type min/max description

routes

array of routes/route (searchAlongRouteResult)

0/unlimited

List of calculated journeys.

List of calculated journeys (searchAlongRouteResult)

parameter type min/max description

id

string

0/1

Journey identifier

directDistanceMeters

double

1/1

Total distance without detour (in metres)

directDurationSeconds

double

1/1

Total duration without detour (in seconds)

resources

(searchAlongResourceResult)

0/unlimited

List of candidates

Candidates (searchAlongResourceResult)

parameter type min/max description

id

string

0/1

Candidate identifier

totalDistanceMeters

double

1/1

Total distance with detour (in metres)

totalDurationSeconds

double

1/1

Total duration with detour (in seconds)

detourDistanceMeters

double

1/1

Detour distance (in metres)

detourDurationSeconds

double

1/1

Detour duration (in seconds)

detourOriginDistanceMeters

double

1/1

Detour distance from the journey departure point to the candidate (in metres)

detourOriginDurationSeconds

double

1/1

Detour duration from the journey departure point to the candidate (in seconds)

detourDestinationDistanceMeters

double

1/1

Detour distance from the candidate to the arrival point (in metres)

detourDestinationDurationSeconds

double

1/1

Detour duration from the candidate to the arrival point (in seconds)

SOAP

WSDL

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

Query

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://geoconcept.com/gc/schemas">
   <soapenv:Header />
   <soapenv:Body>
      <sch:searchAlongV1>
         <!--Optional:-->
         <request>
            <routes>
               <route>
                  <id>dep</id>
                  <departurePoint>
                     <x>-1.553927</x>
                     <y>47.21858</y>
                  </departurePoint>
                  <arrivalPoint>
                     <x>-1.593927</x>
                     <y>47.18858</y>
                  </arrivalPoint>
               </route>
            </routes>
            <resources>
               <resource>
                  <id>res1</id>
                  <node />
                  <priority1>1</priority1>
                  <priority2>2</priority2>
                  <x>-1.511092</x>
                  <y>47.208355</y>
               </resource>
               <resource>
                  <id>res2</id>
                  <node />
                  <priority1>1</priority1>
                  <priority2>1</priority2>
                  <x>-1.549524</x>
                  <y>47.195484</y>
               </resource>
            </resources>
            <srs>epsg:4326</srs>
            <maxDetourDestinationDistanceMeters>-1</maxDetourDestinationDistanceMeters>
            <maxDetourDestinationDurationSeconds>-1</maxDetourDestinationDurationSeconds>
            <maxDetourDistanceMeters>-1</maxDetourDistanceMeters>
            <maxDetourDurationSeconds>-1</maxDetourDurationSeconds>
            <maxDetourOriginDistanceMeters>-1</maxDetourOriginDistanceMeters>
            <maxDetourOriginDurationSeconds>-1</maxDetourOriginDurationSeconds>
            <method>time</method>
                        <timeOut></timeOut>
         </request>
      </sch:searchAlongV1>
   </soapenv:Body>
</soapenv:Envelope>

Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:searchAlongV1Response xmlns:ns2="http://geoconcept.com/gc/schemas">
         <SearchAlongResult>
            <status>OK</status>
            <routes>
               <route>
                  <id>dep</id>
                  <directDistanceMeters>6850.71</directDistanceMeters>
                  <directDurationSeconds>973.14</directDurationSeconds>
                  <resources>
                     <id>res2</id>
                     <totalDistanceMeters>7808.36</totalDistanceMeters>
                     <totalDurationSeconds>1197.28</totalDurationSeconds>
                     <detourDistanceMeters>957.65</detourDistanceMeters>
                     <detourDurationSeconds>224.14</detourDurationSeconds>
                     <detourOriginDistanceMeters>3684.98</detourOriginDistanceMeters>
                     <detourOriginDurationSeconds>752.34</detourOriginDurationSeconds>
                     <detourDestinationDistanceMeters>4123.38</detourDestinationDistanceMeters>
                     <detourDestinationDurationSeconds>444.94</detourDestinationDurationSeconds>
                  </resources>
                  <resources>
                     <id>res1</id>
                     <totalDistanceMeters>13714.6</totalDistanceMeters>
                     <totalDurationSeconds>2261.52</totalDurationSeconds>
                     <detourDistanceMeters>6863.89</detourDistanceMeters>
                     <detourDurationSeconds>1288.38</detourDurationSeconds>
                     <detourOriginDistanceMeters>5731.27</detourOriginDistanceMeters>
                     <detourOriginDurationSeconds>1156.94</detourOriginDurationSeconds>
                     <detourDestinationDistanceMeters>7983.33</detourDestinationDistanceMeters>
                     <detourDestinationDurationSeconds>1104.58</detourDestinationDurationSeconds>
                  </resources>
               </route>
            </routes>
            <computationTime>118.72</computationTime>
         </SearchAlongResult>
      </ns2:searchAlongV1Response>
   </soap:Body>
</soap:Envelope>

REST (POST JSON)

Query

Query 

http://<server>/<webapp>/api/lbs/searchAlong.json

Data (JSON) 

{
   "routes":[
      {
         "id":"dep",
         "departurePoint":{
            "x":-1.553927,
            "y":47.218580
         },
         "arrivalPoint":{
            "x":-1.593927,
            "y":47.188580
         }
      }
   ],
   "resources":[
      {
         "id":"res1",
         "node":"",
         "priority1":1,
         "priority2":2,
         "x":-1.511092,
         "y":47.208354
      }
   ],
   "resources":[
      {
         "id":"res2",
         "node":"",
         "priority1":1,
         "priority2":1,
         "x":-1.549524,
         "y":47.195483
      }
   ],
   "method":"time",
   "srs":"epsg:4326",
   "maxDetourDurationSeconds":-1,
   "maxDetourDistanceMeters":-1,
   "maxDetourOriginDurationSeconds":-1,
   "maxDetourOriginDistanceMeters":-1,
   "maxDetourDestinationDurationSeconds":-1,
   "maxDetourDestinationDistanceMeters":-1
}

Response

The response is always in UTF-8 format.

JSON format 

{
    "message": null,
    "status": "OK",
    "routes": [
        {
            "id": "dep",
            "directDistanceMeters": 6850.71,
            "directDurationSeconds": 973.14,
            "resources": [
                {
                    "id": "res2",
                    "totalDistanceMeters": 7808.36,
                    "totalDurationSeconds": 1197.28,
                    "detourDistanceMeters": 957.65,
                    "detourDurationSeconds": 224.14,
                    "detourOriginDistanceMeters": 3684.98,
                    "detourOriginDurationSeconds": 752.34,
                    "detourDestinationDistanceMeters": 4123.38,
                    "detourDestinationDurationSeconds": 444.94
                }
            ]
        }
    ]
}

REST (POST XML)

Query

Query 

http://<server>/<webapp>/api/lbs/searchAlong.xml

Data (XML) 

<?xml version="1.0" encoding="UTF-8"?>
<searchAlongRequest>
   <routes>
      <route>
         <id>dep</id>
         <departurePoint>
            <x>-1.553927</x>
            <y>47.21858</y>
         </departurePoint>
         <arrivalPoint>
            <x>-1.593927</x>
            <y>47.18858</y>
         </arrivalPoint>
      </route>
   </routes>
   <resources>
      <resource>
         <id>res1</id>
         <node />
         <priority1>1</priority1>
         <priority2>2</priority2>
         <x>-1.511092</x>
         <y>47.208355</y>
      </resource>
      <resource>
         <id>res2</id>
         <node />
         <priority1>1</priority1>
         <priority2>1</priority2>
         <x>-1.549524</x>
         <y>47.195484</y>
      </resource>
   </resources>
   <srs>epsg:4326</srs>
   <maxDetourDestinationDistanceMeters>-1</maxDetourDestinationDistanceMeters>
   <maxDetourDestinationDurationSeconds>-1</maxDetourDestinationDurationSeconds>
   <maxDetourDistanceMeters>-1</maxDetourDistanceMeters>
   <maxDetourDurationSeconds>-1</maxDetourDurationSeconds>
   <maxDetourOriginDistanceMeters>-1</maxDetourOriginDistanceMeters>
   <maxDetourOriginDurationSeconds>-1</maxDetourOriginDurationSeconds>
   <method>time</method>
</searchAlongRequest>

Response

The response is always in UTF-8 format.

XML format 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<searchAlongResult>
    <status>OK</status>
    <routes>
        <route>
            <id>dep</id>
            <directDistanceMeters>6850.71</directDistanceMeters>
            <directDurationSeconds>973.14</directDurationSeconds>
            <resources>
                <id>res2</id>
                <totalDistanceMeters>7808.36</totalDistanceMeters>
                <totalDurationSeconds>1197.28</totalDurationSeconds>
                <detourDistanceMeters>957.65</detourDistanceMeters>
                <detourDurationSeconds>224.14</detourDurationSeconds>
                <detourOriginDistanceMeters>3684.98</detourOriginDistanceMeters>
                <detourOriginDurationSeconds>752.34</detourOriginDurationSeconds>
                <detourDestinationDistanceMeters>4123.38</detourDestinationDistanceMeters>
                <detourDestinationDurationSeconds>444.94</detourDestinationDurationSeconds>
            </resources>
            <resources>
                <id>res1</id>
                <totalDistanceMeters>13714.6</totalDistanceMeters>
                <totalDurationSeconds>2261.52</totalDurationSeconds>
                <detourDistanceMeters>6863.89</detourDistanceMeters>
                <detourDurationSeconds>1288.38</detourDurationSeconds>
                <detourOriginDistanceMeters>5731.27</detourOriginDistanceMeters>
                <detourOriginDurationSeconds>1156.94</detourOriginDurationSeconds>
                <detourDestinationDistanceMeters>7983.33</detourDestinationDistanceMeters>
                <detourDestinationDurationSeconds>1104.58</detourDestinationDurationSeconds>
            </resources>
        </route>
    </routes>
</searchAlongResult>

Possible responses

Case of a search around found (searchAlongResult/status is OK) 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<searchAlongResult>
    <status>OK</status>
    <routes>
        <route>
            <id>dep</id>
            <directDistanceMeters>6850.71</directDistanceMeters>
            <directDurationSeconds>973.14</directDurationSeconds>
            <resources>
                <id>res2</id>
                <totalDistanceMeters>7808.36</totalDistanceMeters>
                <totalDurationSeconds>1197.28</totalDurationSeconds>
                <detourDistanceMeters>957.65</detourDistanceMeters>
                <detourDurationSeconds>224.14</detourDurationSeconds>
                <detourOriginDistanceMeters>3684.98</detourOriginDistanceMeters>
                <detourOriginDurationSeconds>752.34</detourOriginDurationSeconds>
                <detourDestinationDistanceMeters>4123.38</detourDestinationDistanceMeters>
                <detourDestinationDurationSeconds>444.94</detourDestinationDurationSeconds>
            </resources>
            <resources>
                <id>res1</id>
                <totalDistanceMeters>13714.6</totalDistanceMeters>
                <totalDurationSeconds>2261.52</totalDurationSeconds>
                <detourDistanceMeters>6863.89</detourDistanceMeters>
                <detourDurationSeconds>1288.38</detourDurationSeconds>
                <detourOriginDistanceMeters>5731.27</detourOriginDistanceMeters>
                <detourOriginDurationSeconds>1156.94</detourOriginDurationSeconds>
                <detourDestinationDistanceMeters>7983.33</detourDestinationDistanceMeters>
                <detourDestinationDurationSeconds>1104.58</detourDestinationDurationSeconds>
            </resources>
        </route>
    </routes>
</searchAlongResult>

Case of an incorrect SRS 

{"message":"NullPointerException: null","status":"ERROR"}

Case of an absent resource (searchAroundResponse/status is OK) 

{"message":"Input resources list must not be null and empty!","status":"ERROR","routes":[]}

FAQ

1. Is it possible to give priority to either journey time or distance?
2. Can I use aliases instead of .siti file names to call a datasource?
3. How can I use route statistics?
4. How is the classification of returned addresses structured, in relation to distance, time and priorities generally?
5. What format should the priority take and is it possible to define a classification order? (increasing/decreasing)
6. If just one address in the list has a priority of 0, is the priority taken into account for any or all of the addresses in the list?
7. How can I perform a route calculation excluding toll roads?
8. What are Speed Patterns? How can I use them?

1.

Is it possible to give priority to either journey time or distance?

Yes, by changing the method method distance or time

2.

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

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

3.

How can I use route statistics?

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

4.

How is the classification of returned addresses structured, in relation to distance, time and priorities generally?

The classification creates a hierarchy of priority 1 in increasing order, then priority 2 in increasing order, then by time or distance or distance as the crow flies in increasing order.

5.

What format should the priority take and is it possible to define a classification order? (increasing/decreasing)

The priority is an integer, and currently the result is always in increasing order. To obtain the reverse order, you should put n-priority in the attribute.

6.

If just one address in the list has a priority of 0, is the priority taken into account for any or all of the addresses in the list?

Currently, a priority of 0 is not treated in any special way. This means you need to set all priorities to 0 if you want to ignore the criterion.

7.

How can I perform a route calculation excluding toll roads?

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

8.

What are Speed Patterns? How can I use them?

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

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

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

+

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

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

&computeOptions=height:450