Summary
Repairs self-intersecting line or polygon features. The portion between the feature and the intersection points are either deleted or split into a new feature.
Illustration
Usage
If a feature intersects itself at a point and continues by crossing itself, it is considered a self-intersection. However, if the feature snaps to itself at a point and turns back without crossing itself, it is not considered a self-intersection.
If the input features are z-enabled, the z-values at the point of self-intersection will be evaluated and features will only be repaired if the z-values of both segments are identical at the self-intersection point. For example, if all of the z-values on a road represented the ground elevation and the road has a self-intersection, the z-values at the intersection would be identical and the feature would be repaired. However, if the road line represented a ramp, one z-value at the point of intersection would likely be on the ground while the other might be elevated to connect to the overpassing feature. Features such as the ramp would not be repaired because the z-values at the intersection point are different.
If the input feature contains multiple parts, the following applies:
- For lines, all parts that are continuous will be considered when determining if there is a self-intersection. For example, if a segment from part 1 of the feature intersects a segment from part 2 of a continuous feature, this will be considered a self-intersection and the feature will be repaired. Lines that are not continuous parts will not be considered intersecting.
- For polygons, only individual parts will be considered when determining if there is a self-intersection. For example, if a segment from part 1 of the feature intersects a segment from part 2 of the feature, this will not be considered a self-intersection; however, if a segment from part 1 intersects another segment from part 1, this will be considered a self-intersection.
For line features, if the end points of a line touch each other, the feature is considered a line that closes on itself and will not be modified by this tool.
For line features that have coincident segments rather than coincident vertices, the feature is considered a self-overlapping line and will not be modified by this tool.
A self-intersection at either the start or end point of a line feature may be considered an acceptable self-intersection, for example, a cul-de-sac where the end point of the geometry touches the interior of the line. Use the Remove Self Intersections at End Point parameter to specify whether self-intersections involving the start or end point will be repaired.
For line features, the Maximum Length parameter specifies the length of the segment between the points of self-intersection. For a polygon, the Maximum Length parameter specifies the perimeter of the smaller polygon created by the self-intersection. Only those segments with a length or perimeter smaller than the specified maximum length will be removed or split. Use this parameter to differentiate between small self-intersections that may have been created in error and larger self-intersections that were created intentionally.
When Split is selected as the Repair Type, the self-intersecting feature is divided into two features: one with the geometry of the segment between the points of self-intersection and another with the geometry of the segments before and after the intersection.
This tool does not support multipart intersections.
Caution:
This tool modifies the input data. See Tools that modify or update the input data for more information and strategies to avoid undesired data changes.
Syntax
arcpy.topographic.RepairSelfIntersection(in_features, repair_type, {max_length}, {repair_at_end_point})
Parameter | Explanation | Data Type |
in_features | The polyline or polygon feature class from which this tool will repair self-intersections. | Feature Layer |
repair_type | Indicates whether the tool will delete or split self-intersections.
| String |
max_length (Optional) | The maximum length of the segment between the points of self-intersection. Only segments shorter than the specified maximum length are deleted. | Linear Unit |
repair_at_end_point (Optional) | Indicates whether this tool will remove, or avoid removing, any self-intersections whose end point is snapped on itself.
| Boolean |
Derived Output
Name | Explanation | Data Type |
modified_in_features | Polygon or polyline features with self-intersections removed. | Feature Layer |
Code sample
The following stand-alone sample script demonstrates how to repair the self-intersections in the roads feature class that are under fifty meters long.
# Name: RepairSelfIntersection_sample.py
# Description: Repair the self-intersections in the roads feature class that are under 50 meters long. No warnings or errors will be recorded in a table.
# Import System Modules
import arcpy
# Check Out Extensions
arcpy.CheckOutExtension("Foundation")
# Setting Local variables
input_features = r"C:\data\Edit_Sample.gdb\Roads"
maximum_removal_length = "50 Meters"
# Execute Repair Self Intersections
arcpy.topographic.RepairSelfIntersection(in_features, "DELETE", max_length, "IGNORE_ENDS")
# Check In Extensions
arcpy.CheckInExtension("Foundation")
Environments
Licensing information
- Basic: No
- Standard: Requires Production Mapping
- Advanced: Requires Production Mapping