Skip To Content

env

Summary

Environment settings are exposed as properties on ArcPy's env class. These properties can be used to retrieve the current values or to set them. Geoprocessing environment settings can be thought of as additional parameters that affect a tool's results.

Properties

PropertyExplanationData Type
addOutputsToMap
(Read and Write)

Sets whether a tool's resulting output datasets should be added to the application display. The setting has no effect when run from within a tool.

Boolean
autoCancelling
(Read and Write)

For use in script tools or Python toolbox tools.

When autoCancelling is set to True, a cancellation will end the script on the current line. If False, a cancellation will set the isCancelled property to True and continue executing. By default, autoCancelling is set to True.

Learn more about cancellation behavior.

Boolean
autoCommit
(Read and Write)

Tools that honor the Auto Commit environment will force a commit after the specified number of changes have been made within an enterprise geodatabase transaction.

Learn more about autoCommit.

Long
baDataSource
(Read and Write)

Tools that honor the Data Source environment setting honor how data is summarized from one layer to another. Used only by Business Analyst tools.

Learn more about baDatasource

String
buildStatsAndRATForTempRaster
(Read and Write)

Controls the calculation of statistics and building of raster attribute tables (RAT) for temporary rasters created by Spatial Analyst tools. The default is True.

When set to False, the statistics will be approximate for the purpose of symbolizing raster layers, and no RAT will be built.

Boolean
cartographicCoordinateSystem
(Read and Write)

Tools that honor the Cartographic Coordinate System environment will use the specified coordinate system to determine the size, extent, and spatial relationships of features when making calculations.

Learn more about cartographicCoordinateSystem.

String
cartographicPartitions
(Read and Write)

Tools that honor the Cartographic Partitions environment will subdivide input features by the specified partition polygon features for sequential processing to avoid memory limitations that may otherwise be encountered with large datasets.

Learn more about cartographicPartitions.

String
cellSize
(Read and Write)

Tools that honor the Cell size environment setting set the output raster cell size, or resolution, for the operation. The default output resolution is determined by the coarsest of the input raster datasets.

Learn more about cellSize.

String
coincidentPoints
(Read and Write)

Tools that honor the Coincident Points environment define how coincident data is treated in Geostatistical Analyst.

Learn more about coincidentPoints.

String
compression
(Read and Write)

Tools that honor the Compression environment setting will set the compression type when storing output raster datasets.

Learn more about compression.

String
configKeyword
(Read and Write)

Tools that honor Output CONFIG Keyword will use the specified keyword when creating datasets in a geodatabase.

Learn more about configKeyword.

String
extent
(Read and Write)

Tools that honor the Extent environment will only process features or rasters that fall within the extent specified in this setting.

Learn more about extent.

String
geographicTransformations
(Read and Write)

Tools that honor the Geographic Transformations environment will use the transformation methods when projecting data.

Learn more about geographicTransformations.

String
isCancelled
(Read Only)

For use in script tools or Python toolbox tools.

When autoCancelling is set to False and the tool has been cancelled, isCancelled will be set to True. isCancelled is False by default and is a read-only property.

Learn more about cancellation behavior.

Boolean
maintainAttachments
(Read and Write)

Tools that honor the Maintain Attachments environment setting will copy attachments from the input features to the output features.

Learn more about maintainAttachments.

Boolean
maintainSpatialIndex
(Read and Write)
Legacy:

The Maintain Spatial Index environment is not honored in ArcGIS Pro. For tools and workflows that perform insert, update, and delete operations against existing data in enterprise geodatabases, control of the spatial index can be accomplished by using the Remove Spatial Index tool to remove the spatial index prior to processing and the Add Spatial Index tool to re-create the spatial index after processing.

Boolean
mask
(Read and Write)

Tools that honor the Mask environment will only consider those cells that fall within the analysis mask in the operation.

Learn more about mask.

String
MDomain
(Read and Write)

Tools that honor the Output M Domain environment will generate output datasets with the specified measure (m)-domain.

Learn more about MDomain.

String
MResolution
(Read and Write)

Tools that honor this environment will apply the M resolution to output geodatasets.

Learn more about MResolution.

Double
MTolerance
(Read and Write)

Tools that honor this environment will override the default M tolerance on geodatasets created inside a geodatabase.

Learn more about MTolerance.

Double
nodata
(Read and Write)

Tools that honor the NoData environment setting will only process rasters where the NoData is valid.

Learn more about nodata.

String
outputCoordinateSystem
(Read and Write)

Tools that honor the Output Coordinate System environment will create output geodatasets with the specified coordinate system.

Learn more about outputCoordinateSystem.

String
outputMFlag
(Read and Write)

Tools that honor the Output has M Values environment will control whether the output geodataset will store M values.

Learn more about outputMFlag.

String
outputZFlag
(Read and Write)

Tools that honor the Output has Z Values environment will control whether the output geodataset will store z-values.

Learn more about outputZFlag.

String
outputZValue
(Read and Write)

Tools that honor this environment will set the z-coordinate for each output vertex that does not already have a z-coordinate.

Learn more about outputZValue.

String
overwriteOutput
(Read and Write)

Controls whether tools will automatically overwrite any existing output when run. When set to True, tools will execute and overwrite the output dataset. When set to False, existing outputs will not be overwritten and the tool will return an error.

Boolean
packageWorkspace
(Read Only)

The Package Workspace environment setting is the location of a folder that locates the contents of a shared geoprocessing package or service.

