Help With Iterate Expression (Sum Values)

89
0
10-01-2021 07:04 AM
Labels (3)
Robswann
New Contributor III

Is there any way to sum the values returned from the below expression, I cant figure it out. Thanks in Advance

 

var floodplain = FeatureSetByName($datastore, "RES_FLOOD_HAZARD")

 

// Get FeatureSet of intersecting flood zones

var flood_fs = Intersects($FEATURE, floodplain))

 

// Instantiate output string

var out_str = 'Flood Zone Acreage:'

 

// Iterate over FeatureSet

for(var f in flood_fs){

    // Get intersection, calculate area

    var xs = Intersection(f, $feature)

 

    // Calculate acreage

    var a = Areageodetic(xs,'acres')

 

    // Append to output string

    out_str += `\n${f.fld_zone} | ${a} ac`

}

 

return out_str

0 Kudos
0 Replies