Hey Esri Community!
Hope you're all doing well. I'm working on a project and I'm wondering if any of you know if it's possible to iterate over the vertices of a polyline in Arcade and set the height of each vertex to a specific value, say -0.80?
If you have any tips or resources that could help me out with this, I'd really appreciate it!
Thanks in advance for your help!
Best, Stefan
PS: I know, it would be more convinient to just set the default value of the z-value to the desired height but somehow this is not an option in this project 😉
PPS: This is the code I have come up so far:
if (...)){
var lineGeo = Geometry($feature);
var linePaths = lineGeo.paths;
var newPath = [];
for (var lineSegment in linePaths){
for(var vertex in linePaths[lineSegment]){
var startPoint = linePaths[lineSegment][vertex][0]
var endPoint = linePaths[lineSegment][vertex][1]
var height = -0.80
var newSegment = [startPoint, endPoint, height]
push(newPath, newSegment)
}
}
var newLineGeo = Polyline({
paths: [newPath],
hasZ: true,
spatialReference: lineGeo.spatialReference
});
return newLineGeo
} else {
return Geometry($feature);
}