ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / SimplifyAsFeature Method
The geometry to be simplified.
(Optional) The default value is false. When true, it forces the simplification code to be applied to the geometry even if the geometry comes from a trusted source or has already been simplified. When false, the method will do nothing if called on the same geometry a second time.
Example

In This Topic
    SimplifyAsFeature Method (GeometryEngine)
    In This Topic
    Simplifies the given geometry to make it topologically consistent according to the geometry type for storage in a database. For instance, it rectifies polygons that may be self-intersecting.
    Syntax
    public Geometry SimplifyAsFeature( 
       Geometry geometry,
       bool forceSimplify
    )
    Public Function SimplifyAsFeature( _
       ByVal geometry As Geometry, _
       ByVal forceSimplify As Boolean _
    ) As Geometry

    Parameters

    geometry
    The geometry to be simplified.
    forceSimplify
    (Optional) The default value is false. When true, it forces the simplification code to be applied to the geometry even if the geometry comes from a trusted source or has already been simplified. When false, the method will do nothing if called on the same geometry a second time.

    Return Value

    The simplified geometry.
    Exceptions
    ExceptionDescription
    Geometry is null.
    The method is not implemented for GeometryBag or Multipatch.
    Remarks
    The method tries to have the same behavior as IFeatureSimplify.SimplifyFeature on the Feature class. If the input geometry is a polyline, the method is equivalent to IPolyline::SimplifyNonPlanar(). If the input geometry is a polygon, the method is equivalent to IPolygon::SimplifyPreserveFromTo(). For all other geometry types, the method is equivalent to ITopologicalOperator::Simplify(). See SimplifyAsFeature and IsSimpleAsFeature Pro Concepts topic.

    GeometryEngine SimplifyAsFeature

    Example
    Simplify a polygon
    var g1 = PolygonBuilderEx.FromJson("{\"rings\": [ [ [0, 0], [10, 0], [10, 10], [0, 10] ] ] }");
    var result = GeometryEngine.Instance.Area(g1);      // result = -100.0   - negative due to wrong ring orientation
                                                        // simplify it
    var result2 = GeometryEngine.Instance.Area(GeometryEngine.Instance.SimplifyAsFeature(g1, true));
    // result2 = 100.0  - positive due to correct ring orientation (clockwise)
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also