How to Define a Permanent City Access Permit in Route Planning

Plan optimal and cost-effective routes for any vehicle and provide users with reliable arrival times.
Post Reply
User avatar
Edmond Dantes
Posts: 6
Joined: Tue Apr 01, 2025 7:14 am

How to Define a Permanent City Access Permit in Route Planning

Post by Edmond Dantes »

Hello everyone!
I’d like to ask for your help with the following topic:
“Specifying a Permanent Urban Transit Permit in PTV Route Planning.”

Our company has a permanent annual truck entry permit for a neighboring city to our site.
How can I inform the PTV route planner that it is allowed to plan routes passing through this city?
I have created a polygon that includes the city’s public roads, but the basic planner does not allow me to use it.
How can I generally specify that we have a permanent entry permit for a more distant city, and the route planner should take this into account if necessary?

Thank you in advance for your support and responses!
User avatar
Bernd Welter
Site Admin
Posts: 2806
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to Define a Permanent City Access Permit in Route Planning

Post by Bernd Welter »

Hello Edmond,

which specific restriction does the vehicle currently violate when it tries to enter the city? Did you already avaluate the various vehicle properties we offer in the Routing API?
LEZ.png
As you can see in the screenshot: some of the restrictions apply for named cities.

Is the city "top secret" or can we share this scenario and even the routing request in public? If not please create a helpdesk ticket and we will try to reproduce your story together with you.

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
Edmond Dantes
Posts: 6
Joined: Tue Apr 01, 2025 7:14 am

Re: How to Define a Permanent City Access Permit in Route Planning

Post by Edmond Dantes »

Bugyi-Cegled.txt
(3.06 KiB) Downloaded 66 times
The city name is DABAS in Hungary. Our company is in BUGYI. It is next to Dabas.

Here is the polygon of DABAS:

Code: Select all

{
  "$type": "SegmentsBySurroundingPolygonRequest",
  "resultFields": {
    "polyline": true,
    "descriptors": true
  },
  "polygon": {
    "plain": {
      "$type": "Polygon",
      "polygonRings": [
        {
          "polyline": [
                { "y": 47.2489881355028, "x": 19.23258887365805 },
                { "y": 47.2289418550714, "x": 19.20718299131623 },
                { "y": 47.2116866590905, "x": 19.22228919162758 },
                { "y": 47.1836933226815, "x": 19.19345008194227 },
                { "y": 47.1435437846652, "x": 19.20718299131623 },
                { "y": 47.1033639012747, "x": 19.36785803099153 },
                { "y": 47.1640891996857, "x": 19.39532384973944 },
                { "y": 47.2191490546151, "x": 19.35275183068017 },
                { "y": 47.2135523564237, "x": 19.32940588474445 },
                { "y": 47.2536489741963, "x": 19.28683386568518 },
                { "y": 47.2387328465416, "x": 19.25936804693727 },
                { "y": 47.2555131948249, "x": 19.28546057474778 }
              ]
        }
      ]
    }
  }
}
User avatar
Bernd Welter
Site Admin
Posts: 2806
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to Define a Permanent City Access Permit in Route Planning

Post by Bernd Welter »

Looks more like an xServer2 topic then...
Your selected segments around the city
Your selected segments around the city
From what I see in the first reponse the segments inside Dabas are partially restricted to "delivery" which cause violations.
Routiug successful though violated
Routiug successful though violated
I applied
  • Vehicle: isDelivery=true
  • Routing.Course.SPecialAreas.deliveryOnlyMalus=100 (just a low random penalty)
By setting the vehicle as "isDelivery" with a "deliveryOnly=100"  the final part of the route is no longer violated
By setting the vehicle as "isDelivery" with a "deliveryOnly=100" the final part of the route is no longer violated
The final part of the route is no longer violated.

Is that helpful?

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
Edmond Dantes
Posts: 6
Joined: Tue Apr 01, 2025 7:14 am

Re: How to Define a Permanent City Access Permit in Route Planning

Post by Edmond Dantes »

I attached an JSON (in txt file) for the Raw Request Runner.
I do not know yet how to apply your answer in that.
Attachments
Bugyi-Cegled.txt
(3.06 KiB) Downloaded 54 times
User avatar
Bernd Welter
Site Admin
Posts: 2806
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to Define a Permanent City Access Permit in Route Planning

