Page 1 of 1

SampleSnippet PTV_PreferredRoutes

Posted: Mon Sep 30, 2019 1:54 pm
by Bernd Welter
Hi there,

just for those who look or a sample snippet ready to be used with PTV_PreferredRoutes:
Feature Layer PTV_PreferredRoutes is activated on the route in the right map. Therefore the inner city of munich is bypassed. As the red segments are getting a negative malus (causes preference handling) the costs of the right route is cheaper than without the layer. I used https://xroute-tln-eu-n-test.cloud.ptvgroup.com/ for the comparison. Also important: The area of Munich is covered by PreferredRouteType=18. Other regions could use other types.
Feature Layer PTV_PreferredRoutes is activated on the route in the right map. Therefore the inner city of munich is bypassed. As the red segments are getting a negative malus (causes preference handling) the costs of the right route is cheaper than without the layer. I used https://xroute-tln-eu-n-test.cloud.ptvgroup.com/ for the comparison. Also important: The area of Munich is covered by PreferredRouteType=18. Other regions could use other types.
Be aware that PTV_PreferredRoutes is available only for some maps.

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Profile parent="truckfast" xmlns:ns2="http://www.ptv.de/com/ptvag/xserver/engines/xpoidbaccess">
    <FeatureLayer majorVersion='1' minorVersion='0'>
      <GlobalSettings>
          <Parameter name="preferredRouteBonus" value="-10"></Parameter>
      </GlobalSettings>
      <Themes>
          <Theme id='PTV_PreferredRoutes' enabled='true'>
            <PropertyValue id="preferredRouteType" value="18"></PropertyValue>
          </Theme>
      </Themes>
    </FeatureLayer>
    <Routing majorVersion="2" minorVersion="0">
     <Course>
      <AdditionalDataRules enabled='true'/>
     </Course>
    </Routing>
</Profile>
The preferredRouteBonus is a regular malus value:
  • negative values between -99 and -1 will decrease the virtual costs of the corresponding route segments which causes them to be more attractive
  • We can't give a definitive recommendation for the value that fits your requirements best - that's something you have to play with ;-)
  • The preferredRouteType describes the character of a segment, e.g. category 18 means "Local route network that is designated for trucks with an origin and destination within a borough."
Best regards,
Bernd

Re: SampleSnippet PTV_PreferredRoutes

Posted: Thu Apr 28, 2022 8:39 am
by Bernd Welter
Here's just another visualization of the different routing alternatives. It also shows some KPIs of the routes.