ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / IsSimpleOgc Method
The geometry to be simplified.
The reason that the geometry is non-simple.
(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
    IsSimpleOgc Method (GeometryEngine)
    In This Topic
    Indicates if the given geometry is topologically consistent according to the Open Geospatial Consortium (OGC) validation specification.
    Syntax
    Public Function IsSimpleOgc( _
       ByVal geometry As Geometry, _
       ByRef nonSimpleReason As NonSimpleReason, _
       ByVal forceIsSimple As Boolean _
    ) As Boolean

    Parameters

    geometry
    The geometry to be simplified.
    nonSimpleReason
    The reason that the geometry is non-simple.
    forceIsSimple
    (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

    Returns true if the geometry is simple and false otherwise.
    Exceptions
    ExceptionDescription
    The input geometry is null.
    The method is not implemented for GeometryBag or Multipatch.
    Remarks
    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