Available with Advanced license.
Summary
Generates a coverage with correct polygon or arc–node topology. To do this, Clean edits and corrects geometric coordinate errors, assembles arcs into polygons, and creates feature attribute information for each polygon or arc (that is, creates a PAT or AAT).
Illustration
Usage
While processing, Clean:
- Finds intersections between arcs, splits the arcs, and codes the intersections as nodes (arc endpoints).
- Merges coordinates within the fuzzy tolerance of each other. Because the fuzzy tolerance actually moves arc vertices, understanding its relationship to coverage resolution is important.
- Creates the list of arcs that defines each polygon's boundary, numbers the nodes, and establishes the From-node and To-node for each arc as well as the internal polygon numbers to the left and right of each arc.
- Deletes dangling arcs that are shorter than the specified dangle length.
- Builds a polygon attribute table (PAT) or an arc attribute table (AAT), depending on the option used. It calculates the area and perimeter for each polygon and stores this information along with the polygon internal number and User-ID in the PAT. If the input coverage already has a PAT, the polygon's original internal number is used to join any additional items in the PAT to the output coverage PAT.
If the Input Coverage has either PAT or AAT feature attribute tables, they are automatically updated in the Output Coverage for the POLY option. Only the AAT will be updated when using the LINE option. The internal number of each Input Coverage feature is used to relate attribute information from the Input Coverage feature attribute table to the Output Coverage to ensure that the attributes are properly joined to the output feature attribute tables. Feature User-IDs do not have to be unique to ensure that each input feature keeps its attributes in the Output Coverage.
Do not run Clean on a geographic coverage. Geographic coverages have units in decimal degrees, decimal seconds, radians, and so on. These units are designed to measure angles; they do not measure distances. They represent a spherical coordinate system and should not be confused with a 2D rectilinear coordinate system upon which commands like Clean, Buffer, Union, and other overlay processes are designed to work. You must first Project your geographic coverage to a suitable projection to convert your angles of latitude and longitude using angular units to a 2D rectilinear Cartesian coordinate system using rectilinear units of Feet, Meters, Kilometers, and so on.
Clean requires free disk space approximately 13 times the size of your input coverage to create temporary scratch files. These scratch files are created in your current workspace by default. You can override the default and have the scratch files created in another directory by setting the ARCTMPDIR variable. You must have write access to this directory.
Learn more about temporary files created by geoprocessing tools
Polygon label points are not required by the Clean command but must be used if you want nonzero User-IDs for polygons. Polygons that contain no label points are assigned a User-ID of zero in Clean.
Before Clean , place only one label point in each polygon. If a polygon contains more than one label point, one of the label points in the polygon is arbitrarily chosen to assign the User-ID. Even though one label point is chosen for User-ID assignment, other label points are not removed by Clean.
Clean with the POLY option creates one additional polygon called the background or universe polygon. It is always given polygon internal number 1, and its area is the total sum of the areas of all other polygons in the coverage. It is shown as a negative AREA in the PAT.
The Dangle Length and Fuzzy Tolerance for the Output Coverage are set and verified by Clean.
The fuzzy tolerance is used by the Clean tool. This is the distance the Clean tool is allowed to move features, to eliminate duplicate nodes, create nodes at intersections of lines, and eliminate duplicate features. The fuzzy tolerance is measured in coverage units. When using the Clean tool it is critical that an appropriate fuzzy tolerance be assigned, so that necessary features are not eliminated by mistake.
The POLY and LINE options with Clean will update the SEC and RAT with adjustments for splitting and arc renumbering. However, any routes or sections attached to arcs merged away by Fuzzy Tolerance are deleted.
Route systems in the Input Coverage will be maintained in the Output Coverage as long as each route has a unique User-ID.
Clean cannot be executed on a region coverage that contains unclosed regions. Clean will stop execution upon detecting the first unclosed region.
Clean with the LINE option does not maintain any region subclass information (topology or attribute). The LINE option deletes the .PAT and the .PATsubclass files.
Clean with the POLY option maintains region topology. If preliminary region topology exists, Clean will create region topology by creating a .PAT and a .PATsubclass.
Clean copies Input Coverage annotation to the Output Coverage.
Links are not maintained after Clean has been executed.
Clean will update the NAT if it exists in the Input Coverage. New nodes will have their attributes set to zero.
Clean will update any SECs if they exist in the Input Coverage. Sections on arcs that are split are also split, and the measures on these arcs are updated.
Do not use Clean on a COGO coverage. Any arcs that are split by Clean will not have their COGO attributes updated. For example, an arc with a DISTANCE item value of 100 that is split by Clean will give the two new arcs DISTANCE values of 100. Use the Build tool instead and resolve any overlapping arcs in the COGO editing environment.
If you copy a double precision coverage to a single precision coverage, you must Clean the Output Coverage to rebuild polygon topology.
On single precision coverages, Clean calculates a minimum tolerance based on the mathematical precision of the coverage (the width of the BND and the number of decimal places). If the calculated minimum tolerance is greater than the Fuzzy Tolerance entered on the command line, the calculated minimum tolerance is used.
The coordinate precision of the Output Coverage is determined by the current processing rule as set by the Precision for Derived Coverages environment setting. If the processing rule has not been established during the current session, then the processing rule will be HIGHEST. This means that Clean will create an Output Coverage in the same precision as the Input Coverage.
The projection file (PRJ) will be copied to the Output Coverage.
Syntax
Clean(in_cover, {out_cover}, {dangle_length}, {fuzzy_tolerance}, {feature_type})
Parameter | Explanation | Data Type |
in_cover | The coverage to be cleaned. | Coverage |
out_cover (Optional) | The coverage created by Clean. If the Input Coverage and the Output Coverage have the same name, the Input Coverage will be replaced. By default, the Input Coverage is replaced. | Coverage |
dangle_length (Optional) | The minimum length allowed for dangling arcs in the Output Coverage. A dangling arc is an arc that has the same polygon internal number on its left and right sides and ends at a dangling node. Dangling arcs are removed for both the POLY and LINE options. If the Dangle Length is not provided, the dangle length is read from the coverage TOL file if the TOL file exists;otherwise, dangle length is set to zero (the default). | Double |
fuzzy_tolerance (Optional) | The minimum distance between coordinates in each out_cover. Learn more about how the default fuzzy tolerance is calculated | Double |
feature_type (Optional) | Specifies whether to create polygon topology and a PAT or arc–node topology and an AAT. POLY is the default option. If POLY is used on a coverage that has an existing AAT, Clean will also automatically rebuild the AAT.
| String |
Code sample
Clean example (stand-alone script)
The following stand-alone script demonstrates how to clean a coverage for polygon topology.
# Name: Clean_Example.py
# Description: Cleans a coverage for polygon topology.
# Requirements: ArcInfo Workstation
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data"
# Set local variables
inCover = "zones"
outCover = "C:/output/zones"
fuzzyTolerance = 0.25
featureType = "POLY"
#Execute Clean
arcpy.Clean_arc(inCover, outCover, "", fuzzyTolerance, featureType)
Environments
Licensing information
- Basic: No
- Standard: No
- Advanced: Requires ArcInfo Workstation installed