env_setup package
Submodules
env_setup.environment_setup module
- env_setup.environment_setup.main()[source]
Initializes and executes the setup for ArcGIS Pro environment and project directory structure.
- Summary:
This function performs the essential initialization tasks for setting up the ArcGIS Pro environment and creating a predefined directory structure for the project.
- Details:
Initializes the ArcGIS environment setup by configuring workspace, output coordinate system (EPSG:25833), xy tolerance (0.02 meters), and xy resolution (0.01 meters), parallel processing factor and set the overwrite output flag to True.
Sets up the project directory structure, including creating geodatabases and layer files directories.
- class env_setup.environment_setup.StartTimePrinter[source]
Bases:
object
Prints the start time/date when it is called for the first time.
- Summary:
This class is responsible for printing the current date and time the first time it is called.
- Details:
Uses a class variable to ensure the message is printed only once.
Prints the current date and time in a readable format.
- class env_setup.environment_setup.ArcGisEnvironmentSetup(workspace='path\\to\\workspace.gdb', spatial_reference=25833)[source]
Bases:
object
Configures and initializes the ArcGIS Pro environment settings.
- Summary:
Sets up the ArcGIS Pro environment with specified workspace and spatial reference. Ensures setup is performed only once globally.
- Details:
Checks if setup has already been done globally to avoid duplication.
Sets arcpy.env.overwriteOutput to True, ensuring existing files can be overwritten.
Configures arcpy.env.workspace with the specified workspace path.
Sets the output coordinate system to the specified spatial reference (EPSG code).
Establishes arcpy.env.XYTolerance and arcpy.env.XYResolution for geometric precision.
Adjusts arcpy.env.parallelProcessingFactor according to CPU percentage configured, optimizing performance.
- workspace
The directory path for the ArcGIS workspace.
- Type:
str
- spatial_reference
The EPSG code for the spatial reference, defaulting to 25833 (ETRS89 / UTM zone 33N).
- Type:
int
- class env_setup.environment_setup.ProjectDirectorySetup(base_directory='C:\\path\\to\\folder\\you\\want\\your\\outputs\\in')[source]
Bases:
object
Creates and configures the project directory structure and geodatabases.
- Summary:
Establishes a predefined directory structure for project files and geodatabases, ensuring it’s done only once globally.
- Details:
Checks if the global setup has already been completed to prevent redundancy.
Creates a main directory and specified subdirectories for organizing project files.
Generates geodatabases in the designated subdirectories for data storage.
Sets up additional subdirectories within the subdirectories for miscellaneous files and layer configurations.
A common method create_subdir_structure is introduced to handle the creation of additional subdirectories within the subdirectories.
- base_directory
The root directory for the project structure.
- Type:
str
- sub_directories
A list of names for subdirectories to be created within the project structure.
- Type:
list
- gdb_names
Names of the geodatabases to be created in each subdirectory.
- Type:
list