SampleSnippet PTV_PreferredRoutes

This forum deals with any kind of routing computation whether it is simple A:B-routing, calculation of isochrones, simple matrix computation or nearest search.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

SampleSnippet PTV_PreferredRoutes

Post 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
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: SampleSnippet PTV_PreferredRoutes

Post by Bernd Welter »

Here's just another visualization of the different routing alternatives. It also shows some KPIs of the routes.
Attachments
Just another example (München)  -  click the pic, it is animated
Just another example (München) - click the pic, it is animated
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply