ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / SimplifyOgc 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
    SimplifyOgc Method (GeometryEngine)
    In This Topic
    Simplifies the given geometry according to the Open Geospatial Consortium (OGC) validation specification.
    Syntax
    public Geometry SimplifyOgc( 
       Geometry geometry,
       bool forceSimplify
    )
    Public Function SimplifyOgc( _
       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
    The input geometry is null.
    The method is not implemented for GeometryBag or Multipatch.
    Remarks
    The OGC specification is defined in OpenGIS Implementation Standard for Geographic information – simple feature access – Part 1: common architecture.

    A geometry that is simplified using this method will be simple for IsSimpleAsFeature and SimplifyAsFeature.

    Example
    SimplifyOgc
    
    SpatialReference sr = SpatialReferences.WGS84;
    
    Coordinate2D[] coords = new Coordinate2D[] { new Coordinate2D(5, 10), new Coordinate2D(15, 20), new Coordinate2D(25, 10), new Coordinate2D(5, 20) };
    Polyline polyline = PolylineBuilderEx.CreatePolyline(coords, sr);
    // polyline.IsKnownSimpleOgc = false
    // polyline.IsKnownSimple = false
    
    NonSimpleReason nonSimpleReason;
    bool isSimple = GeometryEngine.Instance.IsSimpleOgc(polyline, out nonSimpleReason, true);
    // isSimple = false
    // nonSimpleReason = NonSimpleReason.SelfIntersections
    
    Polyline simplePolyline = GeometryEngine.Instance.SimplifyOgc(polyline) as Polyline;
    // simplePolyline.IsKnownSimpleOgc = true
    // simplePolyline.IsKnownSimple = true
    
    
    
    double resolution = sr.XYResolution;
    Coordinate3D[] coords3D = new Coordinate3D[] { new Coordinate3D(0, 0, 0), new Coordinate3D(0, 1.8 * resolution, 0.8 * sr.ZTolerance), new Coordinate3D(10, 10, 1),
      new Coordinate3D(0, 5, 1) };
    polyline = PolylineBuilderEx.CreatePolyline(coords3D, sr);
    
    isSimple = GeometryEngine.Instance.IsSimpleOgc(polyline, out nonSimpleReason);
    // isSimple = false
    // nonSimpleReason = NonSimpleReason.ShortSegments
    
    simplePolyline = GeometryEngine.Instance.SimplifyOgc(polyline, true) as Polyline;
    // simplePolyline.IsKnownSimpleOgc = true
    // simplePolyline.IsKnownSimple = true
    
    
    
    coords = new Coordinate2D[] { new Coordinate2D(0, 0), new Coordinate2D(0, 0) };
    Multipoint multipoint = MultipointBuilderEx.CreateMultipoint(coords, sr);
    
    isSimple = GeometryEngine.Instance.IsSimpleOgc(multipoint, out nonSimpleReason);
    // isSimple = false
    // nonSimpleReason = NonSimpleReason.DuplicateVertex
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also