Layers configuration

TS offers a wide set of layers (→ Working with layers).

The layers are built dynamically from the information stored in the file:

/opt/ptv-optima-vv.n.xxxxptv-optima-as/standalone/configuration/optima/optima-configuration.xml.

A layer is described through a JSON object.

The JSON object is identified by the name of the layer, followed by the string "JSONCONF":

<LayerName>JSONCONF
{
 "property1": "value1",
 "property2": "value2",
 "property3": {"param1": "value1", "param2": "value2",..., "paramK": "valueK"}
...
 "propertyN>: "valueN"
}
</LayerName>
        

The JSON object contains a list of properties, with the corresponding values, that determine the behavior and the structure of the layer.

Some properties can be described by a set of parameters (in the example, property3).

An example of JSON object, related to the Link layer:

<Link>JSONCONF
{
 "geoserverLayer": "link",
 "treeDir": "layerNetwork",
 "filterFunction": "linkFnod",
 "featureStyle": "arrow",
 "popupOptions": { "popupClass": "TS.View.LinkPopup", "useExtJS": true },
 "hasStylesCombo": true,
 "featuresDetailColumns" :["idno", "tail", "head", "name", "leng", "nlan", "capa", "sped"],
}
</Link>
        

Important:  You can add a layer or update the properties of an existing layer by opening the file optima-configuration.xml and adding a JSON object (or modifying an existing one). It is not necessary to stop the system server that hosts the file /optima-configuration.xml.

The set of TS layers, thus the set of JSON objects, is placed in the tag <configuration>/<TrafficSupervisor>/<layers> of the file optima-configuration.xml.

The table lists all the parameters that can be used to build a JSON object representing a layer:

Property

Type

Description

cqlFilterCombos

Object

Contains the description of a combo box with a set of selectable values, specified in the possibleValues array.

You can add N combo-boxes to any layer, therefore you can define N arrays possibleValues that are in logical AND.

The parameters of the property are:

  • name: label of the combo-box displayed on the GUI.
  • description: description displayed as a tooltip upon mouseover on any label.
  • property: the GeoServer layer "column" which is filtered with the current combo.
  • cqlFilterCustomQuery: custom CQL query.

    Important:  The "value" string must start and end with the character "$".

  • possibleValues:

    • a JSON object
    • an array of couples, values and displayValue

(→ Known limitations)

defaultStyleName

String

Contains the name of the default style used to render the layer.

The style must be a valid GeoServer style contained in a specific list.

For example:

"defaultStyleName": "ts3_pointGraph_2"

detailsDisplay

Object

Contains an array of labels to identify a subset of the featuresDetailColumns set.

The property is used to disambiguate elements contained in the pop-up Choose feature.

In the Choose feature pop-up, you see two elements with unfriendly technical names.

The information shown are associated to the JSON for TMC Locations layer, where the property is not set:

<tmcLocations>JSONCONF
{
....                   
    "customLayerClass": "TS.Layers.Specialized.TMCLocations",
    "geoserverLayer": "ploc",
    "featuresDetailColumns" :["idno", "name", "type", "prev", "succ", "road", "rnam"]
....								
}
</tmcLocations>

                        

In the next example, the layer Nodes contains the property detailsDisplay associated to an array of two elements, ["idno", "mnod"].

<Nodes>JSONCONF
{
....								
    "geoserverLayer": "node",
    "customLayerClass": "TS.Layers.Specialized.Nodes",
    "featuresDetailColumns" :["idno", "mnod", "snod"],
    "defaultStyleName": "ts3_pointGraph",
    "systemInfo": true,
    "detailsDisplay": ["idno", "mnod"]
....								
}
</Nodes>

                        

In the Choose feature pop-up, you see three nodes identified by their identifier number (idno).

Information on main nodes is absent (mnod=null) for all nodes.

In the next example, the layer Link contains the property detailsDisplay associated to an array of two elements, ["idno", "name"].

<Link>JSONCONF
{
....								
    "geoserverLayer": "link",
    "treeDir": "layerNetwork",
    "filterFunction": "linkFnod",
    "featureStyle": "arrow",
    "popupOptions": { "popupClass": "TS.View.LinkPopup", "useExtJS": true },
    "hasStylesCombo": true,
    "featuresDetailColumns" :["idno", "tail", "head", "name", "hier", "leng", "nlan", "sped", "capa", "ocap", "gren", "cycl", "jden", "jwav"],
    "defaultStyleName": "ts3_link_no_conn",
    "systemInfo": true,
    "detailsDisplay": ["idno", "name"]
....								
}
</Link>

                        

