Getting detailed information about truck restrictions

This forum deals with any kind of web based client technology, whether it is the well known java script based Ajax servlet or the upcoming approaches such as Leaflet, OpenLayers and so on.

Getting detailed information about truck restrictions

Postby kgrudzinski » Fri Jun 03, 2016 1:25 pm

Hello,

When Truck Attributes layer is displayed on Ajax Maps, it shows generic icons for truck restrictions, same for each type of restriction (e.g. two different weight limits will be displayed with same icon). Is it possible to get and display detailed information, for each restriction? (e.g. that one weight limit is 2tons and second 7 tons)

Regards,

K.
Last edited by kgrudzinski on Tue Jun 07, 2016 12:56 pm, edited 1 time in total.
kgrudzinski
 
Posts: 12
Joined: Fri Feb 19, 2016 10:56 am

Re: Getting detailed information about trcuk restrictions

Postby Bernd Welter » Fri Jun 03, 2016 4:11 pm

Hello Krzysztof,

are you using this sample from the tutorial ?
(on premise link - please adapt the IP)
http://127.0.0.1:50010/ajaxmaps/tutoria ... e%20Layers

2016-06-03 18_08_39-Ajax Maps Tutorial.png
FeatureLayer based example of truck attributes.
TThe tooltip demonstrates the access to the segment properties.


Best regards Bernd

html code
<html>
<head>
<!--[if IE]><script type="text/javascript" src="webcomponent/script/excanvas.js"></script><![endif]-->
<script type="text/javascript" src="webcomponent/script/qooxdoo/script/qx-transport.js"></script>
<script type="text/javascript" src=".qxrpc"></script>
<script type="text/javascript" src="webcomponent/script/map.js"></script>

<script type="text/javascript">
function init() {
var container =
document.getElementById("mapContainer");
var map =
new com.ptvag.webcomponent.map.Map(container);
window.onresize = function() {
map.updateSize();
};
map.setCenter({x:4303250, y:5486500});
map.setZoom(8);

var manager = map.getServerDrawnObjectManager();
manager.addPOICategory("featurelayer", "PTV_TruckAttributes");
manager.setReferenceTime("2014-11-05T16:30:00+01:00");

// example for reacting when new data is available
manager.addEventListener("staticPOIsAvailable", function(evt) {
var pois = evt.getData();
if (pois.length > 0) {
alert("First incident data: " +
qxp.io.Json.stringify(pois[0]));
}
});
}

qxp.dev.log.Logger.ROOT_LOGGER.setMinLevel(qxp.dev.log.Logger.LEVEL_INFO);
qxp.dev.log.Logger.getClassLogger(qxp.core.Init).setMinLevel(qxp.dev.log.Logger.LEVEL_ERROR);
</script>
</head>

<body onload="init()">
<div id="mapContainer"
style="width:100%;height:100%">
</div>
</body>
</html>
Bernd Welter
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1640
Joined: Mon Apr 14, 2014 10:28 am

Re: Getting detailed information about truck restrictions

Postby kgrudzinski » Tue Jun 07, 2016 1:29 pm

After some investigation, I found out that the lack of tooltips was caused by error in my onMouseMove event handler for vector layer. The handler did not have a return statement. After adding return false (true also works), tooltips appeared on the map.

I do have some additional questions:
1. Where can I find information about meaning of data returned in poi description? Some of it is obvious like maxHeight and maxWeight, but there are parameters like driverType=0 or freeForDelivery=1, which meaning is unclear to me.

2. Is there a way to get description (or message part of description) in different language than english for Traffic Incidents pois?
kgrudzinski
 
Posts: 12
Joined: Fri Feb 19, 2016 10:56 am

Re: Getting detailed information about truck restrictions

Postby Bernd Welter » Wed Jun 08, 2016 8:00 am

Hello Krzsyztof,

here is some info about the questions you asked:

Where can I find information about meaning of data returned in poi description? Some of it is obvious like maxHeight and maxWeight, but there are parameters like driverType=0 or freeForDelivery=1, which meaning is unclear to me.


Here you can take a look at the Unified Profile Mechanism:
http://xserver.ptvgroup.com/fileadmin/f ... =driveType
Is there a way to get description (or message part of description) in different language than english for Traffic Incidents pois?

A quick search for driveType in the documentation will lead you to the property and the meaning of the values.

This depends on the mechanism how you consume the traffic data from our services:
  • Via FeatreLayer: use the profile snippet mechanism and add the following node:
    xml code
    <Common language="de" majorVersion="1" minorVersion="0"/>

    (check http://xserver.ptvgroup.com/fileadmin/f ... n_xsd.html#Common%3FTocPath%3DTechnical%2520Concepts%7CAbout%2520Profiles%7CPTV%2520xServerbundle%7CCommon%7C_____0)
  • Via TrafficInfoLoader: the definition of the tooltips is part of the GEODATASOURCE layer which is configured via XML files (in /conf):
    • traffic-geodatasource.xml: defines the connection to the traffic info loader database table (which refers to various C_DESCRIPTION_* columns). One of these columns is assigned to a field called text which is C_DESCRIPTION_DE (default). If you just want to translate the traffic tooltips into EN you have to edit the TEXT value: C_DESCRIPTION_EN will do fine.
    • geodata-ptv-traffic.xml: contains the generic definition of the tooltips in the DESCRIPTION node (feature of the GEODATASOURCE layer). If you want you can combine various columns to one single DESCRIPTION text by applying something like this:
      xml code
      <Description>
      <TextField attributeName="ID" separator="&lt;BR&gt;C_DELAY="/>
      <TextField attributeName="C_DELAY" separator="&lt;BR&gt;C_DESCRIPTION_EN='"/>
      <TextField attributeName="C_DESCRIPTION_EN" separator="&lt;BR&gt;;C_DESCRIPTION_DE='"/>
      </Description>

      Another approach is to use the DESCRIPTION field just for the primary key of a database object and retrieve the required data of the objects in the visual section via SQL on your own.

Best regards
Bernd
Bernd Welter
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1640
Joined: Mon Apr 14, 2014 10:28 am

Re: Getting detailed information about truck restrictions

Postby Bernd Welter » Thu Jun 09, 2016 3:36 pm

just found this:
http://xserver.ptvgroup.com/fileadmin/f ... tables.htm#truck

Is this also helpful?
Bernd Welter
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1640
Joined: Mon Apr 14, 2014 10:28 am


Return to PTV Webclients (Ajax, Leaflet, OpenLayers, WMS, ...) (Admin=LNM)