{"id":81,"date":"2020-05-12T09:12:09","date_gmt":"2020-05-12T07:12:09","guid":{"rendered":"http:\/\/wiki.hogs.live\/?page_id=81"},"modified":"2021-01-21T08:04:24","modified_gmt":"2021-01-21T07:04:24","slug":"wyznaczanie-trasy-2","status":"publish","type":"page","link":"https:\/\/wiki.hogs.live\/en\/wyznaczanie-trasy-2\/","title":{"rendered":"calculateRoute"},"content":{"rendered":"<blockquote class=\"wp-block-quote\"><p><code>mode=calculateRoute<\/code><\/p><\/blockquote>\n\n\n\n<p>Iframe mode that allows route plotting.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p> <code>&lt;iframe src=\"https:\/\/iframe.hogs.live?authToken=&lt;authToken&gt;&amp;mode=calculateRoute&amp;options=&lt;options&gt;\"&gt;&lt;\/iframe&gt; <\/code><\/p><\/blockquote>\n\n\n\n<h3>Options<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code> <em>interface<\/em>&nbsp;CalculateRouteOptions&nbsp;{<br>&nbsp;&nbsp;waypoints: Waypoint[];<br>&nbsp;&nbsp;vehicleSpec:&nbsp;VehicleSpec;<br>&nbsp;&nbsp;routeSettings:&nbsp;CustomRouteSettings; <br>&nbsp;&nbsp;calculatorSettings:&nbsp;<em>CalculatorSettings<\/em>;<\/code> <code><br>&nbsp;&nbsp;mode:&nbsp;RouteKind;<br>&nbsp;&nbsp;alternatives?:&nbsp;<em>boolean<\/em>;<\/code> <code> <br>&nbsp;&nbsp;showInfo?:&nbsp;<em>boolean<\/em>;<\/code> <code><br>&nbsp;&nbsp;link?:&nbsp;<em>string<\/em>;<\/code> <code><br>} <\/code><\/p><\/blockquote>\n\n\n\n<p class=\" translation-block\"><strong>Alternatives<\/strong> parameter causes the route querry to return with alternative routes. Alternative routes are not visually represented in the iframe.<\/p>\n\n\n\n<h4>Waypoints<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code><em>interface<\/em>&nbsp;Waypoint&nbsp;{<br>&nbsp;&nbsp;lat:&nbsp;<em>string<\/em>; <br>&nbsp;&nbsp;lat:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;passThrough?:&nbsp;<em>boolean<\/em>;<br>}<\/code><\/p><\/blockquote>\n\n\n\n<p class=\" translation-block\">Only intermediary points can have <strong>passThrough: true value<\/strong>.<\/p>\n\n\n\n<h4>VehicleSpec<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote\"><p> <code><em>interface<\/em>&nbsp;VehicleSpec&nbsp;{<br>&nbsp;&nbsp;truckHeight:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;truckWidth:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;truckLength:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;truckWeight:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;axisNumberTractor:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;euroClass:&nbsp;EuroClass;<br>&nbsp;&nbsp;heightAboveFirstAxle:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;vehicleType:&nbsp;VehicleType;<br>&nbsp;&nbsp;weightPerAxle:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;trailerHeight:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;axisNumberTrailer:&nbsp;<em>string<\/em>;<br>} <\/code><\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code> <em>enum<\/em>&nbsp;EuroClass&nbsp;{<br>&nbsp;&nbsp;EURO_I&nbsp;=&nbsp;\"1\",<br>&nbsp;&nbsp;EURO_II&nbsp;=&nbsp;\"2\",<br>&nbsp;&nbsp;EURO_III&nbsp;=&nbsp;\"3\",<br>&nbsp;&nbsp;EURO_IV&nbsp;=&nbsp;\"4\",<br>&nbsp;&nbsp;EURO_V&nbsp;=&nbsp;\"5\",<br>&nbsp;&nbsp;EURO_VI&nbsp;=&nbsp;\"6\",<br>&nbsp;&nbsp;EURO_EEV&nbsp;=&nbsp;\"7\",<br>&nbsp;&nbsp;Electric_Vehicles&nbsp;=&nbsp;\"8\"<br>} <\/code><\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code> <em>enum<\/em>&nbsp;VehicleType&nbsp;{<br>&nbsp;&nbsp;truckTractor&nbsp;=&nbsp;\"truckTractor\",<br>&nbsp;&nbsp;tandem&nbsp;=&nbsp;\"tandem\",<br>&nbsp;&nbsp;solo&nbsp;=&nbsp;\"solo\",<br>&nbsp;&nbsp;bus&nbsp;=&nbsp;\"bus\" <br>&nbsp;&nbsp;car =&nbsp;\"car\"<br>} <\/code><\/p><\/blockquote>\n\n\n\n<h4>Attention!<\/h4>\n\n\n\n<p class=\" translation-block\">Choosing <strong>car<\/strong> (passenger car) type will switch from articulated vehicle route plotting to passener car plotting and all parameters provided in <strong>VehicleSpec<\/strong> will not be considered. Only <strong>axisNumberTractor, euroClass, truckHeight, truckWeight<\/strong> parameters are usig when calculating road toll. Parameters are optional and the only default value is the number of axis (axisNumberTractor) \u2013 2.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>Parameter<\/strong><\/td><td><strong>Example<\/strong><\/td><td><strong>Default value<\/strong><\/td><td><strong>Comments<\/strong><\/td><\/tr><tr><td> truckHeight <\/td><td> 4.00 <\/td><td> 4.00 <\/td><td> tractor height (m) <\/td><\/tr><tr><td> truckWidth <\/td><td> 2.5 <\/td><td> 2.55 <\/td><td> set width (m) <\/td><\/tr><tr><td> truckLength <\/td><td>  16.5 <\/td><td> 16.5 <\/td><td> set length (m) <\/td><\/tr><tr><td> truckWeight <\/td><td> 40.00  <\/td><td> 40.00 <\/td><td> total set weight (t) <\/td><\/tr><tr><td> axisNumberTractor <\/td><td>  2 <\/td><td> 2 <\/td><td> tractor axles number <\/td><\/tr><tr><td> euroClass <\/td><td>6<\/td><td>6<\/td><td> exhaust fumes norm <\/td><\/tr><tr><td> heightAboveFirstAxle <\/td><td>  4.00  <\/td><td> 4.00 <\/td><td> height above first axle (m) <\/td><\/tr><tr><td> vehicleType <\/td><td> truckTractor  <\/td><td> truckTractor <\/td><td class=\" translation-block\">Vehicle type - if a vehicle without trailer is chosen the <strong>trailerHeight<\/strong> and <strong>axisNumberTrailer<\/strong> parameters are ignored.<\/td><\/tr><tr><td> weightPerAxle <\/td><td>  10  <\/td><td> 10 <\/td><td>axle load<\/td><\/tr><tr><td> trailerHeight <\/td><td>  4.00  <\/td><td> 4.00 <\/td><td> trailer height (m) <\/td><\/tr><tr><td> axisNumberTrailer <\/td><td> 3 <\/td><td> 3 <\/td><td> trailer axles number <\/td><\/tr><\/tbody><\/table>\n\n\n\n<h4> CustomRouteSettings <\/h4>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code> <em>interface<\/em>&nbsp;CustomRouteSettings&nbsp;{<br>&nbsp;&nbsp;departure?:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;avoidPayments?:&nbsp;<em>boolean<\/em>;<br>&nbsp;&nbsp;avoidCountries?:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;shippedHazardousGoods?:&nbsp;ShippedHazardousGoods; <br>&nbsp;&nbsp;avoidFerries?:&nbsp;RouteFeatureWeight; <br>&nbsp;&nbsp;avoidMotorways?:&nbsp;RouteFeatureWeight; <br>&nbsp;&nbsp;currency?:&nbsp;<em>string<\/em>;<br>} <\/code><\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote\"><p> <code><em>enum<\/em>&nbsp;ShippedHazardousGoods&nbsp;{<br>&nbsp;&nbsp;explosive&nbsp;=&nbsp;\"explosive\",<br>&nbsp;&nbsp;gas&nbsp;=&nbsp;\"gas\",<br>&nbsp;&nbsp;flammable&nbsp;=&nbsp;\"flammable\",<br>&nbsp;&nbsp;combustible&nbsp;=&nbsp;\"combustible\",<br>&nbsp;&nbsp;organic&nbsp;=&nbsp;\"organic\",<br>&nbsp;&nbsp;poison&nbsp;=&nbsp;\"poison\",<br>&nbsp;&nbsp;radioActive&nbsp;=&nbsp;\"radioActive\",<br>&nbsp;&nbsp;corrosive&nbsp;=&nbsp;\"corrosive\",<br>&nbsp;&nbsp;poisonousInhalation&nbsp;=&nbsp;\"poisonousInhalation\",<br>&nbsp;&nbsp;harmfulToWater&nbsp;=&nbsp;\"harmfulToWater\",<br>&nbsp;&nbsp;other&nbsp;=&nbsp;\"other\"<br>} <\/code><\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote\"><p> <code><em>enum<\/em>&nbsp;RouteFeatureWeight&nbsp;{<br>&nbsp;&nbsp;STRICT_EXCLUDE&nbsp;=&nbsp;-3,<br>&nbsp;&nbsp;SOFT_EXCLUDE&nbsp;=&nbsp;-2,<br>&nbsp;&nbsp;AVOID&nbsp;=&nbsp;-1,<br>&nbsp;&nbsp;NORMAL&nbsp;=&nbsp;0<br>}<\/code><\/p><\/blockquote>\n\n\n\n<p>Excluding ferries or highways may have different weight:<\/p>\n\n\n\n<ul><li><strong>STRICT_EXCLUDE <\/strong>- static exclusion, route will not contain static exclusion functions. If the condition cannot be met, the route will not be plotted.<\/li><li><strong>SOFT_EXCLUDE <\/strong>- soft exclusion, fragments with excluded functions have high penalties.<\/li><li><strong>AVOID <\/strong>- avoiding, soft exclusion, fragments with excluded functions have low penalties, the route will be plotted for the excluded fragment if the there are no alternatives.<\/li><li><strong>NORMAL <\/strong>- without this setting the route will be plotted without exclusions.<\/li><\/ul>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>Parameter<\/strong><\/td><td><strong>Example<\/strong><\/td><td><strong>Default value<\/strong><\/td><td><strong>Comments<\/strong><\/td><\/tr><tr><td> departure <\/td><td> 2019-05-09T17:00:00+02 <\/td><td> &#8211;<\/td><td> format: YYYY + &#8217;-&#8217; + MM + &#8217;-&#8217; + DD + 'T&#8217; + hh + &#8217;:&#8217; + mm + &#8217;:&#8217; + ss + '+ strefa czasowa&#8217;.  Wa\u017cne! Przy wczytywaniu iframe&#8217;a za pomoc\u0105 GETa '+&#8217; trzeba zmieni\u0107 na '%2B&#8217; <\/td><\/tr><tr><td> avoidPayments <\/td><td>true<\/td><td>&#8211;<\/td><td>&#8211;<\/td><\/tr><tr><td> avoidCountries <\/td><td> CHE,DEU <\/td><td>&#8211;<\/td><td>ISO 3166-1-aplha-3 norm country codes after coma <\/td><\/tr><tr><td> shippedHazardousGoods <\/td><td> explosive  <\/td><td>&#8211;<\/td><td> ShippedHazardousGoods value from enum&nbsp;<\/td><\/tr><tr><td> currency <\/td><td> EUR <\/td><td> EUR <\/td><td> ISO 4217 currency code <\/td><\/tr><tr><td> avoidFerries <\/td><td> STRICT_EXCLUDE&nbsp; <\/td><td>&#8211;<\/td><td>RouteFeatureWeight value from enum&nbsp; <\/td><\/tr><tr><td> avoidMotorways <\/td><td> AVOID  <\/td><td>&#8211;<\/td><td> RouteFeatureWeight value from enum&nbsp;  <\/td><\/tr><\/tbody><\/table>\n\n\n\n<h4> CalculatorSettings <\/h4>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code> <em>interface<\/em>&nbsp;CalculatorSettings&nbsp;{<br>&nbsp;&nbsp;averageConsumption:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;fuelPrice:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;othersCosts:&nbsp;<em>number<\/em>;<br>} <\/code><\/p><\/blockquote>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td> <strong>Parameter<\/strong> <\/td><td> <strong>Example<\/strong> <\/td><td>  <strong>Default value<\/strong> <\/td><td> <strong>Comments<\/strong> <\/td><\/tr><tr><td> averageConsumption <\/td><td> 27 <\/td><td> 27 <\/td><td>average fuel consumtion per 100 kilometers<\/td><\/tr><tr><td> fuelPrice <\/td><td> 1.15 <\/td><td> 1.15 <\/td><td>fuel cost per liter, default in EUR<\/td><\/tr><tr><td> othersCosts <\/td><td> 0 <\/td><td> 0 <\/td><td>additional costs per km, curreny same as provided in recent routes<\/td><\/tr><\/tbody><\/table>\n\n\n\n<h4>Mode<\/h4>\n\n\n\n<p class=\" translation-block\"><strong>Mode<\/strong> parameter defines what route will be returned: shorters, fastest, cheapers, ecological. Shortest route is default value.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code> e<em>num<\/em>&nbsp;Mode {<br>&nbsp;&nbsp;shortest&nbsp;=&nbsp;\"shortest\",<br>&nbsp;&nbsp;fastest&nbsp;=&nbsp;\"fastest\",<br>&nbsp;&nbsp;eko&nbsp;=&nbsp;\"eko\",<br>&nbsp;&nbsp;cheapest&nbsp;=&nbsp;\"cheapest\"<br>} <\/code><\/p><\/blockquote>\n\n\n\n<h4>ShowInfo<\/h4>\n\n\n\n<p class=\" translation-block\">Parameter that conditions whether a window with the summary of a plotted route will be displayed, <strong>false<\/strong> by default.<\/p>\n\n\n\n<h4>Link<\/h4>\n\n\n\n<p>You can link the Hogs application route and the iframe will open the route. When the link is provided other parameters defining the route will be ignored.<\/p>\n\n\n\n<h2>Examples<\/h2>\n\n\n\n<p>An example showing cheapers route plotting for a 40t tractor, avoiding Switzerland, soft highway exclusion and ADR radioactive cathegory.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><code> <em>const<\/em>&nbsp;options&nbsp;=&nbsp;{<br>&nbsp;&nbsp;waypoints:&nbsp;[<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lng:&nbsp;\"14.110965\",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lat:&nbsp;\"52.264435\"<br>&nbsp;&nbsp;&nbsp;&nbsp;},<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lng:&nbsp;\"2.348631\",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lat:&nbsp;\"50.600393\"<br>&nbsp;&nbsp;&nbsp;&nbsp;},<br>&nbsp;&nbsp;],<br>&nbsp;&nbsp;vehicleSpec:&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;\"truckLength\":&nbsp;\"16.5\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"truckHeight\":&nbsp;\"4.00\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"truckWidth\":&nbsp;\"2.6\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"truckWeight\":&nbsp;\"40.00\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"axisNumberTrailer\":&nbsp;\"4\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"axisNumberTractor\":&nbsp;\"3\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"euroClass\":&nbsp;\"5\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"vehicleType\":&nbsp;\"truckTractor\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"heightAboveFirstAxle\":&nbsp;\"3.2\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"trailerHeight\":&nbsp;\"4.2\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"weightPerAxle\":&nbsp;\"10\",<br>&nbsp;&nbsp;},<br>&nbsp;&nbsp;routeSettings:&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;\"avoidPayments\":&nbsp;false,<br>&nbsp;&nbsp;&nbsp;&nbsp;\"avoidCountries\":&nbsp;\"CHE\",<br>&nbsp;&nbsp;&nbsp;&nbsp;\"avoidMotorways\":&nbsp;\"SOFT_EXCLUDE\", <br>&nbsp;&nbsp;&nbsp;&nbsp;\"shippedHazardousGoods\":&nbsp;\"radioActive\",<br>&nbsp;&nbsp;},<br>&nbsp;&nbsp;calculatorSettings:&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;averageConsumption:&nbsp;30,<br>&nbsp;&nbsp;&nbsp;&nbsp;fuelPrice:&nbsp;1.15,<br>&nbsp;&nbsp;&nbsp;&nbsp;othersCosts:&nbsp;0,<br>&nbsp;&nbsp;},<br>&nbsp;&nbsp;mode:&nbsp;\"cheapest\",<br>} <\/code><\/p><\/blockquote>\n\n\n\n<p>Iframe calling while using encodeURIComponent() function only for the object with data (options parameter): <\/p>\n\n\n\n<p>https:\/\/iframe.hogs.live\/?authToken=<authtoken>&#038;mode=calculateRoute&#038;options={%22showInfo%22:true,%22waypoints%22:[{%22lng%22:%2214.110965%22,%22lat%22:%2252.264435%22},{%22lng%22:%222.348631%22,%22lat%22:%2250.600393%22}],%22vehicleSpec%22:{%22truckLength%22:%2216.5%22,%22truckHeight%22:%224.00%22,%22truckWidth%22:%222.6%22,%22truckWeight%22:%2240.00%22,%22axisNumberTrailer%22:%224%22,%22axisNumberTractor%22:%223%22,%22euroClass%22:%225%22,%22vehicleType%22:%22truckTractor%22,%22vehicleWeight%22:%2240%22,%22heightAboveFirstAxle%22:%223.2%22,%22trailerHeight%22:%224.2%22,%22weightPerAxle%22:%2210%22},%22routeSettings%22:{%22avoidPayments%22:%22false%22,%22avoidCountries%22:%22CHE%22,%22shippedHazardousGoods%22:%22radioActive%22,%22avoidMotorways%22:%22SOFT_EXCLUDE%22},%22calculatorSettings%22:{%22averageConsumption%22:30,%22fuelPrice%22:1.15,%22othersCosts%22:0},%22mode%22:%22cheapest%22}<\/p>\n\n\n\n<p>Provide the user token acquired during authorisation. <\/p>\n\n\n\n<h4>Attention!<\/h4>\n\n\n\n<p>Iframe data interpreting function uses the JSON.parse() method on the options object - smallest syntax mistake will result in error.  <\/p>\n\n\n\n<p>We recommed to use the iframe with event mechanics - does not require to reload the iframe each time to plot a route. Iframe data (optioms parameter) are transmited as object so correct syntax problem is avoided.<\/p>\n\n\n\n<h2>Answer<\/h2>\n\n\n\n<p>Answer about route is emited as calculationSuccess event<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p> <code><em>interface<\/em>&nbsp;Response&nbsp;{<br>&nbsp;&nbsp;type:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;data:&nbsp;Data;<br>}<br><br><em>interface<\/em>&nbsp;Data&nbsp;{<br>&nbsp;&nbsp;route:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;link:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;ferryConnections:&nbsp;FerryConnections[];<br>&nbsp;&nbsp;toll:&nbsp;Toll;<br>&nbsp;&nbsp;legs:&nbsp;Leg[];<br>&nbsp;&nbsp;legTruckRestrictionViolationSections:&nbsp;TruckRestrictionViolationSection[][]  <br>&nbsp;&nbsp;truckRestrictionViolationSections:&nbsp;TruckRestrictionViolationSection[]; <br>&nbsp;&nbsp;totalCost:&nbsp;<em>number<\/em> <br>&nbsp;&nbsp;summaryByCountry:&nbsp;SummaryByCountry[];<br>&nbsp;&nbsp;details:&nbsp;Details;<br>}<br><br><em>interface<\/em>&nbsp;Details&nbsp;{<br>&nbsp;&nbsp;distance:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;travelTime:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;trafficTime:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;co2Emission:&nbsp;<em>number<\/em>;<br>}<br><br><em>interface<\/em>&nbsp;SummaryByCountry&nbsp;{<br>&nbsp;&nbsp;distance:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;trafficTime:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;baseTime:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;travelTime:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;co2Emission:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;country:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;tollRoadDistance:&nbsp;<em>number<\/em>;<br>}<br><br><em>interface<\/em>&nbsp;Toll&nbsp;{<br>&nbsp;&nbsp;costsByCountry:&nbsp;CostsByCountry[];<br>&nbsp;&nbsp;costsByTollSystem:&nbsp;CostsByTollSystem[]; <br>&nbsp;&nbsp;tollPoints:&nbsp;TollPointData[]; <br>&nbsp;&nbsp;tollCost:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;tollSection:&nbsp;<em>TollSection[]<\/em>;<br>&nbsp;&nbsp;legTollPoints:&nbsp;<em>TollPointData<\/em>[][];<br>&nbsp;&nbsp;legTollSection:&nbsp;<em>Toll<\/em>Section[][];<br>&nbsp;&nbsp;routeId:&nbsp;<em>string<\/em>;<br>}<\/code><\/p><p><code><em>interface<\/em>&nbsp;TollPointData&nbsp;{<br>&nbsp;&nbsp;country:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;tollSystemName:&nbsp;<em>string<\/em>; <br>&nbsp;&nbsp;distance:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;costInTargetCurrency:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;shapeIndex:&nbsp;number;<br>&nbsp;&nbsp;tollPointType:&nbsp;'START_TOLL_ROAD'&nbsp;|&nbsp;'END_TOLL_ROAD';<br>&nbsp;&nbsp;position:&nbsp;{&nbsp;lat:&nbsp;<em>number<\/em>,&nbsp;lng:&nbsp;<em>number<\/em>&nbsp;}<br>}<\/code> <\/p><p> <code><em>interface<\/em>&nbsp;TollSection&nbsp;{<br>&nbsp;&nbsp;startShapeIndex:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;endShapeIndex:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;startCoordinate:&nbsp;{&nbsp;lat:&nbsp;<em>string<\/em>,&nbsp;lng:&nbsp;<em>string<\/em>&nbsp;};<br>&nbsp;&nbsp;endCoordinate:&nbsp;{&nbsp;lat:&nbsp;<em>string<\/em>,&nbsp;lng:&nbsp;<em>string<\/em>&nbsp;};<br>&nbsp;&nbsp;distance:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;costInTargetCurrency:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;tollSystemName:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;country:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;sections?:&nbsp;TollSection[];<br>} <br><br><em>interface<\/em>&nbsp;CostsByCountry&nbsp;{<br>&nbsp;&nbsp;amount:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;country:&nbsp;<em>string<\/em>;<br>}<br><br><em>interface<\/em>&nbsp;CostsByTollSystem&nbsp;{<br>&nbsp;&nbsp;amount:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;country:&nbsp;<em>string<\/em>;<br>}<br><br><em>interface<\/em>&nbsp;FerryConnections&nbsp;{<br>&nbsp;&nbsp;fromCity:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;toCity:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;through?:&nbsp;<em>string<\/em>;<br>} <\/code><\/p><p><\/p><p><code><em>interface<\/em>&nbsp;Leg&nbsp;{<br>&nbsp;&nbsp;shape:&nbsp;<em>number<\/em>[];<br>&nbsp;&nbsp;maneuver:&nbsp;Maneuver[];<br>&nbsp;&nbsp;link:&nbsp;Link[];<br>&nbsp;&nbsp;length:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;travelTime:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;waypoint:&nbsp;MappedWaypoint[];<br>}<\/code><\/p><p><code><em>interface<\/em>&nbsp;Maneuver&nbsp;{<br>&nbsp;&nbsp;position:&nbsp;{&nbsp;latitude:&nbsp;<em>number<\/em>,&nbsp;longitude:&nbsp;<em>number<\/em>&nbsp;};<br>&nbsp;&nbsp;action:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;instruction:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;note:&nbsp;Note[];<br>&nbsp;&nbsp;roadNumber:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;toLink:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;travelTime:&nbsp;<em>number<\/em>;<br>}<br><br><em>interface<\/em>&nbsp;Link&nbsp;{<br>&nbsp;&nbsp;linkId:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;shape:&nbsp;<em>number<\/em>[];<br>}<br><br><em>interface<\/em>&nbsp;Note&nbsp;{<br>&nbsp;&nbsp;code:&nbsp;<em>string<\/em>,<br>&nbsp;&nbsp;type:&nbsp;<em>string<\/em><br>&nbsp;&nbsp;text?:&nbsp;<em>string<\/em>,<br>&nbsp;&nbsp;countryChangeDetails?:&nbsp;{&nbsp;toCountry:&nbsp;<em>string<\/em>&nbsp;}<br>}<br><br><em>interface<\/em>&nbsp;MappedWaypoint&nbsp;{<br>&nbsp;&nbsp;linkId:&nbsp;<em>string<\/em>;<br>&nbsp;&nbsp;mappedPosition:&nbsp;{&nbsp;latitude:&nbsp;<em>number<\/em>,&nbsp;longitude:&nbsp;<em>number<\/em>&nbsp;}<br>&nbsp;&nbsp;originalPosition:&nbsp;{&nbsp;latitude:&nbsp;<em>number<\/em>,&nbsp;longitude:&nbsp;<em>number<\/em>&nbsp;}<br>&nbsp;&nbsp;shapeIndex:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;type:&nbsp;<em>string<\/em>;<br>}<\/code><\/p><p><\/p><p> <code><em>interface<\/em>&nbsp;TruckRestrictionViolationSection&nbsp;{<br>&nbsp;&nbsp;startIndexShape:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;endIndexShape:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;startCoordinate:&nbsp;{&nbsp;lat:&nbsp;<em>string<\/em>,&nbsp;lng:&nbsp;<em>string<\/em>&nbsp;};<br>&nbsp;&nbsp;endCoordinate:&nbsp;{&nbsp;lat:&nbsp;<em>string<\/em>,&nbsp;lng:&nbsp;<em>string<\/em>&nbsp;};<br>&nbsp;&nbsp;shape:&nbsp;<em>number<\/em>[];<br>&nbsp;&nbsp;distance:&nbsp;<em>number<\/em>;<br>&nbsp;&nbsp;violation:&nbsp;{&nbsp;[<em>key<\/em>:&nbsp;<em>string<\/em>]:&nbsp;<em>any<\/em>&nbsp;};<br>} <\/code><\/p><\/blockquote>\n\n\n\n<h4>Attention!<\/h4>\n\n\n\n<p>Distance and time values are provided in meters and seconds. Kilometers done via ferry are not subtracted in the country summary.<\/p>\n\n\n\n<p>Notes (note) are included in the maneuver (Maneuver) element in the querry answer - notes contain such information as ex. road bat violation (type: violation, tex: truckRestriction).<\/p>\n\n\n\n<p>Parameters now supported by HOGS application (<a href=\"http:\/\/app.hogs.live\">app.hogs.live<\/a>) such as link generated in the route answer will not open the route in the application:<\/p>\n\n\n\n<ul><li><strong>avoidFerries<\/strong> from CustomRouteSettings <\/li><li><strong>avoidMotorways <\/strong>from CustomRouteSettings  <\/li><li>passenger car as type of vehicle (VehicleType .car)<\/li><\/ul>\n\n\n\n<br>\n\n\n\n<p>Road toll sections <em>TollSection<\/em><\/p>\n\n\n\n<p class=\" translation-block\"><em>tollPoints<\/em> and <em>tollSection<\/em> fields are contained within the road toll answer object. <em>tollPoints<\/em> field contains informaton about start and end point of the section. <em>tollSection<\/em> field defines whole paid sections. If a sections field is defines within the <em>tollSection<\/em> object it means that the cost involved several fragments that do not have to be connected together (ex. time vignette in Holand).<\/p>\n\n\n\n<p class=\" translation-block\">The <em>legTollPoints<\/em> and <em>legTollSections<\/em> fields contain the same points and sections but grouped by route fragments(<em>Leg<\/em>). The <em>shapeIndex<\/em> field is connected to the route shape index in the correct <em>leg<\/em> object. Simular situation applies to the information about sections describing describing restrictions violation such as <em>legTruckRestrictionViolationSections<\/em> and <em>truckRestrictionViolationSections<\/em>.<\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>mode=calculateRoute Tryb pracy iframe pozwalaj\u0105cy wyznaczy\u0107 tras\u0119. &lt;iframe src=&#8221;https:\/\/iframe.hogs.live?authToken=&lt;authToken&gt;&amp;mode=calculateRoute&amp;options=&lt;options&gt;&#8221;&gt;&lt;\/iframe&gt; Options interface&nbsp;CalculateRouteOptions&nbsp;{&nbsp;&nbsp;waypoints: Waypoint[];&nbsp;&nbsp;vehicleSpec:&nbsp;VehicleSpec;&nbsp;&nbsp;routeSettings:&nbsp;CustomRouteSettings; &nbsp;&nbsp;calculatorSettings:&nbsp;CalculatorSettings; &nbsp;&nbsp;mode:&nbsp;RouteKind;&nbsp;&nbsp;alternatives?:&nbsp;boolean; &nbsp;&nbsp;showInfo?:&nbsp;boolean; &nbsp;&nbsp;link?:&nbsp;string; } Parametr alternatives powoduje, \u017ce w odpowiedzi o trasie zwracane s\u0105 tak\u017ce trasy alternatywne. Trasy alternatywne nie s\u0105 wizualnie przedstawione w iframe&#8217;ie. Waypoints interface&nbsp;Waypoint&nbsp;{&nbsp;&nbsp;lat:&nbsp;string; &nbsp;&nbsp;lat:&nbsp;string;&nbsp;&nbsp;passThrough?:&nbsp;boolean;} Tylko punkty po\u015brednie mog\u0105 mie\u0107 w\u0142a\u015bciwo\u015b\u0107 passThrough: true. VehicleSpec interface&nbsp;VehicleSpec&nbsp;{&nbsp;&nbsp;truckHeight:&nbsp;string;&nbsp;&nbsp;truckWidth:&nbsp;string;&nbsp;&nbsp;truckLength:&nbsp;string;&nbsp;&nbsp;truckWeight:&nbsp;string;&nbsp;&nbsp;axisNumberTractor:&nbsp;string;&nbsp;&nbsp;euroClass:&nbsp;EuroClass;&nbsp;&nbsp;heightAboveFirstAxle:&nbsp;string;&nbsp;&nbsp;vehicleType:&nbsp;VehicleType;&nbsp;&nbsp;weightPerAxle:&nbsp;string;&nbsp;&nbsp;trailerHeight:&nbsp;string;&nbsp;&nbsp;axisNumberTrailer:&nbsp;string;} enum&nbsp;EuroClass&nbsp;{&nbsp;&nbsp;EURO_I&nbsp;=&nbsp;&#8222;1&#8221;,&nbsp;&nbsp;EURO_II&nbsp;=&nbsp;&#8222;2&#8221;,&nbsp;&nbsp;EURO_III&nbsp;=&nbsp;&#8222;3&#8221;,&nbsp;&nbsp;EURO_IV&nbsp;=&nbsp;&#8222;4&#8221;,&nbsp;&nbsp;EURO_V&nbsp;=&nbsp;&#8222;5&#8221;,&nbsp;&nbsp;EURO_VI&nbsp;=&nbsp;&#8222;6&#8221;,&nbsp;&nbsp;EURO_EEV&nbsp;=&nbsp;&#8222;7&#8221;,&nbsp;&nbsp;Electric_Vehicles&nbsp;=&nbsp;&#8222;8&#8221;} enum&nbsp;VehicleType&nbsp;{&nbsp;&nbsp;truckTractor&nbsp;=&nbsp;&#8222;truckTractor&#8221;,&nbsp;&nbsp;tandem&nbsp;=&nbsp;&#8222;tandem&#8221;,&nbsp;&nbsp;solo&nbsp;=&nbsp;&#8222;solo&#8221;,&nbsp;&nbsp;bus&nbsp;=&nbsp;&#8222;bus&#8221; &nbsp;&nbsp;car =&nbsp;&#8222;car&#8221;} ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.hogs.live\/en\/wyznaczanie-trasy-2\/\" title=\"read more...\">Read more<\/a><\/p>","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/wiki.hogs.live\/en\/wp-json\/wp\/v2\/pages\/81"}],"collection":[{"href":"https:\/\/wiki.hogs.live\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wiki.hogs.live\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.hogs.live\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.hogs.live\/en\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":29,"href":"https:\/\/wiki.hogs.live\/en\/wp-json\/wp\/v2\/pages\/81\/revisions"}],"predecessor-version":[{"id":183,"href":"https:\/\/wiki.hogs.live\/en\/wp-json\/wp\/v2\/pages\/81\/revisions\/183"}],"wp:attachment":[{"href":"https:\/\/wiki.hogs.live\/en\/wp-json\/wp\/v2\/media?parent=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}