ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / Generalize Method
The geometry to be generalized.
The maximum distance in meters that the output geometry can deviate from the input geometry.
When true, the degenerate parts of the geometry will be removed from the output.
(Optional) The default value is false.
Example

In This Topic
    Generalize Method (IGeometryEngine)
    In This Topic
    Performs the generalize operation on the geometry.
    Syntax

    Parameters

    geometry
    The geometry to be generalized.
    maxDeviation
    The maximum distance in meters that the output geometry can deviate from the input geometry.
    removeDegenerateParts
    When true, the degenerate parts of the geometry will be removed from the output.
    preserveCurves
    (Optional) The default value is false.

    Return Value

    The generalized geometry. If the input geometry is empty, then it is returned unchanged.
    Exceptions
    ExceptionDescription
    Geometry is null.
    The method is not implemented for GeometryBag or Multipatch.
    The geometry is of an incorrect type. (i.e. a point or multipoint).
    Remarks
    Generalize performs a Douglas-Peucker Generalization algorithm with a specified maximum offset tolerance given as input. For line segments, the generalized output is a subset of the original input vertices. For non-linear segments, if preserveCurves is false, then the generalized output contains points along all parts of the curve, not necessarily only the vertices. If preserveCurves is true, then the non-linear segments are left as is.
    Example
    Generalize
    Polyline generalizedPolyline = GeometryEngine.Instance.Generalize(polylineWithZ, 200) as Polyline;
    // generalizedPolyline.HasZ = true
    
    Polygon generalized3DPolyline = GeometryEngine.Instance.Generalize3D(polylineWithZ, 200) as Polygon;
    // generalized3DPolyline.HasZ = true
    
    // note that generalized3DPolyline and generalizedPolyline will have different definitions
    //  ie generalizedPolyline.IsEqual(generalized3DPolyline) = false
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also