Routing countries

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
KZsolt
Posts: 51
Joined: Fri Oct 03, 2014 1:19 pm

Routing countries

Post by KZsolt »

Hello guys!

I face an interesting problem that I can't solve on my own:
PTVproblem.png
As you can see on the attached picture I have a defined waypoint next to a border (green flag) , and the NEXT_SEGMENT or AUTO_LINKING links that point to the START position. The problem comes from that new position because it's in a different country which is excluded during the planning. As a result PTV can not plan that route.

The easy solution could come from the heading values but they are not defined in that case. My first idea was to increase the search range for the matching, but it had no effect. As I see PTV doesn't try to find a new waypoint after he find 1 which is valid, even if he can't plan a route with it. Is that correct?

Do you have any suggestions how can the matched point be placed in the same country as the original point?

Thank you,
K.Zsolt
User avatar
Bernd Welter
Site Admin
Posts: 2577
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Routing countries

Post by Bernd Welter »

Hello K.Zsolt,

your request is really special - due to the constraint of the border coordinates.
I forwarded your question to some developers but to be honest: I expect this problem can't be resolved that easy.

If the task is a conflict similar to "compute a route from one island to another but don't use ferries" it is not possible to find a generic solution. But let's wait for the devlopers response.

Best regards from Germany,

Bernd
KZsolt
Posts: 51
Joined: Fri Oct 03, 2014 1:19 pm

Re: Routing countries

Post by KZsolt »

Helo!

Actually it's not really similar to "compute a route from one island to another but don't use ferries" problem in my opinion. Instead I need to limit the waypoint linking somehow only to work in the country I define in the original point. So the matched point doesn't "move" to the other country and the planning will work. I'm not sure if there is any way to achieve that without using angle parameters, but hopefully you can suggest something.

Regards,
K. Zsolt
User avatar
Bernd Welter
Site Admin
Posts: 2577
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Routing countries

Post by Bernd Welter »

Hello K.Zsolt,

meanwhile I received the following answer from the core developer:

Yes you are right: during the linking step we do not consider the parameters allowedCountries and forbiddenCountries.
This is because we can't decide what kind of routing is expected under such conditions.

But: even if the linker chooses the segment in the "allowed" country: this would lead straight to the border which one you are not allowed to cross. So from our perspective this challenge can't be resolved by design.

We might replay this specific example based on your coordinates but I expect that "start segment is forbidden" is simply replaced by "can't find a valid route".

Sorry for this negative feedback,
unfortunately this is the current approach of our engine.

Worst case you have to identify a better starting point manually.

Best regards from Germany,
Bernd
KZsolt
Posts: 51
Joined: Fri Oct 03, 2014 1:19 pm

Re: Routing countries

Post by KZsolt »

Helo!

Yes sadly I was almost sure that this will be the final case :)
Anyway, thanks for your help! I'll try to find a workaround.

Regards,
Zsolt
Joost
Posts: 307
Joined: Fri Apr 25, 2014 1:46 pm

Re: Routing countries

Post by Joost »

With the feedback above into consideration: Assuming that you always select the point on the border I would go for NEXT_NODE linking and turn one way restrictions into a heavy avoidance. The route will then be "wrong" at the start since it drives back one the wrong highway lane until the first chance to switch lanes again. It migth not be perfect but better then nothing.

xRoute Profile in the online manual:
http://xserver.ptvgroup.com/fileadmin/f ... e%7C_____0

Look for: Routing / Course / BasicDataRules / Blockings / @oppositeDirectionInOneWayRoadMalus and set this attribute to 2500 .

Disclaimer: I haven't been able to work this out in an actual test so it "works in theory". I would be interested to see if this helps you.
User avatar
Bernd Welter
Site Admin
Posts: 2577
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Routing countries

Post by Bernd Welter »

Hello K.Zsolt, Joost,

I made a test - seems to work, but: I do not believe this is what you want to have. See my attached screenshots.
Austria forbidden, but against one way allowed (DANGEROUS!)
Austria forbidden, but against one way allowed (DANGEROUS!)
Austria (43) is allowed - regular request
Austria (43) is allowed - regular request
The snippet looks like this:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Routing majorVersion="2" minorVersion="0">
		<Course>
			<BasicDataRules>
				<Blockings oppositeDirectionInOneWayRoadMalus="2500" />
			</BasicDataRules>
		</Course>
	</Routing>
