I have two layers: 1-Parcels, 2-Soils. I am trying to create an Arcade expression that would return the percentage of soil types within the selected property. I have been successful to some degree, but it appears that the percentages return are not clearing. The expression is below. I have published a web map application which uses the expression for purpose of illustration. Any suggestion, advice, or idea is most appreciated. - James Armstrong
Soils Calculator
---------------------------------------------------------------------------------------------------------------------------------------------
var gensoils = FeatureSetById($datastore, /* GeneralSoils */ "1")
var soils_int = Intersects($feature, gensoils)
var numsoil = Count(soils_int)
var sum_area = SUM(soils_int, 'Acreage')
var results = 'There are '+ numsoil +' type(s) of General Soils.'+TextFormatting.NewLine
for (var s in soils_int){
var soilarea = s.Acreage
var percent = (s.Acreage / sum_area)
var soilname = s.SOIL_NAME2
var soilpercent = Round(percent,2 ) * 100 +'%'
results += TextFormatting.NewLine + soilname + '---- ' + soilpercent
}
return results