ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LasDatasetLayer Class / ClassifyLasPoints Method
The set of classification edits to apply.
A boolean indicating if the current selection is to be kept.
Example

In This Topic
    ClassifyLasPoints Method
    In This Topic
    Applies the specified set of classification codes and / or classification flags to the LAS points identified by the LasPointSelectionFilter. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    editDescription
    The set of classification edits to apply.
    keepSelection
    A boolean indicating if the current selection is to be kept.

    Return Value

    A boolean indicating edits have been applied.
    Exceptions
    ExceptionDescription
    editDescription is null.
    Invalid arguments are supplied. See CanClassifyLasPoints.
    An exception occurred within the edit procedure.
     
    This method or property must be called within the lambda passed to QueuedTask.Run
    Remarks
    Use CanClassifyLasPoints to determine if the edit is valid for the layer before applying it.

    The changes made are permanent. If you are conducting trial scenarios, or do not want changes to be permanent, work with a copy of the files and not the original data.

    Example
    Classify LAS Points
    // build the LasPointClassificationDescription
    // assign a new classification code to be assigned to the selected LAS points
    // don't alter any of the classification flags
    var edits = new LasPointClassificationDescription();
    edits.ClassCode = 6;
    
    if (lasDatasetLayer.CanClassifyLasPoints(edits))
      lasDatasetLayer.ClassifyLasPoints(edits, true);
    
    
    // alternatively set up the LasPointClassificationDescription to modify classification flags
    var edits2 = new LasPointClassificationDescription();
    edits2.KeyPoints = LasClassFlagEditType.Set;
    edits2.SyntheticPoints = LasClassFlagEditType.Clear;
    // don't change the OverlapPoints, WithheldPoints flags
    
    // apply the edit
    if (lasDatasetLayer.CanClassifyLasPoints(edits2))
      lasDatasetLayer.ClassifyLasPoints(edits2, true);
    
    
    
    // or perform both a classification code and classification flag edit
    var edits3 = new LasPointClassificationDescription();
    edits3.ClassCode = 5;
    edits3.KeyPoints = LasClassFlagEditType.Set;
    edits3.SyntheticPoints = LasClassFlagEditType.Clear;
    // be explicit about not changing the other flags
    edits3.WithheldPoints = LasClassFlagEditType.NoChange;
    edits3.OverlapPoints = LasClassFlagEditType.NoChange;
    
    // apply the edit
    if (lasDatasetLayer.CanClassifyLasPoints(edits3))
      lasDatasetLayer.ClassifyLasPoints(edits3, true);
    Requirements

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

    ArcGIS Pro version: 3.7 or higher.
    See Also