for loop for PointCollection

96
2
05-23-2020 05:04 PM
Highlighted
New Contributor II

I want to make a point collection from an Xyz file, in order to do that, I need to aggregate the points to the point collection, but it doesn't seem to work.

Esri.ArcGISRuntime.Geometry.PointCollection VMM40Points = new Esri.ArcGISRuntime.Geometry.PointCollection(Spatialreference);

for (int i = 1; i == xyz.Count / 3; i += 3)
{
VMM40Points.Add(xyz[i - 1], xyz, xyz[i + 1]);
}

Reply
0 Kudos
2 Replies
Highlighted
MVP Regular Contributor

So you created an array the goes x,y,z,x,y,z,...  What is the original file look like, this seems an odd way to load the data from the file

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

it doesn't seem to work.

What is it that doesn't seem to work? Are you getting a crash, no points added, invalid results or?

Also if you're creating new geometries, I'd recommend looking at the GeometryBuilders, like PolygonBuilder and PolylineBuilder.