Learn more about packageWorkspace.

String
parallelProcessingFactor
(Read and Write)

Tools that honor the Parallel Processing Factor environment will divide and perform operations across multiple processes.

Learn more about parallelProcessingFactor.

Integer
processingServer
(Read and Write)

The ArcGIS server URL that has the Raster Processing system service enabled.

String
processingServerPassword
(Read and Write)

The password associated with the user name that is authorized to use the Raster Processing service.

String
processingServerUser
(Read and Write)

The user name that is authorized to use the Raster Processing service.

String
pyramid
(Read and Write)

Tools that honor the Pyramid environment setting will only process rasters where the pyramids are valid. Pyramids for ERDAS IMAGINE files have limited options that can be set.

Learn more about pyramid.

String
qualifiedFieldNames
(Read and Write)

Tools that honor the Qualified Field Names environment use this setting to distinguish between qualified or unqualified field names. Qualified field names are the names of fields in a feature class or table that have the name of the origin feature class or table appended onto the field name. This setting is relevant when working with joined data.

Learn more about qualifiedFieldNames.

Boolean
randomGenerator
(Read and Write)

Tools that use the Random Number Generator environment use algorithms that use the seed and distribution to produce a sequence of random numbers.

Learn more about randomGenerator.

Object
rasterStatistics
(Read and Write)

Tools that honor the Raster Statistics environment control how statistics are built for output raster datasets.

Learn more about rasterStatistics.

String
referenceScale
(Read and Write)

Tools that honor the Reference Scale environment will consider the graphical size and extent of symbolized features as they appear at the reference scale.

Learn more about referenceScale.

Double
resamplingMethod
(Read and Write)

Resampling is the process of interpolating the pixel values while transforming your raster dataset. This is used when the input and output do not line up exactly, when the pixel size changes, when the data is shifted, or a combination of these.

Learn more about resamplingMethod.

String
scratchFolder
(Read Only)

The Scratch Folder environment setting is the location of a folder you can use to write file-based data, such as shapefiles, text files, and layer files. It is a read-only environment managed by ArcGIS.

Learn more about scratchFolder.

String
scratchGDB
(Read Only)

The Scratch GDB environment setting is the location of a file geodatabase you can use to write temporary data.

Learn more about scratchGDB.

String
scriptWorkspace
(Read Only)

When a project is shared as a package, all components, such as tools, scripts, and datasets, are consolidated as needed. During consolidation, any tool being shared is updated with the scriptWorkspace environment to ensure all components can be located when the shared task is executed.

String
scratchWorkspace
(Read and Write)

Tools that honor the Scratch Workspace environment setting use the specified location as the default workspace for output datasets.

Learn more about scratchWorkspace.

String
snapRaster
(Read and Write)

Tools that honor the Snap Raster environment will adjust the extent of output rasters so that they match the cell alignment of the specified snap raster.

Learn more about snapRaster.

String
S100FeatureCatalogueFile
(Read and Write)

Tools that honor the S-100 Feature Catalogue File environment setting use the file specified to map objects, attributes, feature classes and relationships during data import and the creation of database schemas.

Learn more about the S100FeatureCatalogueFile

String
terrainMemoryUsage
(Read and Write)

Tools that honor the Terrain Memory Usage environment control memory use during analysis on terrains.

Learn more about terrainMemoryUsage.

Boolean
tileSize
(Read and Write)

Tools that honor the Tile Size environment set the tile size for rasters that are stored in blocks of data.

Learn more about tileSize.

String
tinSaveVersion
(Read and Write)

Tools that honor the TIN Storage Version setting will output TIN surfaces in the specified version.

Learn more about tinSaveVersion.

String
transferDomains
(Read and Write)

This geoprocessing environment controls whether output shapefiles and dBASE (.dbf) tables will have fields added containing domain and subtype descriptions, in addition to fields containing domain and subtype codes. This setting is only relevant when the input to a geoprocessing tool is a geodatabase feature class or table with domains and subtypes defined. By default, only domain and subtype codes are included in shapefile or dBASE (.dbf) output.

Learn more about transferDomains.

Boolean
transferGDBAttributeProperties
(Read and Write)

Tools that honor the Transfer field domains, subtypes and attribute rules environment setting control the transfer of geodatabase attributes.

Learn more about transferGDBAttributeProperties

Boolean
workspace
(Read and Write)

Tools that honor the Current Workspace environment setting use the workspace specified as the default location for geoprocessing tool inputs and outputs.

Learn more about currentWorkspace.

String
XYDomain
(Read and Write)

Tools that honor the Output XY Domain environment will set the specified range to the output geodataset's x,y domain.

Learn more about XYDomain.

String
XYResolution
(Read and Write)

Tools that honor this environment will apply the x,y resolution to output geodatasets.

Learn more about XYResolution.

String
XYTolerance
(Read and Write)

Tools that honor this environment will override the default x,y tolerance on geodatasets created inside a geodatabase.

Learn more about XYTolerance.

String
ZDomain
(Read and Write)

Tools that honor the Output Z Domain environment will generate output datasets with the specified z-domain.

Learn more about ZDomain.

String
ZResolution
(Read and Write)

Tools that honor this environment will apply the z-resolution to output geodatasets.

Learn more about ZResolution.

String
ZTolerance
(Read and Write)

Tools that honor this environment will override the default z-tolerance on geodatasets created inside a geodatabase.

Learn more about ZTolerance.

String

Related topics