Avoid Specific Routes

Toll Roads

Avoid Toll Roads feature

This feature allows the user to select a route with or without a toll road. This is a String parameter. Avoid is the parameter in which tollroad can be provided as the value in a SOAP request. In this case the resultant route will exclude toll roads while calculating the routes. The following example explains how this parameter is used.

Example with toll road

The following exmaple explains the feature with some imaginery points for a route, which contains the avoid toll road parameter as <v1:Avoid>tollroad</v1:Avoid> in the request.


                    
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.mapinfo.com/routing/service/v1" xmlns:v11="http://www.mapinfo.com/midev/service/geometries/v1">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:RouteCostMatrixRequest id="?" locale="?">
         <!--Optional:-->

    <v1:DatasetResourceName>${#Project#TollRoad_DB}</v1:DatasetResourceName>
    
    <v1:StartPoints srsName="epsg:4326">
       <!--Zero or more repetitions:-->
       <v11:Point srsName="epsg:4326">
          <v11:Pos>
             <v11:X>12.822214</v11:X>
             <v11:Y>47.282809</v11:Y>
          </v11:Pos>
       </v11:Point>
    </v1:StartPoints>
           
    <v1:EndPoints srsName="epsg:4326">
       <!--Zero or more repetitions:-->
       <v11:Point srsName="epsg:4326">
          <v11:Pos>
             <v11:X>12.873852</v11:X>
             <v11:Y>46.871467</v11:Y>
          </v11:Pos>
       </v11:Point>
              
    </v1:EndPoints>

    <v1:DistanceUnit>Mile</v1:DistanceUnit>
    <v1:TimeUnit>Minute</v1:TimeUnit>
     <v1:ReturnOptimalRoutesOnly>true</v1:ReturnOptimalRoutesOnly>
     <v1:OptimizeBy>distance</v1:OptimizeBy>
     <v1:MajorRoads>false</v1:MajorRoads>
     <v1:ReturnDistance>true</v1:ReturnDistance>
     <v1:ReturnTime>true</v1:ReturnTime>
     <v1:Avoid>tollroad</v1:Avoid>
     <v1:HistoricTrafficTimeBucket>none</v1:HistoricTrafficTimeBucket>

     </v1:RouteCostMatrixRequest>
   </soapenv:Body>
</soapenv:Envelope>

                

Example without toll road

The following exmaple explains the feature with some imaginery points for a route, which does not contain the avoid toll road parameter in the request.


                
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.mapinfo.com/routing/service/v1" xmlns:v11="http://www.mapinfo.com/midev/service/geometries/v1">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:RouteCostMatrixRequest id="?" locale="?">
         <!--Optional:-->

    <v1:DatasetResourceName>${#Project#TollRoad_DB}</v1:DatasetResourceName>
    
    <v1:StartPoints srsName="epsg:4326">
       <!--Zero or more repetitions:-->
       <v11:Point srsName="epsg:4326">
          <v11:Pos>
             <v11:X>12.822214</v11:X>
             <v11:Y>47.282809</v11:Y>
          </v11:Pos>
       </v11:Point>
    </v1:StartPoints>
           
    <v1:EndPoints srsName="epsg:4326">
       <!--Zero or more repetitions:-->
       <v11:Point srsName="epsg:4326">
          <v11:Pos>
             <v11:X>12.873852</v11:X>
             <v11:Y>46.871467</v11:Y>
          </v11:Pos>
       </v11:Point>
              
    </v1:EndPoints>

    <v1:DistanceUnit>Mile</v1:DistanceUnit>
    <v1:TimeUnit>Minute</v1:TimeUnit>
     <v1:ReturnOptimalRoutesOnly>true</v1:ReturnOptimalRoutesOnly>
     <v1:OptimizeBy>distance</v1:OptimizeBy>
     <v1:MajorRoads>false</v1:MajorRoads>
     <v1:ReturnDistance>true</v1:ReturnDistance>
     <v1:ReturnTime>true</v1:ReturnTime>
    
     <v1:HistoricTrafficTimeBucket>none</v1:HistoricTrafficTimeBucket>

     </v1:RouteCostMatrixRequest>
   </soapenv:Body>
</soapenv:Envelope>