In the Choose feature pop-up, you see one link identified by its identifier number (idno) and name.

The string is composed of:

"idno"+" "+"name"

The policy associated to detailsDisplay is:

  1. If the property is not set, the text shown is the unfriendly technical identifier associated to the feature.
  2. If the property is set but the value is misspelled, the text is shown as step 1.
  3. If the property is set but not all the values are correct, only the correct ones are used, and composed as:

    "value1"+" "+"value2"+" "...+"valueN"

featureDetailsColumns

String

Contains an array of strings related to the columns displayed in the feature pop-up associated to the layer.

For example:

"featuresDetailColumns" :["idno", "head", "name", "sped"]

The strings used to populate the array are stored in GeoServer (→ OptimaWSI administration dashboard).

featureStyle

String

Contains a string identifier to draw a specific object:

  • arrow = draws an arrow for a line-based layer.

filterFunction

String

When you click on the map, different features can be returned.

These different features are related to the "density of information" of the area where you click.

The density of information varies according to several factors, for example:

  • The zoom level.
  • The set of active layers.

The available values are:

  • all: no filters, all features are returned.

  • first: returns the first feature of the array.
  • linkFnod: returns the closest feature that matches the direction of travel with respect to the clicked point.
  • closest: returns the closest feature to the clicked point.

geoserverLayer

String

Contains the name of the GeoServer layer.

layerStyleTitleField

String

Contains a Geoserver style property (for example,"Abstract") used for rendering the style selection information.

The style property "Abstract", if used within the configuration of a layer, overrides the value "Title" set for layerStyleTitleField here → layersStyleTitleField.

Example:

<Link>JSONCONF
{
....								
    "geoserverLayer": "link",
    "treeDir": "layerNetwork",
    "filterFunction": "linkFnod",
    "featureStyle": "arrow",
    "popupOptions": { "popupClass": "TS.View.LinkPopup", "useExtJS": true },
    "hasStylesCombo": true,
    "featuresDetailColumns" :["idno", "tail", "head", "name", "hier", "leng", "nlan", "sped", "capa", "ocap", "gren", "cycl", "jden", "jwav"],
    "defaultStyleName": "ts3_link_no_conn",
    "systemInfo": true,
    "detailsDisplay": ["idno", "name"]
    "layerStyleTitleField": "Abstract"							
....								
}
</Link>                       

In the table you can see the mapping between "Title" and "Abstract":

Geoserver layer technical name

Title

Abstract

Node

Default

Simulation network nodes

link

Hierarchical (with connectors)

Links are filtered per road hierarchy, based on zoom level

Connectors are displayed dashed red.

All links (no connectors)

All links are displayed. Connectors are not displayed.

All links (with connectors)

All links are displayed. Connectors are displayed dashed red.

 

Hierarchical (no connectors)

Links are filtered per road hierarchy, based on zoom level.

Connectors are not displayed.

ctrl_group_wms

Default

Coordination groups

controller_wms

Default

Controllers

strt

Default

Street network

centroids

Default

Zone centroids

trafficstate_rltm

Speed reduction (severe)

The color represents the error between the measured value and the one previously forecast.

Speed reduction (mild)

The color represents the ratio between current measured speed and the street free-flow speed (more severe thresholds).

ploc

Default

TMC nodes

count_locations

Status

The color represents the count location status.

Reliability

The color represents the count location reliability.

path_resu

Default

Road corridors

rlin_tre_rltm_shap_v

Traffic state (flow)

The color represents the ratio between exit flow and the link exit capacity.

The width is proportional to the flow on the link.

Traffic state (hierarchy)

The color represents the ratio between estimated speed and the link freeflow speed.

The width is proportional to the link hierarchy.

Flow capacity (flow)

The color represents the ratio between exit flow and the link exit capacity.

The width is proportional to the flow on the link.

scenario_results

Traffic state (flow)

The color represents the ratio between estimated speed and the link free-flow speed.

The width is proportional to the flow on the link.

Traffic state (hierarchy)

The color represents the ratio between exit flow and the link exit capacity.

The width is proportional to the flow on the link.

Flow/capacity (flow)

The color represents the ratio between exit flow and the link exit capacity.

The width is proportional to the flow on the link.

