Geographical aggregation¶
Capabilities¶
Capability |
Support |
Comment |
---|---|---|
Give a Value geographical information |
See Examples |
|
Display geographical values |
||
Display geographical alarms |
Examples¶
Concept¶
OnSphere gives the possibility to aggregate geographical information with values. Those geographical information have to follow the standard GeoJson RFC 7946.
How it works¶
At startup, the osp-maps plugin will try to aggregate all the geo.maps
files and make them correspond hierarchically to all values beneath it. It means that the geo.maps
file will correspond to all values that are hierarchically at its level and under it.
root
│
└── geo.maps
│
└── folder1
│ └── geo.maps
│ └── value.ospp
│
└── subfolder1
└── value.ospp
As described in the above hierarchy tree schematic, the geo.maps
contained in root will possess the value.ospp
in folder2. The geo.maps
in folder1 will possess the other two values.
If you want to display those values linked to a specific geographical position (stored via the geo.maps
) you will have to add it to a layer. A layer is usually a combination of three files:
layer.maps
layer.ospp
layer.web
Warning
For the moment only same value types data can be requested in the same layer (points and polygons cannot be in the same layer, for example).
Below is an example of a layer.ospp
file. Here we declare that this layer that will be added to the map will represent a LINE (or LineString in pure GeoJson) and that its layerType, used mainly for the styling, is SEVERITY. This will force us to add a list of severityConfigurations which are composed of objects containing information about - in this case - the severity. If the value is linked to a geo.maps
file, it will then be sent to the MapsWidget and displayed inside the map.
You can also add a clusteringType which represents the radius and zoom level when Points will be merged together. The clusteringType only affects Points valueType.
Note
Of course you will have to add a MapsWidget to display wanted information on the front-end. Please refer to maps widget for more information.
{
"name": "Alarme layer",
"description": "",
"content": {
"valueType": "POINTS",
"contentType": "SEVERITY",
"clusteringType": "CLOSE",
"severityConfigurations": [
{
"severity": "root.connexionSite.berneBulle.alarms.highest_severity",
"count": "root.connexionSite.berneBulle.alarms.count",
"dashboard": "root.alarmGenerator"
},
{
"severity": "root.connexionSite.berneSion.alarms.highest_severity",
"count": "root.connexionSite.berneSion.alarms.count",
"dashboard": "root.alarmGenerator"
}
]
}
}
Features¶
Geometries¶
The Maps module is able to let users display GeoJson information on a map. Those geometry are declared inside a geo.maps
file. Once the geometry is declared it will be affected to every values beneath it until another geo.maps
file is found.
Note
Using a tool that generates a valid GeoJson Feature
could be a good idea. For example, using this tool you can search a place and add a point on the map to be able to copy paste it in your configuration. If you don’t use such a tool be careful to have coordinates that follow the standard [longitude
, latitude
, optionally : altitude
].
Here is an example of the geo.maps
:
{
"geoJsonString": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [6.633597, 49.519962, 250]
},
"properties": {
"label": {
"name": "Lausanne",
"text-color": "#ffffff"
}
}
},
"moduleId": "modules.maps.maps-1"
}
Here we can see the geometry defines a Point
. Here is the table of possible types:
Geometry |
Example coordinate types |
Fixed properties |
Description |
---|---|---|---|
|
[ 125.6, 10.1, 123 ] |
A GeoJson Point |
|
|
[ [ 40, 5, 123 ], [ 41, 6, 215 ] ] |
A GeoJson LineString |
|
|
[ [ [ 0 , 0 , 0 ] , [ 3 , 6, 215 ] , [ 6 , 1, 215 ] , [ 0 , 0, 0 ] ] ] |
Polygons with a Single Ring |
The above example shows a GeoJSON Polygon with an exterior ring and no interior rings (or holes).
Note
GeoJSON Polygons with holes are not yet supported.
Fixed properties for Geometries¶
For certain geometries, certain properties are reserved for special use. You can find those specific properties and how to use them in the table below.
Property |
Example |
Geometry |
Type |
Descritption |
---|---|---|---|---|
|
“label”: {“name”: “Lausanne”,”text-color”: “#ffffff”, “text-anchor”: “bottom”} |
|
Object |
Add a label on a point |
Label¶
The property label is an Object. Inside this object the name
property is mandatory but both text-anchor
and text-color
are optional.
The label option lets you configure a name
that will be displayed on the map above or below the point it is linked to with a specific color. text-color
and text-anchor
are optional. The value of text-anchor
is either top
or bottom
. The value of text-color
must be a valid hex color.
The default text-color
is white, and the default text-anchor
is top (you will have a white name above the point).
Display geographical values¶
Concept¶
OnSphere gives the possibility to link values with a geographical data as described above. It is possible to display those values on a Map. This graphic map is configured using the front-end maps widget.
Examples¶
Display geographical alarms¶
Concept¶
Alarms are a very useful way to store data in OnSphere. Geographical data can also be aggregated to values linked to an alarm. Those values are linked to an owner.alarms using ALARM_COUNT
and an owner.alarms using MAX_SEVERITY
(see Alarms).