Combo Overlay tutorial: Difference between revisions

From Tygron Preview Support Wiki
Jump to navigation Jump to search
Line 103: Line 103:


Recalculate, and the results will again cover the entire [[3D visualization]].
Recalculate, and the results will again cover the entire [[3D visualization]].
Add another [[Combo Overlay]].
{{editor location|Overlays|dropdown=Custom|3=Combo}}
As input A, set the first [[Combo Overlay]].
For the formula, ensure that it reads as follows:
{{code|IF(GT(A, 55), A, NO_DATA)}}
Recalculate, and see the results.


===Notes===
===Notes===
* The editor interface will generally present the first 3 inputs (A, B, and C) of the [[Combo Overlay]]. However, a total of 10 inputs can be added and used, by switching to the "inputs" tab.
* The editor interface will generally present the first 3 inputs (A, B, and C) of the [[Combo Overlay]]. However, a total of 10 inputs can be added and used, by switching to the "inputs" tab.
* It is possible to link multiple [[Combo Overlay]]s together by setting one as input for another. This way, intermediate results can be computed and presented, but also more complex calculations can be created and/or split up into managable sub-calculations.
* It is possible to link multiple [[Combo Overlay]]s together by setting one as input for another. This way, intermediate results can be computed and presented, but also more complex calculations can be created and/or split up into managable sub-calculations.

Revision as of 12:49, 23 May 2023

Prerequisites

The following prerequisites should be met before starting this tutorial:

  • This tutorial relies on base knowledge about the editor interface and the creation of Overlays. If you have not yet followed the tutorials related to those subjects please do so first.
  • This tutorial can be followed with any project of any arbitrary location, preferably with both roads and traintracks. 

Preparations

Take the following steps as preparation for following this tutorial:

  • Start your project. This can be a pre-existing project, or a newly created project.

Introduction to the Combo Overlay

The Combo Overlay is a Grid Overlay which allows for the creation of custom spatial calculation models. It is comparable to raster calculators which can be found in other GIS packages such as QGIs. The principle on which it operates is that for each grid cell, other Grid Overlays may provide values, and the combo Overlay uniformly applies a (simple or complex) formula to compute a new resulting value for that grid cell, and does so for all grid cells.

Creating a simple masking calculation

To get started with a Combo Overlay, it is basically always neccesary to have some other Grid Overlay in the same Project to run a calculation on.

Add a Traffic Noise Overlay.

Editor → Current Situation (Ribbon tab) → Overlays (Ribbon bar) → Environmental (Dropdown) → Traffic Noise

This Traffic Noise Overlay will serve as the primary input to work with. It computes results based on built-in formulas for noise from traffic. Although it's possible to tweak the inputs and the legend of the resulting Overlay, the principles of the calculation and the results thereof are immutable.

Add a Combo Overlay.

Editor → Current Situation (Ribbon tab) → Overlays (Ribbon bar) → Custom (Dropdown) → Combo

The Combo Overlay will, by itself, not show any significantly relevant results. This is because no inputs have yet been set, nor has a relevant formula been entered.

The Combo Overlay accepts a set of inputs, which are Grid Overlays.

Set Grid Overlay A to the added Traffic Noise Overlay.

Next, set the formula to:

A

Then, click on ""Update now" to recalculate the Overlays.

The result is that for each Grid Cell, the value of the input Overlay A, which is set to the Traffic Noise Overlay, is used directly as the result.

Notice that the legend of the Traffic Noise Overlay is directly applied as well. this is because the legend of the first input is automatically read out by the Combo Overlay as the default legend for the Combo Overlay itself.

Just like with the Traffic Noise Overlay itself, it is possible to click on any location in the 3d visualization and see the exact value calculated there.

Using the combo Overlay, it is possible to manupulate those calculated values. One often used principle is to "mask" data, which basically means to explicitly obscure or let through some values.

Modify the formula of the combo Overlay, so that it reads as follows:

IF(GT(A, 55), A, NO_DATA)

The formula now contains two logical operations, as well as a NO_DATA constant. The formula can be read as follows:

If ( IF ) it is true that A is greater than 55 ( GT ), in that case we use the value A. Otherwise, we return the value of NO_DATA, which is a constant meaning no value exists at that point.

Click on "Update now" to recalculate the Overlays.

The results of the Combo Overlay have now changed. Only in the places where the Traffic Noise Overlay computed a noise level of more than 55 decibels have results now been retained. In all other locations, the results have been discarded.

Rasterizing and combining data

Combo Overlays are, in and of themselves, effective tools for manipulating data. However, their effectiveness only goes as far as the input which can be provided to them. Therefor, it is also important to know how to turn other data in the Tygron Platform into Grid Overlays as well.

To try this out, information about train tracks will be added to the Combo Overlay, or more specifically information about the proximity of train tracks.

Train tracks have a number of trains running on them. This can be visualized using an Average Overlay.

Add an Average Overlay.

Editor → Current Situation (Ribbon tab) → Overlays (Ribbon bar) → Distance (Left panel) → Avg & Interpolation

Set the "Input" to "Attribute: Specific Layer", and the layer to "BUILDINGS". This will ensure the Average Overlay is specifically geared towards consululting data from Buildings.

Next, set the "Attribute" to "NUM_TRAINS". This is the Attribute signifying the number of trains which travel across any given Building, such as train tracks.

The "Cell averaging distance", which is set to 100m by default, can be left as-is.

Finally, click on "Update now" to have the Average Overlay recalculate.

The result will be an Overlay which highlights train tracks, with a radius of 100m. Or in terms more practical for this setup: for any given grid cell, the Average Overlay indicates whether a train track is within 100m.

Any cell with a value of 0 only has cells in a 100m radius with 0's. If any cell within that radius would feature a train track, the computed (average) value would be slightly more than 0. This value in and of itself is not significant or useful, but can serve as a filter to know which cells are "near a train track".

Now, switch back to the Combo Overlay by selecting it in the left panel.

Add a second input for the calculation. For Grid Overlay B, select the added Average Overlay.

Modify the formula of the combo Overlay, so that it reads as follows:

IF(GT(A, 55), ADD(A, IF(GT(B, 0), 5, 0)), NO_DATA)

Instead of simply resuling in the value of A, instead the calculation will result in the combined values of A and either 5 or 0, depending on whether B has a value greater than 0. Since B will have a value slightly more than 0 when near a train track, this formula will now add an additional 5dB to the total result when near a train track.

Click on "Update now" to recalculate the Overlays.

The results are now subtly different, in that for all locations within 100m of the train tracks the noise level is computed as 5dB louder than otherwise.

Improving formulas and the importance of order of operations

There is now also a subtle error in this formula. The noise is only increased when the traffic noise in-and-of itself was already at a level of 55 dB. If that level was not reached before taking into consideration the train's noise, the results are already discarded. It would make more sense to first add the train's noise assumption to the calculated noise levels, and then test whether it exceeds some threshold.

To facilitate this, first the total noise will be calculated using a single Combo Overlay. Then, a second Combo Overlay will test whether the noise level should be reported or not.

Modify the Combo Overlays formula to read as follows:

ADD(A, IF(GT(B, 0), 5, 0))

The masking clause has been removed, leaving only the traffic noise and conditional addition of the noise from the trains.

Recalculate, and the results will again cover the entire 3D visualization.

Add another Combo Overlay.

Editor → Current Situation (Ribbon tab) → Overlays (Ribbon bar) → Custom (Dropdown) → Combo

As input A, set the first Combo Overlay.

For the formula, ensure that it reads as follows:

IF(GT(A, 55), A, NO_DATA)

Recalculate, and see the results.

Notes

  • The editor interface will generally present the first 3 inputs (A, B, and C) of the Combo Overlay. However, a total of 10 inputs can be added and used, by switching to the "inputs" tab.
  • It is possible to link multiple Combo Overlays together by setting one as input for another. This way, intermediate results can be computed and presented, but also more complex calculations can be created and/or split up into managable sub-calculations.