Could an Arcade function be added that would explode geometries into separate lines for each segment?
That would be helpful when doing complex analysis on polyline segments.
@JohannesLindner @Thanks, what I meant was: explode a given polyline part into multiple 2-vertex segments (split at each vertex).
Split Line At Vertices (Data Management)—ArcGIS Pro | Documentation
but then you would be getting into Arcade having different license levels
I don't know... Seems like a quite narrow use case to make a function for. Plus, you can easily do it yourself:
function explode_polyline(geo) {
var segments = []
for(var p in geo.paths) {
for(var q = 1; q < Count(geo.paths[p]); q++) {
var point0 = paths[p][q-1]
var point1 = paths[p][q]
Push(segments, Polyline({"paths": [[point0, point1]], "spatialReference": geo.spatialReference}))
}
}
return segments
}
Console(explode_polyline(Geometry($feature)))
As noted, each segment can be obtained by looping through the vertices of the geometry.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.