ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LasDatasetLayer Class / GetElevationRangeFromDatasetExtent Method
Example

In This Topic
    GetElevationRangeFromDatasetExtent Method
    In This Topic
    Gets the minimum and maximum elevation values from the extent of the data contained in the layer's dataset. The values are returned in meters. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public ValueTuple<double,double> GetElevationRangeFromDatasetExtent()
    Public Function GetElevationRangeFromDatasetExtent() As ValueTuple(Of Double,Double)

    Return Value

    The minimum and maximum elevation values.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    If no extent can be found, then the values of System.Double.MinValue and System.Double.MaxValue are returned.
    Example
    Elevation Range Filter
    {
      // get the state of the current elevation range filter
      var isEnabled = lasDatasetLayer.IsElevationRangeFilterEnabled;
    
      // turn off the filter
      lasDatasetLayer.SetElevationRangeFilterEnabled(false);  // or true to turn it on
    
      // get the current elevation range filter and access the values
      var elevRangeFilter = lasDatasetLayer.GetElevationRangeFilter();
      isEnabled = elevRangeFilter.IsEnabled;
      var minZ = elevRangeFilter.MinZ;
      var maxZ = elevRangeFilter.MaxZ;
    
      // get minimum and maximum Z values from the LAS Dataset
      (minZ, maxZ) = lasDatasetLayer.GetElevationRangeFromDatasetExtent();
    
      // set the elefvation range filter values
      //  note this doesn't change the enabled state of the elevation range filter
      lasDatasetLayer.SetElevationRangeFilter(1.2, 4.5);
    
      // or set the elevation range filter using a LasPointElevationRangeFilter
      elevRangeFilter = new LasPointElevationRangeFilter(true, 1.2, 4.5);
      lasDatasetLayer.SetElevationRangeFilter(elevRangeFilter);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.8 or higher.
    See Also