</Profile>
This is the complete request (ok, a little bit overheady :D ) snippet in line 47

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<soap:Body>
		<calculateExtendedRoute xmlns="http://types.xroute.xserver.ptvag.com">
			<ArrayOfWaypointDesc_1>
				<WaypointDesc fuzzyRadius="0" linkType="NEXT_NODE" xmlns="http://xroute.xserver.ptvag.com">
					<wrappedCoords>
						<Point xmlns="http://common.xserver.ptvag.com">
							<kml xsi:nil="true" />
							<point x="1903093" y="6087297" />
						</Point>
					</wrappedCoords>
					<nodeID xsi:nil="true" />
					<wrappedRoutingOptions xsi:nil="true" />
					<wrappedSegmentID xsi:nil="true" />
					<wrappedVehicleOptions xsi:nil="true" />
					<viaType xsi:nil="true" />
				</WaypointDesc>
				<WaypointDesc fuzzyRadius="0" linkType="NEXT_NODE" xmlns="http://xroute.xserver.ptvag.com">
					<wrappedCoords>
						<Point xmlns="http://common.xserver.ptvag.com">
							<kml xsi:nil="true" />
							<point x="1909701" y="6084076" />
						</Point>
					</wrappedCoords>
					<nodeID xsi:nil="true" />
					<wrappedRoutingOptions xsi:nil="true" />
					<wrappedSegmentID xsi:nil="true" />
					<wrappedVehicleOptions xsi:nil="true" />
					<viaType xsi:nil="true" />
				</WaypointDesc>
			</ArrayOfWaypointDesc_1>
			<ArrayOfRoutingOption_2>
				<RoutingOption parameter="EXCLUDE_COUNTRIES" value="43" xmlns="http://xroute.xserver.ptvag.com" />
			</ArrayOfRoutingOption_2>
			<ArrayOfExceptionPath_3 xsi:nil="true" />
			<ResultListOptions_4 binaryPathDesc="false" boundingRectanglesC="0" boundingRectanglesOffset="0" brunnelManoeuvres="false" detailLevel="BORDERS" dynamicInfo="false" manoeuvreAttributes="false" manoeuvreGroups="false" manoeuvres="false" nodes="false" polygon="true" segmentAttributes="false" segments="false" texts="false" tollManoeuvres="false" totalRectangle="false" urbanManoeuvres="false">
				<cenEmissionConfiguration xsi:nil="true" xmlns="http://xroute.xserver.ptvag.com" />
				<destDetail xsi:nil="true" xmlns="http://xroute.xserver.ptvag.com" />
				<emissions xsi:nil="true" xmlns="http://xroute.xserver.ptvag.com" />
				<hbefaType xsi:nil="true" xmlns="http://xroute.xserver.ptvag.com" />
				<startDetail xsi:nil="true" xmlns="http://xroute.xserver.ptvag.com" />
			</ResultListOptions_4>
			<CountryInfoOptions_5 xsi:nil="true" />
			<CallerContext_6>
				<wrappedProperties xmlns="http://baseservices.service.jabba.ptvag.com">
					<CallerContextProperty key="ProfileXMLSnippet" value="<?xml version="1.0" encoding="utf-8"?><Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Routing majorVersion="2" minorVersion="0"><Course><BasicDataRules><Blockings oppositeDirectionInOneWayRoadMalus="2500" /></BasicDataRules></Course></Routing></Profile>" />
					<CallerContextProperty key="CoordFormat" value="PTV_MERCATOR" />
				</wrappedProperties>
			</CallerContext_6>
		</calculateExtendedRoute>
	</soap:Body>
</soap:Envelope>
Regards Bernd
KZsolt
Posts: 51
Joined: Fri Oct 03, 2014 1:19 pm

Re: Routing countries

Post by KZsolt »

Hello guys!

Thanks for the ideas, but sadly that workaround won't exactly fit to our needs :(.
We have to make a map presentation of the route we plan and that will just look misleading like that.
Currently we are working on a solid algorithm which defines new waypoints instead of the problematic original ones, close to the desired lanes.

Regards,
Zsolt
Post Reply