tsta_rltm_v

 

Speed reduction (mild)

The color represents the ratio between the current harmonized speed and the street free-flow speed (mild thresholds).

Speed reduction (severe)

The color represents the ratio between the current harmonized speed and the street free-flow speed (more severe thresholds).

put_lines

Default

Public transport lines

put_vehicles

Default

Public transport vehicles

put_stops

Default

Public transport stops

vms_v

Default

Variable message signs

kpi_instances

Default

KPI shapes

events

Default

Road events

kpimodel_base_results

Default

The color represents the error between the measured value and the one previously forecast.

kpimodel_measured_results

Default

The color represents the error between the measured value and the one previously forecast.

sf_statistical_forecast_with_interval_shap_v

 

Speed reduction (mild)

The color represents the ratio between forecast speed and street free-flow speed (mild thresholds).

Speed reduction (severe)

The color represents the ratio between forecast speed and the street free-flow speed (more severe thresholds).

sf_geh_view

Default

The color represents the error between the measured value and the one previously forecast.

 

pollingInterval

Integer

Contains the refresh time period, in seconds. Any number > 0.

popupOptions

Object

Contains a JSON hash describing the pop-up features details, according to the parameters:

  • popupClass = String that contains the name of a JS class used to build the pop-up.

selectionFilterFunction

String

Currently manages only one value, comboFilter.

selectionFilterOptions

Object

Contains a configuration hash of selectionFilterFunction.

BoschAQSensors

Object

Contains a JSON object where you can mainly configure:

  • The list of pollutants monitored by the sensors.

  • For each pollutant, we can set an object specifying:

    • n+1 colors to be used for such thresholds.

    • the list of n thresholds values (T1<T2 ... < T(n-1)<Tn)

Example: 

"POLLUTANT_NAME": {
   "colors": ["#17C117", "#EDE324", "#DB0303", "#3a0f66"],
   "values": [250, 400, 750]
 }

In the common case (2 thresholds and 3 colors), according with the llevel L of pollutant registered by the sensor, TS shows an icon of a varying color:

  • If L<T1, a green icon (LOW level)

  • If T1≤L<T2, a yellow icon (MEDIUM level)

  • If L≥T2, a red icon (HIGH level)

This concept is generalized if n thresholds and n+1 colors are specified:

  • if L< T1, color 1 is used for the icon (Lowest level)

  • if T1<= L< T2, color 2 is used for the icon

  • if T(n-1)<=L< Tn, color n is used for the icon

  • if L>=Tn, color n+1 is used for the icon (Highest level)

Example:

<BoschAQSensors>JSONCONF
{
        "geoserverLayer": "bosch_sensors",
        "featuresDetailColumns" :["idno"],
		"wfsGridColumns": ["idno"],
        "defaultStyleName": "ts3_bosch",
        "dataMocked": false,
        "pollingInterval": 60,
        "thresholdsCustomStyle": {
		"CO_3_CORR": {
		  "colors": ["#17C117", "#EDE324", "#DB0303", "#3a0f66"], 
		  "values": [250, 400, 750] 
	    },												
		"ESP_0_RH_AVG": {
		  "colors": ["#17C117", "#EDE324", "#DB0303"], 
		  "values": [60, 70] 
   	    },						
		"ESP_0_TEMP_AVG": [2, 5],
		"ES_0_PRESS": [950, 1050],
		"NO2_1_CORR": [30, 50],
		"O3_0_CORR": [20, 40],
		"PS_0_PM2P5_CORR": [30, 60],
		"PS_0_PM10_CORR": [20, 30],
		"SO2_2_CORR": [2, 4]
    },
	"apiAuthorization": {
	    "projectId": "pep1109"
	},
	"systemInfo": true
}
</BoschAQSensors>

In the example, for the pollutant CO_3_CORR we have set:

  • n=3 thresholds values

  • n+1=4 colors

