Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Features toolset > Tools

Check Geometry (Data Management)

Release 9.2
Last modified November 29, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Inspects each feature's geometry for problems. Valid input formats are shapefile and feature classes stored in a personal geodatabase or file geodatabase. SDE Geodatabases automatically check each geometry's validity when it is uploaded, therefore the Check and Repair Geometry tools are not for use with SDE.


Usage tips

Command line syntax
An overview of the Command Line window
CheckGeometry_management <in_features;in_features...> <out_table>

Parameter Explanation Data Type
<in_features;in_features...>

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.

Feature Layer
<out_table>

The table that will contain the list of problems that were discovered.

Table
Data types for geoprocessing tool parameters


Command line example

workspace c:\ws\St_Lucia.mdb
CheckGeometry (contours ; roads ; vegetation ) CGResult

Scripting syntax
About getting started with writing geoprocessing scripts
CheckGeometry_management (in_features, out_table)

Parameter Explanation Data Type
in_features (Required)

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.

Feature Layer
out_table (Required)

The table that will contain the list of problems that were discovered.

Table

Data types for geoprocessing tool parameters


Script example

# 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 and the Python win32all extension
# Author: ESRI
# Data 1/1/2004

# Create the Geoprocessor
import arcgisscripting
gp = arcgisscripting.create()
inWorkspace = 'C:/ws/St_Lucia.mdb'
outTable = 'C:/ws/St_Lucia.mdb/checkGeometryResult'

# The workspace in which the feature classes will be checked
gp.workspace = inWorkspace

# A variable that will hold the list of all the feature classes (separated by semicolon)
inFeatureClasses = ""

# List all feature classes in feature datasets
fdss = gp.ListDatasets("","featuredataset")
fds = fdss.Next()
while fds:
    fcs = gp.ListFeatureClasses("*","",fds)
    fc = fcs.Next()
    while fc:
        if inFeatureClasses == "":
            inFeatureClasses = fds + "/" + fc
        else:
            inFeatureClasses = inFeatureClasses + ";" + fds + "/" + fc
        fc = fcs.Next()
    fds = fdss.Next()

# List all standalone feature classes
fcs = gp.ListFeatureClasses()
fc = fcs.Next()
while fc:
    if inFeatureClasses == "":
        inFeatureClasses = fc
    else:
        inFeatureClasses = inFeatureClasses + ";" + fc
    fc = fcs.Next()

# Put a try except look around the tool, in case an error occurs
try:
    print "Running the check geometry tool on %i feature classes" % len(inFeatureClasses.split(";"))
    gp.CheckGeometry(inFeatureClasses, outTable)
    print "%i problems were found, see %s" % (gp.GetCount(outTable), outTable)

except:
    # If an error occurred, print the messages returned by the tool
    print gp.GetMessages()
print "FINISHED"

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.