Post by Bernd Welter »

Well, this is what immediately caught my eyes:
  • "distanceTimeWeighting": 100 - causes the engine to look for a very FAST route, even if a detour applies. Probably you should use values between 20 and 80.
    Hungary Dabas.4.png
  • Code: Select all

    "isDelivery": false
    - means you are not allowed to use "deliveryOnly" segments. Set this value to true and...
  • Code: Select all

    "specialAreas": {
    "residentsOnlyPenalty": 2500,
    "urbanPenalty": 500,
    "forbiddenLowEmissionZonePenalty": 2500,
    "minimumUrbanNetworkClass": 1
    },
    choose your penalties... also you did NOT specify a deliveryOnlyPenalty (default is 2500, so almost forbidden)
  • Code: Select all

    "minimumDistancesFromWaypoint": [
    	"UNBOUNDED",
    	"UNBOUNDED",
    	"UNBOUNDED",
    	"UNBOUNDED",
    	"UNBOUNDED",
    	"2",
    	"2",
    	"2"
    ]
    
    - the "2" means that outside an area of 2km around any involved waypoint we do not "see" those network classes 5,6,7 but some roads in Dabas are NC 5.
    Hungary Dabas.5.png
Long story short - there's not just a single parameter that has a relevant impact in this story - you need to discuss a proper combination!

Bernd
Hungary Dabas.6.png
is created by

Code: Select all

{
	"waypoints": [
		{
			"$type": "OffRoadWaypoint",
			"location": {
				"offRoadCoordinate": {
					"x": 19.14553,
					"y": 47.21471
				}
			}
		},
		{
			"$type": "OffRoadWaypoint",
			"location": {
				"offRoadCoordinate": {
					"x": 19.75410050424403,
					"y": 47.18360076219978 
				}
			}
		}
	],
	"resultFields": {
		"polyline": true,
		"emissions": true,
		"guidedNavigationRoute": true,
		"eventTypes": [
			"MANEUVER_EVENT"
		],
		"monetaryCostsReport": true,
		"toll": {
			"enabled": true,
			"sections": true
		}
	},
	"storedProfile": "truck40t",
	"requestProfile": {
		"vehicleProfile": {
			"weight": {
				"emptyWeight": 8000,
				"totalPermittedWeight": 40000,
				"loadWeight": 32000
			},
			"legalCondition": {
				"isEmergency": false,
				"isDelivery": true
			},
			"preferredRouteTypes": "DE_LONG_TRUCK,LOCAL_TRANSPORTATION",
			"electronicTollCollectionSubscriptions": "AT_GOBOX"
		},
		"routingProfile": {
			"course": {
				"combinedTransport": {
					"boatPenalty": 2500,
					"railPenalty": 2500
				},
				"distanceTimeWeighting": 20,
				"violations": {
					"enabled": true
				},
				"toll": {
					"tollPenalty": 0
				},
				"network": {
					"rampPenalty": 0,
					"penaltiesByNetworkClass": {
						"penalties": [
							0,
							0,
							0,
							0,
							0,
							50,
							50,
							51
						]
					}
				},
				"specialAreas": {
					"residentsOnlyPenalty": 100,
					"urbanPenalty": 100,
                      "deliveryOnlyPenalty" : 100,
					"forbiddenLowEmissionZonePenalty": 100,
					"minimumUrbanNetworkClass": 1
				},
				"maneuver": {
					"uTurnCost": 0
				}
			},
			"linking": {
				"minimumNetworkClass": 0,
				"maximumNetworkClass": 7
			},
			"searchSpace": {
				"heuristicAggressiveness": 100,
				"excludeByNetworkClass": {
					"minimumDistancesFromWaypoint": [
						"UNBOUNDED",
						"UNBOUNDED",
						"UNBOUNDED",
						"UNBOUNDED",
						"UNBOUNDED",
						"211",
						"211",
						"211"
					]
				}
			}
		},
		"featureLayerProfile": {
			"parameters": [
				{
					"key": "preferredRoutePenalty",
					"value": "-75"
				}
			],
			"themes": [
				{
					"id": "PTV_PreferredRoutes",
					"enabled": true
				},
				{
					"id": "PTV_TruckSpeedPatterns",
					"enabled": true
				},
				{
					"id": "PTV_TrafficIncidents",
					"enabled": true
				},
				{
					"id": "PTV_TruckAttributes",
					"enabled": true
				}
			]
		}
	},
	"routeOptions": {
		"timeConsideration": {
			"$type": "ExactTimeConsiderationAtStart",
			"referenceTime": "2025-03-08T10:35:45+01:00"
		},
		"calculationCriteria": "ABSTRACT_COSTS",
		"currency": "EUR",
		"emissionOptions": {
			"valueScenarios": [
				{
					"$type": "EmissionValueScenario_HBEFA_3_2",
					"scenarios": [
						"CURRENT_ROUTE"
					]
				}
			]
		},
		"monetaryCostOptions": {
			"costPerKilometer": 1.38,
			"workingCostPerHour": 0.1,
			"costPerFuelUnit": 0.0
		}
	},
	"geometryOptions": {
		"responseGeometryTypes": [
			"PLAIN"
		]
	},
	"coordinateFormat": "EPSG:4326"
}
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
Edmond Dantes
Posts: 6
Joined: Tue Apr 01, 2025 7:14 am