Important:  The colors are expressed according with the common notation (#xxxxxx) of the standard RGB.

For geoserverLayer, featuresDetailColumns, defaultStyleName, and systemInfo,see the associated descriptions provided in this table.

The property dataMocked is used for back-end side debugging and you can ignore it.

The property projectId must be set by the project owner, and is associated to the API connecting the sensors, therefore is specific for a specific project.

In the example, pep1109 is a placeholder.

AirQualityMaps

Object

Contains a JSON object where you can mainly configure:

  • The list of pollutants viewable on the heatmap layer.

    • co (carbon monoxide)

    • no2 (nitrogen dioxide)

    • so2 (sulfur dioxide)

    • o3 (ozone)

    • pm10 (particulate matter 10μm)

    • pm2.5 (particulate matter 2.5μm)

    The value of the pollutant must be specified into the attribute name

  • The threshold value associated to any specific pollutant. This value is a number that may range from 1 to 10.

Every block of configuration is composed by the following properties:

  • channel: a positive number. It is the channel in the geotif file which contains data relative to the specified pollutant.

  • displayValue: a label associated to a specific value which is shown in the TS widget LAYER OPTIONS.

  • thresholds: an array of values expressed in units specified in the unit property.

  • colors: an array of values associated to the thresholds.

  • unit: the unit of measure for the chosen pollutant. It is shown in the layers legend, so it should be user-legible.

Any specific threshold is associated to a specific color code.

The heat-map colors are calculated according to these values.

The intensity of the color on the map is set according to the concentration of the pollutant.

Important:  The colors are expressed according to the common notation (#xxxxxx) of the RGB standard.

When you install Optima, is available a default configuration ready to use, based on nine pollutants.

<AirQualityMaps>JSONCONF
    {
        "layerName": "airqualitymaps",
        "geoserverLayer": "airqualitymaps",
        "treeDir": "layerNetwork",
        "featuresDetailColumns": [
            "idno"
        ],
        "pollutants": [
            {
                "channel": "1",
                "displayValue": "Carbon monoxide",
                "thresholds": [
                    50,
                    100,
                    130,
                    200,
                    500,
                    2200
                ],
                "colors": [
                    "#00ffff",
                    "#66cdaa",
                    "#efe643",
                    "#ea5254",
                    "#951635",
                    "#7d2281"
                ],
                "unit": "µg/m³"
            },
            {
                "channel": "2",
                "displayValue": "Nitrogen dioxide",
                "thresholds": [
                    40,
                    90,
                    120,
                    230,
                    340,
                    1000
                ],
                "colors": [
                    "#00ffff",
                    "#66cdaa",
                    "#efe643",
                    "#ea5254",
                    "#951635",
                    "#7d2281"
                ],
                "unit": "µg/m³"
            },
            {
                "channel": "3",
                "displayValue": "Ozone",
                "thresholds": [
                    50,
                    100,
                    130,
                    240,
                    380,
                    800
                ],
                "colors": [
                    "#00ffff",
                    "#66cdaa",
                    "#efe643",
                    "#ea5254",
                    "#951635",
                    "#7d2281"
                ],
                "unit": "µg/m³"
            },
            {
                "channel": "4",
                "displayValue": "Particulate matter 2.5",
                "thresholds": [
                    10,
                    20,
                    25,
                    50,
                    75,
                    800
                ],
                "colors": [
                    "#00ffff",
                    "#66cdaa",
                    "#efe643",
                    "#ea5254",
                    "#951635",
                    "#7d2281"
                ],
                "unit": "µg/m³"
            },
            {
                "channel": "5",
                "displayValue": "Particulate matter 10",
                "thresholds": [
                    20,
                    40,
                    50,
                    100,
                    150,
                    1200
                ],
                "colors": [
                    "#00ffff",
                    "#66cdaa",
                    "#efe643",
                    "#ea5254",
                    "#951635",
                    "#7d2281"
                ],
                "unit": "µg/m³"
            },
            {
                "channel": "6",
                "displayValue": "Sulfur dioxide",
                "thresholds": [
                    100,
                    200,
                    350,
                    500,
                    750,
                    1250
                ],
                "colors": [
                    "#00ffff",
                    "#66cdaa",
                    "#efe643",
                    "#ea5254",
                    "#951635",
                    "#7d2281"
                ],
                "unit": "µg/m³"
            },
            {
                "channel": "7",
                "displayValue": "Temperature",
                "thresholds": [
                    -30,
                    -20,
                    -10,
                    0,
                    10,
                    20,
                    30,
                    40,
                    50
                ],
                "colors": [
                    "#825EA4",
                    "#3B3B8F",
                    "#3B68B1",
                    "#4DA1C8",
                    "#99CA8B",
                    "#FAEA6B",
                    "#F28B2C",
                    "#DA262C",
                    "#600D33"
                ],
                "unit": "°C"
            },
            {
                "channel": "8",
                "displayValue": "Humidity",
                "thresholds": [
                    0,
                    25,
                    50,
                    75,
                    100
                ],
                "colors": [
                    "#845528",
                    "#E8BB65",
                    "#F5F2B0",
                    "#90CFCF",
                    "#2E6F9E"
                ],
                "unit": "%"
            },
            {
                "channel": "9",
                "displayValue": "Air pressure",
                "thresholds": [
                    970,
                    985,
                    1000,
                    1015,
                    1030,
                    1045
                ],
                "colors": [
                    "#2A398A",
                    "#2C5B98",
                    "#4A8FAB",
                    "#FADBC7",
                    "#D75850",
                    "#AA2B32"
                ],
                "unit": "hPa"
            }
        ]
    }
</AirQualityMaps>

You can modify the default values as you prefer, as shown in the example where are specified only two channels..

Example:

<AirQualityMaps>JSONCONF{
    "layerName": "airqualitymaps",
    "geoserverLayer": "airqualitymaps",
    "treeDir": "layerNetwork",
    "featuresDetailColumns": [
        "idno"
    ],
    "pollutants": [
        {
            "channel": "1",
            "displayValue": "Carbon Monoxide",
            "thresholds": [
                24,
                300,
                500,
                1000
            ],
            "colors": [
                "#51ed7a",
                "#f0e748",
                "#f0af48",
                "#f04848"
            ],
            "unit": "µg/m³"
        },
        {
            "channel": "2",
            "displayValue": "Nitrogen dioxide",
            "thresholds": [
                100,
                200,
                300
            ],
            "colors": [
                "#9EE493",
                "#BCEDF6",
                "#422040"
            ],
            "unit": "µg/m³"
        }
    ]
}
</AirQualityMaps>

systemInfo

Boolean

This parameter determines if the layer information is shown in the TS widget SYSTEM INFO.

  • true: the layer information is shown in the SYSTEM INFO as a pair

    Layer name - Number of elements in the layer

    The name of the layer is shown accordingly with the language set.

  • false: otherwise

Example:

See also → Control Room Dashboard > System Info Widgets.

viewParamCombos

Object

Contains the description of a combo box with a set of selectable values, specified in the possibleValues array.

You can add N combo-boxes to any layer, hence you can define N arrays possibleValues that are in logic AND.

This property allows you to pass a specific parameter to an SQL query.

To use this property you must:

  • Configure an SQL view from GeoServer.
  • Add an SQL statement, for example:

    select * from strt where name like '%name%'.

The parameters of the property are:

  • name: label of the combo-box displayed on the GUI.
  • description: description displayed as a tooltip on mouseover on any label.
  • property: the SQL view parameter to be specified in the format '%parameter%'.
  • possibleValues: an array of couples, values and displayValue:
  • values specifies the value used in the current SQL statement
  • displayValue specifies the value to be displayed in the combo-box

For example:

<MyStreetLayer>JSONCONF
{
....
    "viewParamCombos": [{
        "isViewParam": true,
        "name": "Street Name",
        "description": "Parameter to display...",
        "property": "name",
        "possibleValues": [{ "value": "%", "displayValue": "All" }, { "value":   },   ],
        "defaultValue": "%",
        }],
....
}
</MyStreetLayer>

(→ Known limitations)

webSocketTopicName

String

Contains the identifier of the web socket associated to the layer.

The identifier must match with jms-topic name present in:

/opt/ptv-optima-vv.n.xxxxptv-optima-as/standalone/configuration/standalone.xml.

The web socket manages the queue of updates of the data layer.

For example:

"webSocketTopicName": "optima_kpi"

wfsGridColumns

Object

Contains an array of labels to identify the columns displayed in the List layer name pop-up window (see → Showing a selected item).

For example:

<LayerName>JSONCONF
{
....
    "wfsGridColumns": ["ColumnName1", "ColumnName2", "ColumnName3", ..., "ColumnNameN"]
....
}
</LayerName>

The set of labels involved are associated to a set of columns determined by:

  • A direct match with a set of the DB's tables columns.
  • A specific query.

For example:

<Parkings>JSONCONF
{
....
    "wfsGridColumns": ["ID", "NAME", "STATUS", "TOTAL", "FREE PLACES"]
....
}
</Parkings>

Important:  You can define a layer also by using only a subset of the parameters in the table.

cvcvxcvxvx

 

Topics in this section