Arcade function: Convert feature vertices to points

420
3
03-19-2022 09:35 AM
Status: Open
Labels (1)
Bud
by
Notable Contributor

Could Esri consider adding a Arcade function that could convert multipart feature vertices to points?

Tags (1)
3 Comments
jcarlson

Doesn't Centroid do the trick? Maybe combined with MultiPartToSinglePart?

Bud
by

@jcarlson  I updated the idea to clarify what I meant: convert feature vertices to points. Thanks.

JohannesLindner
var geo = Geometry($feature)

var vertices = []
for(var p in geo.rings) {
    for(var q in geo.rings[p]) {
        Push(vertices, geo.rings[p][q])
    }
}

Console(vertices[0].type)
Console(vertices)

 

Point
[{"x":-9812667.6540304,"y":5129910.50665289,"spatialReference":{"wkid":102100}},
{"x":-9812667.66625145,"y":5129910.50667924,"spatialReference":{"wkid":102100}},
// ...
{"x":-9812667.6540304,"y":5129910.50665289,"spatialReference":{"wkid":102100}}]