GeoEco.DataManagement.ArcGISRasters.ArcGISRaster.FindAndMove

classmethod ArcGISRaster.FindAndMove(inputWorkspace, outputWorkspace, wildcard='*', searchTree=False, rasterType=None, destinationRasterPythonExpression='os.path.join(destinationWorkspace, sourceRaster[len(workspaceToSearch)+1:])', modulesToImport=['os.path'], skipExisting=False, overwriteExisting=False)

Finds and moves rasters in an ArcGIS workspace.

Parameters:
  • inputWorkspace (str) – Workspace to search. Minimum length꞉ 1. Must exist.

  • outputWorkspace (str) – Workspace to receive the rasters. Minimum length꞉ 1.

  • wildcard (str, optional) – Wildcard expression specifying the rasters to find. Please see the documentation for the ArcGIS ListRasters() function for more information about the syntax. At the time of this writing, only the * wildcard character was supported, which would match zero or more of any character. Minimum length꞉ 1.

  • searchTree (bool, optional) – If True, child workspaces will be searched.

  • rasterType (str, optional) – Type of rasters to find. If provided, only rasters of this type will be found. At the time of this writing, the ArcGIS Pro 3.2 documentation specified that any of the following strings would be accepted: All (the default), BMP, GIF, GRID, IMG, JP2, JPG, PNG, TIFF. Minimum length꞉ 1.

  • destinationRasterPythonExpression (str, optional) –

    Python expression used to calculate the absolute path of a destination raster. The expression may be any Python statement appropriate for passing to the eval function and must return a string. The expression may reference the following variables:

    • workspaceToSearch - the value provided for the workspace to search parameter

    • destinationWorkspace - the value provided for the destination workspace parameter

    • sourceRaster - the absolute path to the source raster

    The default expression, os.path.join(destinationWorkspace, sourceRaster[len(workspaceToSearch)+1:]), stores the raster in the destination workspace at the same relative location it appears in the workspace to search. The destination path is calculated by stripping the workspace to search from the source path and replacing it with the destination workspace.

    For more information on Python syntax, please see the Python documentation.

    Minimum length꞉ 1.

  • modulesToImport (list of str, optional) – Python modules to import prior to evaluating the expression. If you need to access Python functions or classes that are provided by a module rather than being built-in to the interpreter, list the module here. For example, to be able to use the datetime class in your expression, list the datetime module here. In your expression, you must refer to the class using its fully-qualified name, datetime.datetime.

  • skipExisting (bool, optional) – If True, moving will be skipped for destination rasters that already exist.

  • overwriteExisting (bool, optional) – If True and skipExisting is False, existing destination rasters will be overwritten.

Returns:

Workspace to receive the rasters.

Return type:

str