ArcGIS Pro SDK (九)几何 7 多点

Coordinate2D[] coordinate2Ds = new Coordinate2D[] { new Coordinate2D(1, 2), new Coordinate2D(-1, -2) }; SpatialReference sr = SpatialReferences.WGS84; MultipointBuilderEx builder = new MultipointBuilderEx(coordinate2Ds, sr); // builder.PointCount = 2 builder.HasZ = true; // builder.Zs.Count = 2 // builder.Zs[0] = 0 // builder.Zs[1] = 0 builder.HasM = true; // builder.Ms.Count = 2 // builder.Ms[0] = NaN // builder.Ms[1] = NaN builder.HasID = true; // builder.IDs.Count = 2 // builder.IDs[0] = 0 // builder.IDs[1] = 0 // 设置为空 builder.SetEmpty(); // builder.Coords.Count = 0 // builder.Zs.Count = 0 // builder.Ms.Count = 0 // builder.IDs.Count = 0 // 重置坐标 List<Coordinate2D> inCoords = new List<Coordinate2D>() { new Coordinate2D(1, 2), new Coordinate2D(3, 4), new Coordinate2D(5, 6) }; builder.Coordinate2Ds = inCoords; // builder.Coords.Count = 3 // builder.HasZ = true // builder.HasM = true // builder.HasID = true double[] zs = new double[] { 1, 2, 1, 2, 1, 2 }; builder.Zs = zs; // builder.Zs.Count = 6 double[] ms = new double[] { 0, 1 }; builder.Ms = ms; // builder.Ms.Count = 2 // 坐标现在为 (x, y, z, m, id) // (1, 2, 1, 0, 0), (3, 4, 2, 1, 0) (5, 6, 1, NaN, 0) MapPoint mapPoint = builder.GetPoint(2); // mapPoint.HasZ = true // mapPoint.HasM = true // mapPoint.HasID = true // mapPoint.Z = 1 // mapPoint.M = NaN // mapPoint.ID = 0 // 添加一个 M 到列表 builder.Ms.Add(2); // builder.Ms.count = 3 // 坐标现在为 (x, y, z, m, id) // (1, 2, 1, 0, 0), (3, 4, 2, 1, 0) (5, 6, 1, 2, 0) // 现在再次获取第二个点;它现在将有一个 M 值 mapPoint = builder.GetPoint(2); // mapPoint.M = 2 int[] ids = new int[] { -1, -2, -3 }; // 分配 ID 值 builder.IDs = ids; // 坐标现在为 (x, y, z, m, id) // (1, 2, 1, 0, -1), (3, 4, 2, 1, -2) (5, 6, 1, 2, -3) // 创建一个新点 MapPoint point = MapPointBuilderEx.CreateMapPoint(-300, 400, 4); builder.SetPoint(2, point); // 坐标现在为 (x, y, z, m, id) // (1, 2, 1, 0, -1), (3, 4, 2, 1, -2) (-300, 400, 4, NaN, 0) builder.RemovePoints(1, 3); // builder.PointCount = 1
上一篇:普中51单片机:LED点阵屏组成结构及实现方法详解(九)


下一篇:【Apache Doris】周FAQ集锦:第 15 期-数据操作问题