Re: How to Define a Permanent City Access Permit in Route Planning

Post by Edmond Dantes »

"there's not just a single parameter that has a relevant impact in this story - you need to discuss a proper combination!"
Yes, it is true. I have changed the parameters a lot. But I could not find any perfect solution.

My clear first question is actually yet. How can I allow my trucks to drive throught an city we have an permanent permission in? For example throught Dabas.
User avatar
Bernd Welter
Site Admin
Posts: 2806
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to Define a Permanent City Access Permit in Route Planning

Post by Bernd Welter »

Looks like the core request we are dealing with has been designed to use many different optional parameters.

Wo defined the specific values for them?

The reason why I am asking is:
  • If we just change 2-3 parameters to solve the transit through Dabas we might create new issues somewhere else. This has to be taken into consideration.
Roughly spoken I can draw your attention to some parameters and ensure that you know them and their side effects.

So for example one reason why we encountered a detour:
  • - The parameter set pushed a short driving time – but the desired route would take some extra time
So once I patched this obvious first “argument against the desired route” I had to look for the next parameter that contradicts
  • Ah, the road network is filtered by some relevant roads “minimumDistancesFromWaypoint”, this can’t work, too… next iteration step
Then I looked into the next potential parameter and so on.

:!: I can’t just give you a simple “set blabla from xx to yy”: In the end the user must digest and understand each one of the parameters and then decide consciously what to do. Also being in charge of “this will lead to consequences somewhere else.

So for example if your given requests sets the urban penalty to 500: might be relevant. But who decided to use 500 for this in the past?
:?: Shall we set up a routing session with you and your colleagues who defined the initial values?

Bernd

PS: Let me ask the other way round: there's a parameter "urbanPenalty" which is set to 500. This means that each segment which is assigned the category "urban" will temporarily produce additional costs which pushes detours around inner cities. But:
  • decreasing the value (e.g. to 0) doesn't mean we will look for inner cities ;-)
  • increasing it (e.g. to 1000) doesn'T mean that we won't drive through inner cities :o
  • There is a clear dependency to all the other >100 properties!
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
Edmond Dantes
Posts: 6
Joined: Tue Apr 01, 2025 7:14 am

Re: How to Define a Permanent City Access Permit in Route Planning

Post by Edmond Dantes »

Thank you for the answers.
Yes, you’re right about what you described. We’re experimenting with many different parameters. I can also see that changing a single parameter on its own might cause problems elsewhere. We increase, decrease, or modify certain values in pairs, etc.
Our company has a year-round permit for entering and passing through the town of Dabas. I was thinking that using coordinates, it might be possible to define an area—like a polygon—within which entry and transit are allowed.
On its own, I can easily solve the issue of driving through Dabas in just a moment:
{
"id": "PTV_TruckAttributes",
"enabled": false
}

This way, the planner immediately routes through Dabas. Of course, from that point on, it causes serious and unacceptable planning errors along the rest of the route as you described. We’re experimenting too. But this still seems to be a rather difficult problem to solve.

Thank You
Post Reply