Good morning,
I created a Windows application for route planning. When planning a route, it happens that I have a route planned in spite of a closed road (no entry). I can not to figure out which parameters I have set wrongly.
For example, bypass german town of Nauen
Thank you
Vladimir
Route planned in spite of a closed road
Route planned in spite of a closed road
Vladimír Plachý, DiS.
Developer windows applications
D&Comm s.r.o. - Czech Republic
Developer windows applications
D&Comm s.r.o. - Czech Republic
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Route planned in spite of a closed road
Hello Vladimir,
sounds like you successfully activated a specific feature layer (PTV_TrafficIncidents? PTV_TruckAttributes?) in the mapping call but not in the routing call.
If this is the case please ensure to use a valid profile XML snippet, e.g. to activate PTV_TruckAttributes (minimalistic example).
Best regards
Bernd
sounds like you successfully activated a specific feature layer (PTV_TrafficIncidents? PTV_TruckAttributes?) in the mapping call but not in the routing call.
If this is the case please ensure to use a valid profile XML snippet, e.g. to activate PTV_TruckAttributes (minimalistic example).
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http:///xroute/schema/XRouteProfile.xsd">
<FeatureLayer majorVersion="1" minorVersion="0">
<GlobalSettings enableTimeDependency="true"/>
<Themes>
<Theme id="PTV_TruckAttributes" enabled="true"/>
</Themes>
</FeatureLayer>
<Routing majorVersion="2" minorVersion="0">
<Course>
<AdditionalDataRules enabled="true"/>
</Course>
</Routing>
</Profile>
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...
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...
Re: Route planned in spite of a closed road
Hello Bernd,
I am active in the calculation feature layer PTV_TruckAttributes. I use this XML code, but it still does not count correctly.
I even tried your XML, and that does not work.
This is part of the code for route calculation.
Best regards,
Vladimír
I am active in the calculation feature layer PTV_TruckAttributes. I use this XML code, but it still does not count correctly.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http:///xroute/schema/XRouteProfile.xsd">
<FeatureLayer majorVersion="1" minorVersion="0">
<GlobalSettings enableTimeDependency="true"/>
<Themes>
<Theme id="PTV_TruckAttributes" enabled="true"/>
</Themes>
</FeatureLayer>
<Common coordinateFormat="PTV_MERCATOR" language="en" majorVersion="1" minorVersion="0" />
<Routing majorVersion="2" minorVersion="0">
<Vehicle>
<Physical>
<Drive driveType="MOTORIZED">
<Emissions emissionClass="EURO_5" emissionTechnology="NONE" lowEmissionZoneType="GREEN" particleFilterInstalled="false" particleReductionClass="0"/>
<Engine bioFuelRatio="0" cylinderCapacity="12000" fuelConsumption="4.5" fuelType="DIESEL"/>
</Drive>
<Weight emptyWeight="10000" loadWeight="15000" totalPermittedWeight="39998"/>
<Axle axleLoad="11500" numberOfAxles="5"/>
<Trailer emptyWeight="5000"/>
<Dimension height="399" length="1799" width="254"/>
</Physical>
<Legal yearOfManufacture="2010">
<LegalCondition isAuthorized="false" isDelivery="false" isEmergency="false" isMaintenance="false" isProject="false"/>
</Legal>
<Load hazardousGoodsType="NONE" loadType="GOODS" tunnelRestrictionCode="NONE"/>
<Speed maximumSpeed="255" speedForAirLineDistance="36">
<SpeedRangeByNetworkClass maximumSpeed="80" minimumSpeed="55"/>
<SpeedRangeByNetworkClass maximumSpeed="60" minimumSpeed="30"/>
<SpeedRangeByNetworkClass maximumSpeed="55" minimumSpeed="23"/>
<SpeedRangeByNetworkClass maximumSpeed="45" minimumSpeed="20"/>
<SpeedRangeByNetworkClass maximumSpeed="40" minimumSpeed="18"/>
<SpeedRangeByNetworkClass maximumSpeed="30" minimumSpeed="15"/>
<SpeedRangeByNetworkClass maximumSpeed="12" minimumSpeed="7"/>
<SpeedRangeByNetworkClass maximumSpeed="6" minimumSpeed="4"/>
</Speed>
</Vehicle>
<Waypoint linkType="AREA_SEGMENTS" maximumDistanceToCombinedTransport="1000" maximumDistanceToSegment="5000">
<LinkTypeConfiguration>
<Road headingTolerance="360" maximumDistanceForNetworkClass0="1000" maximumNetworkClass="7" minimumNetworkClass="0" onlyReachableRoads="false"/>
<Smart checkNetworkClassOnlyForVias="true" maximumDistanceToMainNode="100" maximumDistanceToMainNodeForNetworkClass0="1500"/>
<TollStation maximumDistance="1000"/>
<RoadName maximumDistance="3000" maximumDistanceToMainNode="2000"/>
</LinkTypeConfiguration>
</Waypoint>
<Course>
<AdditionalDataRules enabled="true">
<SegmentSpecific useBlockedForCarsAttribute="true" useBlockedForTrucksAttribute="true" useFerryDuration="true" useFerryLength="true" useRampAttribute="true" useSegmentLength="true" useSpeed="true" useTollForCarsAttribute="true" useTollForTrucksAttribute="true" useUrbanAttribute="true"/>
<VehicleSpecific enabled="false">
<Malus combustibles="0" delivery="0" hazardousGoods="0" hazardousToWaters="0" maintenanceTrucks="0" preferredForHazardousGoods="0" preferredForTrucks="0" residential="0" restrictedTunnel="0" vehiclesWithTrailer="0"/>
</VehicleSpecific>
</AdditionalDataRules>
<DynamicRouting breakCalculationPrecision="4294967295" dynamicTimeOnStaticRoute="false" layerName="" limitDynamicSpeedToStaticSpeed="true" useFreeFlowSpeed="false" useLegacyDynamic="false">
<SpeedMapping baseSpeed="1" mappedSpeed="1"/>
<SpeedMapping baseSpeed="10" mappedSpeed="10"/>
<SpeedMapping baseSpeed="20" mappedSpeed="20"/>
<SpeedMapping baseSpeed="30" mappedSpeed="30"/>
<SpeedMapping baseSpeed="40" mappedSpeed="40"/>
<SpeedMapping baseSpeed="50" mappedSpeed="50"/>
<SpeedMapping baseSpeed="60" mappedSpeed="56"/>
<SpeedMapping baseSpeed="70" mappedSpeed="61"/>
<SpeedMapping baseSpeed="80" mappedSpeed="66"/>
<SpeedMapping baseSpeed="90" mappedSpeed="69"/>
<SpeedMapping baseSpeed="100" mappedSpeed="72"/>
<SpeedMapping baseSpeed="110" mappedSpeed="73"/>
<SpeedMapping baseSpeed="120" mappedSpeed="74"/>
<SpeedMapping baseSpeed="130" mappedSpeed="75"/>
<SpeedMapping baseSpeed="140" mappedSpeed="75"/>
<DynamicTimeStep count="1" size="900"/>
</DynamicRouting>
<Maneuver considerTurningBans="true" uTurnCost="5000"/>
<Violations>
<SegmentBlockingViolations cost="50000" enabled="false"/>
</Violations>
<BasicDataRules>
<Blockings blockedInWinterMalus="0" blockedMalus="2501" blockedTimeDependentMalus="0" oppositeDirectionInOneWayRoadMalus="2501"/>
<Network rampMalus="0">
<MalusByNetworkClass malus="0"/>
<MalusByNetworkClass malus="0"/>
<MalusByNetworkClass malus="0"/>
<MalusByNetworkClass malus="0"/>
<MalusByNetworkClass malus="15"/>
<MalusByNetworkClass malus="2500"/>
<MalusByNetworkClass malus="0"/>
<MalusByNetworkClass malus="0"/>
</Network>
<Toll extraTollMalus="0" tollMalus="0" vignetteMalus="0"/>
<SpecialAreas forbiddenLowEmissionZoneMalus="2500" minimumUrbanNetworkClass="2" residentialMalus="0" urbanMalus="0"/>
<CombinedTransport ferryMalus="100" piggybackMalus="0"/>
</BasicDataRules>
</Course>
</Routing>
</Profile>
This is part of the code for route calculation.
Code: Select all
ResultListOptions RsltListOptions = new ResultListOptions();
RsltListOptions.binaryPathDesc = true;
RsltListOptions.polygon = true;
RsltListOptions.dynamicInfo = true;
RsltListOptions.extSegments = true;
RsltListOptions.featureDescriptions = true;
RsltListOptions.nodes = true;
RsltListOptions.speedLimits = true;
RsltListOptions.segments = true;
RsltListOptions.texts = true;
RsltListOptions.detailLevel = DetailLevel.ALL;
RsltListOptions.polygonElevationsSpecified = true;
RsltListOptions.polygonElevations = true;
RsltListOptions.tollManoeuvres = true;
RsltListOptions.manoeuvres = true;
RsltListOptions.manoeuvreGroups = true;
RsltListOptions.brunnelManoeuvres = true;
RsltListOptions.manoeuvreAttributes = true;
RsltListOptions.tollManoeuvres = true;
RsltListOptions.urbanManoeuvres = true;
RoutingOption[] RoutOption = new RoutingOption[11];
RoutOption[0] = new RoutingOption();
RoutOption[0].parameter = XrouteService.RoutingParameter.ROUTE_LANGUAGE;
RoutOption[0].value = "CS";
RoutOption[1] = new RoutingOption();
RoutOption[1].parameter = XrouteService.RoutingParameter.COUNTRY_ENCODING;
RoutOption[1].value = "ISO2";
RoutOption[2] = new RoutingOption();
RoutOption[2].parameter = XrouteService.RoutingParameter.START_TIME;
RoutOption[2].value = sStartDate;
RoutOption[3] = new RoutingOption();
RoutOption[3].parameter = XrouteService.RoutingParameter.IS_DESTTIME;
RoutOption[3].value = sIS_DESTTIME;
RoutOption[4] = new RoutingOption();
RoutOption[4].parameter = XrouteService.RoutingParameter.OPTIMIZATION;
RoutOption[4].value = Convert.ToString(Convert.ToInt32(Selected_VehicleProfileList.Optimisation));
RoutOption[5] = new RoutingOption();
RoutOption[5].parameter = XrouteService.RoutingParameter.GENERATE_EXTWAYPOINTS;
RoutOption[5].value = "true";
RoutOption[6] = new RoutingOption();
RoutOption[6].parameter = XrouteService.RoutingParameter.ENABLE_DYNAMIC;
RoutOption[6].value = "true";
RoutOption[7] = new RoutingOption();
RoutOption[7].parameter = XrouteService.RoutingParameter.DYNAMIC_PROFILE;
RoutOption[7].value = "PTV_TruckAttributes";
RoutOption[8] = new RoutingOption();
RoutOption[8].parameter = XrouteService.RoutingParameter.SPEED_INFOS;
RoutOption[8].value = "true";
RoutOption[9] = new RoutingOption();
RoutOption[9].parameter = XrouteService.RoutingParameter.ALLOW_SEGMENT_VIOLATIONS;
RoutOption[9].value = "false";
RoutOption[10] = new RoutingOption();
RoutOption[10].parameter = XrouteService.RoutingParameter.GENERATE_EXTWAYPOINTS;
RoutOption[10].value = "true";
CountryInfoOptions CountryInfoOption = new XrouteService.CountryInfoOptions();
CountryInfoOption.allEuro = false;
CountryInfoOption.calculatePartTollCosts = true;
CountryInfoOption.detailedTollCosts = true;
CountryInfoOption.tollDate = DateTime.Now;
CountryInfoOption.tollDateSpecified = true;
CountryInfoOption.namedToll = true;
CountryInfoOption.namedTollSpecified = true;
CountryInfoOption.currencyDescription = true;
CountryInfoOption.currencyDescriptionSpecified = true;
CountryInfoOption.tollTotals = true;
CountryInfoOption.tollTotalsSpecified = true;
CountryInfoOption.waypointIndexInTollCostInfo = true;
CountryInfoOption.waypointIndexInTollCostInfoSpecified = true;
response2 = xRoute.calculateExtendedRoute(new calculateExtendedRouteRequest
{
ArrayOfWaypointDesc_1 = wayPoints,
ArrayOfRoutingOption_2 = RoutOption,
ResultListOptions_4 = RsltListOptions,
CountryInfoOptions_5 = CountryInfoOption,
CallerContext_6 = new PTVxServerInternet.XrouteService.CallerContext
{
wrappedProperties = new[]
{
new PTVxServerInternet.XrouteService.CallerContextProperty { key = "ProfileXMLSnippet", value = sNewXML}
}
}
});
Best regards,
Vladimír
Vladimír Plachý, DiS.
Developer windows applications
D&Comm s.r.o. - Czech Republic
Developer windows applications
D&Comm s.r.o. - Czech Republic
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Route planned in spite of a closed road
Hi there,
meanwhile we reproduced the issue:
The blocking displayed in the map is a PTV_TrafficIncident (and not a TruckAttribute).
As traffic incidents are time dependent it is important to be aware of the reference time of both ROUTE and MAP:
If the map visualizes the current datetime as reference but the routing refers to a completely different time the route might seem to be invalid.
Best regards Bernd
meanwhile we reproduced the issue:
The blocking displayed in the map is a PTV_TrafficIncident (and not a TruckAttribute).
As traffic incidents are time dependent it is important to be aware of the reference time of both ROUTE and MAP:
If the map visualizes the current datetime as reference but the routing refers to a completely different time the route might seem to be invalid.
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...
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...