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.
the language used in the traffic info loader descriptions is configured in a file named “traffic-geodatasource.xml” (left side of the screenshot).
Check the screenshot.
LEFT: configuration of the traffic info loader plugin. It consumes the events incl. the messages and stores the info in the database table
CENTER: the database table (in my system I used MS SQL Server but you can also use other RDBMS)
RIGHT: the geodatasource configuration file which is responsible for the consumption of the geometry (display via xmap) and exception_path (detour via xroute)
The traffic info loader is based on a two step architecture:
The Traffic Info Loader plugin consumes the traffic events and messages via internet and stores them into a database
My screenshot shows the table on the right. The table contains several description columns such as
C_DESCRIPTION_DE which contains the German text message
C_DESCRIPTION_EN which contains the English version
… and so on
The configuration of the Traffic Info Loader is part of the file TrafficInfoLoader.properties
The second component is the reading access of xMap and xRoute which is based on the GEODATASOURCE layer.
A geodatasource layer shows database content (not only traffic messages but also POIs or areas) and determines
the relevant table columns based on a file such as traffic-geodatasource.xml (left side of the screenshot).
The default text message refers to C_DESCRIPTION_DE. If you want to use English just reconfigure line14
to use C_ DESCRIPTION_EN.
One sidenote: if you want to switch between several translations via API this is also possible but requires
several configuration files.
Please be aware that the state-of-the-art approach of Traffic Message consumption is the feature layer PTV_TrafficIncidents (replaces geodatasource) which is updated via the Content Update Service (replaces traffic info loader).
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...
i must say this is not that simple out-of-the-box. It requires a layer-configuration which returns multiple language fields. This is not supported by the default configration of the TrafficInformation layer. However, there's an alternative "map&guide-internet" TrafficInfoLayer that returns the description for multiple languages. Suported are 'DE', 'EN', 'FR', 'NL' and 'IT'. I've added a layer class L.PtvLayer.TrafficInformation.Mgi to the GitHub project:
This supports a 'language' option (see code below). I've updated the sample of the project to display the english description http://ptv-logistics.github.io/Leaflet.PtvLayer/. We'll check if we can add the multi-language support to the default-configuration.
// add traffic information - use the map&guide-internet configuration
var traffic = new L.PtvLayer.TrafficInformation.Mgi(xMapUrl, {
zIndex: 1,
attribution: xMapAttribution,
language: 'EN',
token: token
}).addTo(map);
I just today saw that you had answered... We have implemented the new solution, thanks
The one question that we have no is, is it possible to configure the units for the other languages?
For example in English we get the distances in yards instead of KM which would be a nice addition.
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...
those texts are probably retrieved by the provider and forwarded 1:1, so you might be able to change the language but you still depend on what the provider wrote into the text.
For any businesscase I assume that you want to get the properties of a route in imperial units, such as segment length or route lenght. Afaik those values are metric only.
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...