Check Geometry (Data Management)
Generates a report of the geometry problems in a feature class.
Valid input formats are shapefile and feature classes stored in a personal geodatabase or file geodatabase. SDE Geodatabases automatically check the validity of each geometry when they are uploaded; therefore the Check Geometry and Repair Geometry tools are not for use with SDE.
For additional information on geometry problems, its impact on the software, and potential sources, see Checking and repairing geometries.
The Output Table will have a record for each geometry problem discovered. If no problems are found the table will be empty.
The Output Table has the following fields:
- CLASS—The full path to and name of the feature class in which the problem was found.
- FEATURE_ID—The Feature ID (FID) or Object ID (OID) for the feature with the geometry problem.
- PROBLEM—A short description of the problem.
The PROBLEM field will contain one of the following:
- Short segment—Some segments are shorter than allowed by the system units of the spatial reference associated with the geometry.
- Null geometry—The feature has no geometry or nothing in the SHAPE field.
- Incorrect ring ordering—The polygon is topologically simple, but its rings may not be oriented correctly (outer rings—clockwise, inner rings—counterclockwise).
- Incorrect segment orientation—Individual segments are not consistently oriented. The "to" point of seg i should be incident on the "from" point of seg i+1.
- Self intersections—A polygon must not intersect itself.
- Unclosed rings—The last segment in a ring must have its "to" point incident on the "from" point of the first segment.
- Empty parts—The geometry has multiple parts and one of them is empty (has no geometry).
- Duplicate vertex—The geometry has two or more vertices with identical coordinates.
- Mismatched attributes—The Z or M coordinate of a line segment's endpoint does not match the Z or M coordinate of the coincident endpoint on the next segment.
- Discontinuous parts—One of the geometry's part is made up of disconnected or discontinuous parts.
- Empty Z values—The geometry has one or more vertex with empty Z value (NaN, for example).
The problem identified by this tool can be addressed in the following ways:
- Manually editing and fixing the feature with the geometry problems. Some of the problems, such as nonsimple geometry, cannot be fixed in the Editor.
- By running the Repair Geometry tool on the feature classes that were identified as having geometry problems.
For point features, only the null geometry problem applies.
To facilitate the review of the features which are reported to have geometry problems in ArcMap you can join the Input Features to the Output Table using the Join tool. Simply join using the input's ObjectID field, and the output table's FEATURE_ID field. You may also uncheck the Keep All option so that only features with geometry problems are displayed.
Starting with the 10.0 release, a line geometry is no longer considered "self-intersecting" if it crosses itself. There was no adverse effect to these types of geometry therefore the Check Geometry tool will no longer report the feature as a problem, and the Repair Geometry tool will no longer perform a "fix" on the feature's geometry. Prior to the 10.0 release Repair Geometry would add vertices at the point of intersection of "self-intersecting" lines. If you do want to add vertices when line features intersect themselves use the Integrate tool.
One or more feature classes or feature layers that will be checked for geometry problems. Valid input formats are shapefile and feature classes stored in a personal geodatabase or file geodatabase.
The table that will contain the list of problems that were discovered in the input features.
The following Python Window script demonstrates how to use the CheckGeometry function in immediate mode.
import arcpy arcpy.env.workspace = "c:/data/data.gdb" arcpy.CheckGeometry_management (["contours", "roads", "vegetation"], "CG_Result")
The following stand-alone script uses the CheckGeometry function as by looping through all the feature classes in a geodatabase.
# BatchCheckGeometry.py # Description: # Loops through all the feature classes in a geodatabase, and generates # a report of the problems encountered with feature geometry. # Requirements: Python # Import modules import arcpy # The workspace in which the feature classes will be checked outTable = "C:/data/St_Lucia.gdb/checkGeometryResult" arcpy.env.workspace = "C:/data/St_Lucia.gdb" # A variable that will hold the list of all the feature classes # inside the geodatabase fcs =  # List all feature classes in feature datasets for fds in arcpy.ListDatasets("","featuredataset"): fcs += arcpy.ListFeatureClasses("*","",fds) # List all standalone feature classes fcs = arcpy.ListFeatureClasses() print "Running the check geometry tool on %i feature classes" % len(fcs) arcpy.CheckGeometry_management(fcs, outTable) print (str(arcpy.GetCount_management(outTable)) + " geometry problems were found.") print ("See " + outTable + " for full details")