ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data.Topology Namespace / TopologyRuleType Enumeration
Example Example

In This Topic
    TopologyRuleType Enumeration
    In This Topic
    Specifies the types of topology rules.
    Syntax
    Members
    MemberDescription
    AreaAreaCoverEachOther The rule is an 2 areas cover each other rule.
    AreaBoundaryCoveredByAreaBoundary The rule is an area boundary covered by line rule.
    AreaBoundaryCoveredByLine The rule is an area boundary covered by line rule.
    AreaContainOnePoint The rule is one point must be found in each area.
    AreaContainPoint The rule is an area contain point rule.
    AreaCoveredByArea The rule is an area covered by area rule.
    AreaCoveredByAreaClass The rule is an area covered by area class rule.
    AreaNoGaps The rule is an area-no gap rule.
    AreaNoOverlap The rule is an area-no overlap rule.
    AreaNoOverlapArea The rule is an area covered by area rule.
    FeatureLargerThanClusterTolerance The rule is a feature to be deleted is smaller than the cluster tolerance rule.
    LineCoveredByAreaBoundary The rule is a line covered by area boundary rule.
    LineCoveredByLineClass The rule is a line covered by line class rule.
    LineEndpointCoveredByPoint The rule is a line endpoint covered by point rule.
    LineInsideArea The rule is a line must be inside area rule.
    LineNoDangles The rule is a line-no dangles rule.
    LineNoIntersection The rule is a line-no intersection rule.
    LineNoIntersectLine The rule is a line must not intersect with line rule.
    LineNoIntersectOrInteriorTouch The rule is a line-no intersect or interior touch rule.
    LineNoIntersectOrInteriorTouchLine The rule is a line must not intersect or touch interior of line rule.
    LineNoMultipart The rule is a line cannot be multipart rule.
    LineNoOverlap The rule is a line-no overlap rule.
    LineNoOverlapLine The rule is a line-no overlap line rule.
    LineNoPseudos The rule is a line with no pseudo-nodes rule.
    LineNoSelfIntersect The rule is a line-no self intersect rule.
    LineNoSelfOverlap The rule is a line-no self overlap rule.
    PointCoincidePoint The rule is a point must be coincident with point rule.
    PointCoveredByAreaBoundary The rule is a point covered by area boundary rule.
    PointCoveredByLine The rule is a point covered by line rule.
    PointCoveredByLineEndpoint The rule is a point covered by line endpoint rule.
    PointDisjoint The rule is a point must be disjoint rule.
    PointProperlyInsideArea The rule is a point properly inside area rule.
    Example
    MarkAndUnmarkAsErrors
    // Get all the errors due to features violating the "PointProperlyInsideArea" topology rule.
    
    using (TopologyDefinition topologyDefinition = topology.GetDefinition())
    {
      TopologyRule pointProperlyInsideAreaRule = topologyDefinition.GetRules().First(rule => rule.RuleType == TopologyRuleType.PointProperlyInsideArea);
    
      ErrorDescription errorDescription = new ErrorDescription(topology.GetExtent())
      {
        TopologyRule = pointProperlyInsideAreaRule
      };
    
      IReadOnlyList<TopologyError> errorsDueToViolatingPointProperlyInsideAreaRule = topology.GetErrors(errorDescription);
      Console.WriteLine($"There are {errorsDueToViolatingPointProperlyInsideAreaRule.Count} feature violating the 'PointProperlyInsideArea' topology rule.");
    
      // Mark all errors from features violating the 'PointProperlyInsideArea' topology rule as exceptions.
    
      foreach (TopologyError error in errorsDueToViolatingPointProperlyInsideAreaRule)
      {
        topology.MarkAsException(error);
      }
    
      // Now verify all the errors from features violating the 'PointProperlyInsideArea' topology rule have indeed been
      // marked as exceptions.
      //
      // By default, ErrorDescription is initialized to ErrorType.ErrorAndException.  Here we want ErrorType.ErrorOnly.
    
      errorDescription = new ErrorDescription(topology.GetExtent())
      {
        ErrorType = ErrorType.ErrorOnly,
        TopologyRule = pointProperlyInsideAreaRule
      };
    
      IReadOnlyList<TopologyError> errorsAfterMarkedAsExceptions = topology.GetErrors(errorDescription);
      Console.WriteLine($"There are {errorsAfterMarkedAsExceptions.Count} feature violating the 'PointProperlyInsideArea' topology rule after all the errors have been marked as exceptions.");
    
      // Finally, reset all the exceptions as errors by unmarking them as exceptions.
    
      foreach (TopologyError error in errorsDueToViolatingPointProperlyInsideAreaRule)
      {
        topology.UnmarkAsException(error);
      }
    
      IReadOnlyList<TopologyError> errorsAfterUnmarkedAsExceptions = topology.GetErrors(errorDescription);
      Console.WriteLine($"There are {errorsAfterUnmarkedAsExceptions.Count} feature violating the 'PointProperlyInsideArea' topology rule after all the exceptions have been reset as errors.");
    }
    
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.Data.Topology.TopologyRuleType

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also