ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / SimplifyAsFeature Method
The geometry to be simplified.
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 (IGeometryEngine)
    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
    Geometry SimplifyAsFeature( 
       Geometry geometry,
       bool forceSimplify
    )
    Function SimplifyAsFeature( _
       ByVal geometry As Geometry, _
       Optional ByVal forceSimplify As Boolean _
    ) As Geometry

    Parameters

    geometry
    The geometry to be simplified.
    forceSimplify
    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 or empty.
    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().

    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, Windows 8.1

    See Also