Receive email notifications by changing your settings.
Click on your picture in the top right corner, go to Preferences and select your notification preferences.

Custom combination overlay for flood risk

edited February 2023 in General

Dear community,

I'm trying to make a custom combination overlay between two layers from the Rainfall overlay: Surface Max Speed (V) and Surface Max Value (D). I have used these output overlays before in a project to create a risk map based on the flood severity levels from Smith, Davey & Cox (2014) [1]. In ArcGIS I'm able to make this overlay in the Raster Calculator with the following SQL:

Con(("V"*"D" <=0.3) & ("D" < 0.3) & ("V" < 2.0), 1,

Con(("V"*"D" <=0.6) & ("D" < 0.5) & ("V" < 2.0), 2,

Con(("V"*"D" <=0.6) & ("D" < 1.2) & ("V" < 2.0), 3,

Con(("V"*"D" <=1.0) & ("D" < 2.0) & ("V" < 2.0), 4,

Con(("V"*"D" <=4.0) & ("D" < 4.0) & ("V" < 4.0), 5,6)))))

In Tygron I should be able to do this as well in a custom combination overlay, but I'm not that experienced yet with TQL and keep getting invalid arguments. Could someone have a look at what might be going wrong?:

IF(LTE(MULT(A,B),0.3) AND (LT(B,0.3)) AND (LT(A,2.0)),1,

IF(LTE(MULT(A,B),0.6) AND (LT(B,0.5)) AND (LT(A,2.0)),2,

IF(LTE(MULT(A,B),0.6) AND (LT(B,1.2)) AND (LT(A,2.0)),3,

IF(LTE(MULT(A,B),1.0) AND (LT(B,2.0)) AND (LT(A,2.0)),4,

IF(LTE(MULT(A,B),4.0) AND (LT(B,4.0)) AND (LT(A,4.0)),5,6)))))

(where A = Surface Max Speed , and B = Surface Max Value)

[1] Smith, G. P., Davey, E. K., and Cox, R. J. (2014). Flood Hazard Water Research Laboratory Technical Report 2014/07. Prepared by the Water Research Laboratory. April 2014. Accessed on 23/02/2023 via https://knowledge.aidr.org.au/media/2334/wrl-flood-hazard-techinical-report-september-2014.pdf

Comments

  • Hi there!

    As a quick remark to steer away from confusing terminology: The Combo Overlay itself does not use TQL. The Combo Overlay uses a collection of mathematical and logical functions to perform a computation. More information about those functions can be found here: https://previewsupport.tygron.com/wiki/Combo_Overlay


    In the Combo Overlay, all functions take on the following format:

    function(parameter,parameter,parameter,...)

    At a glance, the "AND" sections of your formulas are the most obvious requiring a change. Rather than using "A AND B", write it as "AND(A,B)".


    This means that the following formula fragment:

    IF(LTE(MULT(A,B),0.3) AND (LT(B,0.3)) AND (LT(A,2.0)),1, the-rest)

    Should be rewritten as follows:

    IF( AND( LTE(MULT(A,B),0.3) , LT(B,0.3) , LT(A,2.0) ),1, the-rest)

    (spaces added for an attempt at legibility)


    Can you try this and see whether this works for you?

    Regards!

    Sprawling spreadsheets so intricate Alexander the Great cuts them in half.

  • Hi Rudolf,

    Thank you very much! Yes, it now works and looks as follows:

    IF(AND(LTE(MUL(A, B), 0.3), LT(B, 0.3), LT(A, 2.0)), 1, 

    IF(AND(LTE(MUL(A, B), 0.6), LT(B, 0.5), LT(A, 2.0)), 2, 

    IF(AND(LTE(MUL(A, B), 0.6), LT(B, 1.2), LT(A, 2.0)), 3,

    IF(AND(LTE(MUL(A, B), 1.0), LT(B, 2.0), LT(A, 2.0)), 4, 

    IF(AND(LTE(MUL(A, B), 4.0), LT(B, 4.0), LT(A, 4.0)), 5, 6)))))

Sign In or Register to comment.