SolverTech.Tasha.Plugins.Distances.HERE - Router

Z Solvertech
Verze z 13. 10. 2022, 08:36, kterou vytvořil FuzzyBot (diskuse | příspěvky) (Stránka aktualizována, aby odpovídala nové verzi zdrojové stránky)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)
Skočit na navigaci Skočit na vyhledávání
Jiné jazyky:

Plugin for distance matrix computations using HERE services

Instalation

The router is installed by default. To install it manually, copy these three files to the Plugins folder:

SolverTech.Distances.HERE.dll (the router itself)

SolverTech.Tasha.Plugins.Distances.HERE.dll (plugin for Tasha using the router)

SolverTech.Tasha.Plugins.Distances.HERE.config (the plugin settings see below)

Login to HERE

This plugin uses HERE services, hence you need to supply it with the Api Key (TS Loads-Settings->HERE->Api Key)

Legacy HERE accounts

Older accounts, which have not been converted to the new authorization using the single Api Key and are still using the pair of App ID/App Code (TS Loads-Settings->HERE->App ID, App Code), are still usable, but you need to change the URL for the distance matrix and routing in the config file:

<Matrix><BaseUrl>https://matrix.route.api.here.com</BaseUrl></Matrix> … <Route><BaseUrl>https://route.api.here.com</BaseUrl></Route>

HERE API version 8

The newer version of HERE (v8) is backwards compatible with the current configuration. APIv8 offers more accurate and faster calculations, but some features are not fully implemented (e.g. ExcludeCountries), so it is disabled by default and v7 is still used. To switch to APIv8 calculation, you need to enable Enable in ApiV8Settings to true:

<ApiV8Settings>

 <Enable>true</Enable>
 <V8MatrixURL><https://matrix.router.hereapi.com/v8/matrix</V8MatrixURL>
 <V8RouteURL><https://router.hereapi.com/v8/routes</V8RouteURL>

</ApiV8Settings>

Units for truck weight and dimensions

APIv7, on which the plugin configuration is based, uses tons for the unit of mass and meters for the dimensions. To maintain backwards compatibility, it is therefore always assumed that the units are specified in the configuration as a float number indicating tons/meters, and if the format is changed by HERE (such as when switching to APIv8), the plugin will perform the conversion internally, without user intervention or knowledge.

Toll

  • APIv8 does not yet support specifying parameters for correct toll calculation, so version 7 is still used for toll calculation.

Configuration

Global

Parameter Type Meaning
PersistentRoutes bool Saves the already calculated RouteID and WKT routes into a separate file <Scenario>.routes. Makes it many times faster to redisplay the route on the map at the cost of DB size.
CrowFlyFirst bool For cases where it is more important to have the results immediately, it is possible to calculate distances as the crow flies, according to the values for the specific vehicle type, see the parameters DistanceCoefficient and ApproxSpeedInKilometersPerHour. The exact values are then calculated in the background.

Sanity check

For each calculated distance, a crowfly is calculated and if the values differ significantly, a warning pops up. The addresses of the affected locations can be read from the log.

Parameter Type Meaning
Enable bool Enable sanity check
MaxMultipleDifference float If the crowfly differs by this multiple from the calculated distance, a warning will pop up. Default value: 10.0
MinimumDistanceInMeters int Ignore the check if the distance is less than the set value (In meters). Default value 1000.

Distance matrix

Parameter Type Meaning
SearchRange int Limit the range of the area in which the route can be searched. A lower number speeds up the calculation but may result in a suboptimal solution. In meters.
UseDynamicRange bool Same meaning as SearchRange, but the value for SearchRange is calculated dynamically, according to the distance of the two farthest points in the matrix. When using UseDynamicRange, the SearchRange must not be filled
SearchRangeDistanceCoefficient float Coefficient for multiplying the distance of the two most distant points in the matrix to calculate SearchRange when using UseDynamicRange. Must be bigger than 1. Typically 1.5-2.0
AllowedTimeRangeInMinutes int Enabled time window.
EnableLastMileComputing bool It takes into account the distance and time of the so-called last mile - the distance that must be covered by other means (on foot, with a carriage) between the last navigation point (the road before the no-entry zone) and the specified address (the entrance of the building). You need to set "LastMileSpeedInMetersPerSecond"
LastMileSpeedInMetersPerSecond float Speed in m/s, to calculate the time spent moving to the last mile
LastMileRadiusInMeters int The maximum radius, in meters, around the specified location within which reverse geocoding will be performed to determine the navigation location.
UseCrowFlyCalculation bool Always returns distance and time. If it does not find the route, it calculates the values
UseCarIfTruckNotFound bool If it does not find a route for the truck, use the time and distance values as if it were a car
CrowFlyDistanceCoefficient float Coefficient by which the straight line distance between two points is multiplied when using UseCrowFlyCalculation
CrowFlyFirst bool

It first calculates the distances through the crowfly and then calculates the distances.

If we use it is necessary to have defined parameters in “<Vehicle>” (DistanceCoefficient a CrowflyApproxSpeedInKilometersPerHour)

