for loop for PointCollection

671
2
05-23-2020 05:04 PM
Erick_CamiloMorris_Duarte
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]);
}

0 Kudos
2 Replies
JoeHershman
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

Thanks,
-Joe
0 Kudos
dotMorten_esri
Esri Notable 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.