Tools that honor the XY Tolerance environment will override the default x,y tolerance on geodatasets created in a geodatabase.
By default, a tool that uses this environment setting will use the x,y tolerance of the input feature class's spatial reference. Overriding the default XY Tolerance is not recommended. Instead, ensure that your input data spatial reference uses the default settings for its XY Resolution and XY Tolerance properties prior to analysis.
The x,y tolerance refers to the minimum distance between coordinates before they are considered equal.
For a description of the default x,y tolerance, see Spatial reference and geoprocessing.
- This environment setting will be ignored if the output is in a geodatabase feature dataset.
- For tools such as Create Feature Class, Create Feature Dataset, and Create Raster Catalog, the default x,y tolerance for the output geodataset is 0.001 meters (1 millimeter) or its equivalent in map units. This environment can be set to a different value if the default is not acceptable.
- If the environment has measurement units other than those of the output coordinate system, the distance will be converted to an equivalent distance in the center of the output coordinate system. This is not recommended when the environment is set to a linear unit (feet or meters) while the output coordinate system is unprojected (geographic) or in the inverse situation (a decimal degree environment with a projected output coordinate system).
- If the tolerance units are not set or are set to Unknown, the units are assumed to be the same as those of the output coordinate system.
- If the x,y tolerance is less than twice the output geodataset's x,y resolution value, an x,y tolerance of two times the x,y resolution will be used.
- The x,y tolerance is not preserved in geodatabase versions earlier than 9.2.
- Tools that have an x,y tolerance parameter, such as Cluster Tolerance in the Union and Intersect tools, will override the XY Tolerance environment setting.
XY Tolerance—The x,y tolerance to be set on the geodatasets created by geoprocessing tools. By default, a tool that uses this environment will use the input's feature class spatial reference x,y tolerance.
arcpy.env.XYTolerance = linear_unit
The x,y tolerance to be set on the geodatasets created by geoprocessing tools. By default, a tool that uses this environment will use the input's feature class spatial reference x,y tolerance. Setting this environment is not recommended.
import arcpy # Set the XYTolerance to 0.02 Meters arcpy.env.XYTolerance = "0.02 Meters"