public sealed class SurfaceZsResult
Public NotInheritable Class SurfaceZsResult
public sealed class SurfaceZsResult
Public NotInheritable Class SurfaceZsResult
var mapPoint = await QueuedTask.Run<MapPoint>(() => { MapPoint mapCentergeometry = MapView.Active.Map.CalculateFullExtent().Center; return mapCentergeometry; }); //Pass any Geometry type to GetZsFromSurfaceAsync var surfaceZResult = await MapView.Active.Map.GetZsFromSurfaceAsync(mapPoint); if (surfaceZResult.Status == SurfaceZsResultStatus.Ok) { // cast to a mapPoint var mapPointZ = surfaceZResult.Geometry as MapPoint; var z = mapPointZ.Z; }
var eleLayer = MapView.Active.Map.GetElevationSurfaceLayers().FirstOrDefault(l => l.Name == "TIN"); //Pass any Geometry type to GetZsFromSurfaceAsync var zResult = await MapView.Active.Map.GetZsFromSurfaceAsync(polyline, eleLayer); if (zResult.Status == SurfaceZsResultStatus.Ok) { var polylineZ = zResult.Geometry as Polyline; // process the polylineZ }
var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault(); await QueuedTask.Run(() => { if (tinLayer.CanGetZs()) { // get z value for a mapPoint var zResult = tinLayer.GetZs(mapPoint); if (zResult.Status == SurfaceZsResultStatus.Ok) { // cast to a mapPoint var mapPointZ = surfaceZResult.Geometry as MapPoint; var z = mapPointZ.Z; } // get z values for a polyline zResult = tinLayer.GetZs(polyline); if (zResult.Status == SurfaceZsResultStatus.Ok) { // cast to a mapPoint var polylineZ = surfaceZResult.Geometry as Polyline; } } });
var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault(); await QueuedTask.Run(() => { if (tinLayer.CanGetZs()) { // get z value for a mapPoint var zResult = tinLayer.GetZs(mapPoint); if (zResult.Status == SurfaceZsResultStatus.Ok) { // cast to a mapPoint var mapPointZ = zResult.Geometry as MapPoint; var z = mapPointZ.Z; } // get z values for a polyline zResult = tinLayer.GetZs(polyline); if (zResult.Status == SurfaceZsResultStatus.Ok) { // cast to a Polyline var polylineZ = zResult.Geometry as Polyline; } } });
System.Object
ArcGIS.Desktop.Mapping.SurfaceZsResult
Target Platforms: Windows 11, Windows 10