Select to view content in your preferred language

Calculating Total water Volume in Pipes within a polygon when there is multiple size pipes in Arcade when creating an Attribute rule

349
0
03-03-2023 02:41 PM
GarySpenst
Emerging Contributor

Hello,

I am trying to create an attribute rule that calculates the total volume of the pipe within a polygon. The trouble I am having is that there is multiple sizes of pipes within the polygon. 

So far I tried this expression and the arcade expression is valid, however when I adjust the polygon an error happens due to the attribute rule. 

var WatPipe = Filter(FeaturesetByName($datastore, 'WAT_Pipes', ['*']), "status = 'in service' and Owner='City'")

//calculate radius off of pipesizes that are in millimeters and converted to meters
Var piperadius=['pipesize']/2/1000
var Diameter=Pi*piperadius*piperadius
var relevantpipe=contains($feature,WatPipe)
var volume=diameter*length(relevantpipe)
return sum(volume)

Here is the error I receive

GarySpenst_0-1677883209978.png

Please help me out!

0 Kudos
0 Replies