This expression returns the number of sandbags needed to construct a sandbag wall of a given length, height and type.
This example can be used in flood response and control activities to ensure necessary resources are deployed. Calculations are derived from this site.
Copy and paste the expression found in the expression template below to the Arcade editor in ArcGIS Online, the relevant location in ArcGIS Pro, or the relevant location in a custom app.
To configure the script to your layer, edit the first two lines to use the fields representing the desired wall height and type.
var finishedHeight = $feature.FinishedHeight;
var sandbagType = $feature.SandbagType;
This Arcade expression will return the number of sandbags required to construct given the type of sandbag wall.
// Replace with appropriate fields for height
// and type of sandbag wall
var finishedHeight = $feature.FinishedHeight;
var sandbagType = $feature.SandbagType;
function SandbagsNeeded(dikeHeight,wallLength,wallType) {
// sandbag wall types
// single stack = 0
// dike == 1
If(wallType == 0){
return Round((wallLength * dikeHeight * 3),0);
}
else {
// determine number of sandbags per foot of dike wall
var numSandbagsFoot = ((3 * dikeHeight) +
(9 * pow(dikeHeight,2))) / 2;
// calculate number using desired length
return Round(numSandbagsFoot *
wallLength,0);
}
}
// Determine number of sandbags needed based on proposed
// length, desired finished height, and wall type
return SandbagsNeeded(finishedHeight,
Length($feature,"feet"), sandbagType);
See this web map for examples of how to use this expression in ArcGIS Online.