Parameters
- multipart
- The polygon or polyline to replace Zs.
- zValue
- The Z value to assign.
Return Value
A geometry in which each coordinate has the specified Z-value. If the input multipart is empty, then it is returned unchanged.
Exception | Description |
---|---|
System.ArgumentNullException | Multipart is null. |
System.InvalidOperationException | This geometry is not Z-Aware. |
List<Coordinate3D> coordsZ = new List<Coordinate3D>() { new Coordinate3D(1, 2, 3), new Coordinate3D(4, 5, 6), new Coordinate3D(7, 8, double.NaN) }; Polyline polyline = PolylineBuilderEx.CreatePolyline(coordsZ); // polyline.HasZ = true Polyline polylineSetZ = GeometryEngine.Instance.SetConstantZ(polyline, -1) as Polyline; // polylineSetZ.Points[0].Z = -1 // polylineSetZ.Points[1].Z = -1 // polylineSetZ.Points[2].Z = -1 polylineSetZ = GeometryEngine.Instance.SetConstantZ(polyline, double.NaN) as Polyline; // polyline.HasZ = true // polylineSetZ.Points[0].HasZ = true // polylineSetZ.Points[0].Z = NaN // polylineSetZ.Points[1].HasZ = true // polylineSetZ.Points[1].Z = NaN // polylineSetZ.Points[2].HasZ = true // polylineSetZ.Points[2].Z = NaN polylineSetZ = GeometryEngine.Instance.SetConstantZ(polyline, double.PositiveInfinity) as Polyline; // polyline.HasZ = true // polylineSetZ.Points[0].HasZ = true // polylineSetZ.Points[0].Z = double.PositiveInfinity // polylineSetZ.Points[1].HasZ = true // polylineSetZ.Points[1].Z = double.PositiveInfinity // polylineSetZ.Points[2].HasZ = true // polylineSetZ.Points[2].Z = double.PositiveInfinity
Target Platforms: Windows 11, Windows 10