CrowFlyApproxSpeedInKilometersPerHour float Speed in km/h to determine time in use UseCrowFlyCalculation
MinColumnCountInMtoNDistanceMatrixAPIRequest int Reduces the size of the requirement for HERE servers, for optimization reasons. The optimal value is found empirically, it may change over time. Possible range of values 10-100. Default value:15
NavigateCloserNumberOfSteps int

If the router cannot find the route, for example because the destination address is in a no-entry zone, it moves the navigation point closer to the starting position and repeats the request. It determines the number of times this process is repeated before it finds the route or abandons the process and moves on to the next step (crowfly calculation, if enabled). To disable the functionality, a '0' must be entered.

Default value: 0 (off)

NavigateCloserStepInMeters int

Distance in meters by which the navigation point is moved, see parameter 'NavigateCloserNumberOfSteps'.

Default value: 20

The remaining parameters are defined by HERE and are described at https://developer.here.com/documentation/routing/dev_guide/topics/resource-calculate-matrix.html

Large scale matrix

For large matrix calculations, where the classical calculation method takes a long time, the Large Scale Matrix API (hereafter LSM) can be used. Using LSM, huge matrices (10,000 x 10,000) can be calculated in a matter of minutes. Limitations:

  1. LSM can only be used on HERE accounts with the "Managed Assets with Optimization" plan that use OAuth authorization (have the HERE "Access Key ID" and "Key Secret" populated in the Tashi settings)
  2. Traffic prediction cannot be used for the time being
  3. The smallest requirement is calculated as a minimum of 100,000 transactions, for plans where each transaction is paid for it is advisable to use LSM for scenarios where there are a minimum of 317 seats (317x317 > 100,000 transactions). Alternatively, limit the minimum number of requests using the MinElementsForLargeScaleMatrix parameter.
Parameter Type Meaning
EnableLargeScaleMatrix bool

Allows calculation using LSM for certain matrixes.

Default value: false

MinElementsForLargeScaleMatrix int If the request contains less than the specified number of elements, the matrix will not be calculated using LSM.

Default value: 1500

LargeScaleMatrixURL string

URL for the LSM API, in case it changes in the future

Default value: https://largescalematrix.router.hereapi.com/v1/matrix

Configuration example

<?xml version="1.0" encoding="utf-8"?> <DistancesHERESettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

 <PersistentRoutes>true</PersistentRoutes>
 <SanityCheck>
   <Enable>true</Enable>
   <MaxMultipleDifference>5.0</MaxMultipleDifference>

<MinimumDistanceInMeters>1000</MinimumDistanceInMeters>

 </SanityCheck>
 <Matrix>
   <BaseUrl>https://matrix.route.ls.hereapi.com</BaseUrl>
   <Path>/routing/7.2</Path>
   <Resource>/calculatematrix</Resource>
   <Format>.json</Format>
   <Parameters>
     <Parameter>
       <Name>searchRange</Name>
       <Value>1000000</Value>
     </Parameter>
     <Parameter>
       <Name>matrixAttributes</Name>
       <Value>none,su</Value>
     </Parameter>
     <Parameter>
       <Name>summaryAttributes</Name>
       <Value>none,tt,di</Value>
     </Parameter>
     <Parameter>
       <Name>AllowedTimeRangeInMinutes</Name>
       <Value>60</Value>
     </Parameter>
     <Parameter>
       <Name>EnableLastMileComputing</Name>
       <Value>true</Value>
     </Parameter>  
     <Parameter>
       <Name>NavigateCloserNumberOfSteps</Name>
       <Value>3</Value>
     </Parameter>
     <Parameter>
       <Name>NavigateCloserStepInMeters</Name>
       <Value>20</Value>
     </Parameter>
     <Parameter>

<Name>EnableLargeScaleMatrix</Name> <Value>false</Value> </Parameter> <Parameter> <Name>MinElementsForLargeScaleMatrix</Name> <Value>1500</Value> </Parameter> <Parameter> <Name>LargeScaleMatrixURL</Name> <Value>https://largescalematrix.router.hereapi.com/v1/matrix</Value> </Parameter> <Parameter>

     <Name>CrowFlyFirst</Name>
      <Value>true</Value>
     </Parameter>
   </Parameters>
 </Matrix>
 <Route>
   <BaseUrl>https://route.ls.hereapi.com</BaseUrl>
   <Parameters>
     <Parameter>
       <Name>representation</Name>
       <Value>overview</Value>
     </Parameter>
     <Parameter>
       <Name>routeAttributes</Name>
       <Value>none,sm,sh</Value>
     </Parameter>
     <Parameter>
       <Name>alternatives</Name>
       <Value>9</Value>
     </Parameter>
     <Parameter>
       <Name>language</Name>
       <Value>cs-cz</Value>
     </Parameter>
   </Parameters>
 </Route>
 <Vehicle>
   <ArrayOfParameter>
     <Parameter>
       <Name>mode</Name>
       <Value>fastest;car;traffic:enabled</Value>
     </Parameter>
     <Parameter>
       <Name>DistanceCoefficient</Name>
       <Value>2.0</Value>
     </Parameter>
     <Parameter>
        <Name>CrowflyApproxSpeedInKilometersPerHour</Name>
        <Value>60.0</Value>
     </Parameter>
   </ArrayOfParameter>
 </Vehicle>
</DistancesHERESettings>