Hello,
I've been trying to create a way to return the slope of a line by using the elevation values obtained via the intersection of the start and end vertex of the line with topo contours. Creating separate scripts for attribute fields of the line (i.e., start elv, end elv, length) and then using those values in an equation field worked, but it takes a very long time to process. I thought a viable alternative is to configure a popup with the same scripts condensed into one arcade expression. I tried to configure the pop up with multi line script but it only returns the start vertex elevation value.
Any advice is much appreciated.
The script is below:
//Start vertex (upper elevation) of line used for slope
var paths = Geometry($feature).paths
var line = paths[0][0]
//Selecting the elevation of the contour that is intersected by the start vertex
var x = featuresetbyname($datastore,"Homer_2ft_contour_Lidar_Gen")
for(var f in x){
if(intersects(line,f)){
return f.Contour}
}
//End vertex of line used for slope
Var p = paths[0][1]
//End vertex (lower elevation) of line used for slope
var y = featuresetbyname($datastore,"Homer_2ft_contour_Lidar_Gen")
for(var g in y){
if(intersects(p,g)){
return g.Contour}
}
//Equation to return slope of line
var z = (f-g)/$feature.Shape_Length * 100
return z
Best Regards,
A. Yeaton