Remove Rasters From Mosaic Dataset (Data Management)

Summary

Removes selected rasters from a mosaic dataset.

Usage

  • You must specify a selection or a query ; otherwise, the tool will not run. To delete all the records from the mosaic dataset, specify a query that selects all the rasters, such as "OBJECTID>=0".

  • If the overviews are generated in the mosaic dataset, they will be deleted when they are removed, because they are managed by the mosaic dataset. If you created the overviews in a folder or a location other than the default location, they are not fully managed by the mosaic dataset and you can remove them without deleting them from disk. You may want to do this if you are using the overviews elsewhere.

  • If you identify the affected overviews but do not delete them, you can use the Build Overviews tool to regenerate the affected overviews.

  • This tool will also delete the cache created for each item in the mosaic dataset. Both raster cache and LAS cache can be removed. The properties for the cache for these datasets is defined in their functions.

  • Database fragmentation and frequent data manipulation can significantly increase the size of a mosaic dataset. If the database size is inflated due to constant transactions, run the Compact tool.

Parameters

LabelExplanationData Type
Mosaic Dataset

The mosaic dataset containing the rasters that will be removed.

Mosaic Layer
Query Definition
(Optional)

An SQL expression to select the raster datasets that will be removed from the mosaic dataset.

You must specify a selection or a query; otherwise, the tool will not run. To delete all the records from the mosaic dataset, specify a query that selects all the rasters, such as "OBJECTID>=0".

SQL Expression
Update Boundary
(Optional)

Specifies whether the boundary polygon of the mosaic dataset will be updated. By default, the boundary merges all the footprint polygons to create a single boundary representing the extent of the valid pixels.

  • Checked—The boundary polygon of the mosaic dataset will be updated. This is the default.
  • Unchecked—The boundary polygon of the mosaic dataset will not be updated.
Boolean
Mark Affected Overviews
(Optional)

Specifies whether affected overviews will be identified.

When the rasters in a mosaic dataset have been removed, overviews created using those rasters may no longer be accurate. Use this parameter to identify affected overviews so they can be updated or removed if they are no longer needed.

  • Checked—The affected overviews will be identified. This is the default.
  • Unchecked—The affected overviews will not be identified.
Boolean
Delete Overview Images
(Optional)

Specifies whether the overviews associated with the selected rasters will be deleted.

  • Checked—The overviews associated with the selected rasters will be deleted. This is the default.
  • Unchecked—The overviews associated with the selected rasters will not be deleted.
Boolean
Delete Item Cache
(Optional)

Specifies whether the cache that is based on any source raster dataset that will be removed from the mosaic dataset will also be removed.

  • Checked—The cache that is based on any source raster dataset that will be removed from the mosaic dataset will also be removed. This is the default.
  • Unchecked—The cache will not be removed and will remain a part of the mosaic dataset.
Boolean
Remove Mosaic Dataset Items
(Optional)

Specifies whether mosaic dataset items will be removed.

  • Checked—Mosaic dataset items will be removed. This is the default.
  • Unchecked—Mosaic dataset items will not be removed.
Boolean
Update Cell Size Ranges
(Optional)

Specifies whether the cell size ranges for the mosaic dataset will be updated.

  • Checked—The cell size ranges for the mosaic dataset will be updated. This is the default.
  • Unchecked—The cell size ranges for the mosaic dataset will not be updated
Boolean

Derived Output

LabelExplanationData Type
Updated Mosaic Dataset

The updated mosaic dataset.

Mosaic Layer

arcpy.management.RemoveRastersFromMosaicDataset(in_mosaic_dataset, {where_clause}, {update_boundary}, {mark_overviews_items}, {delete_overview_images}, {delete_item_cache}, {remove_items}, {update_cellsize_ranges})
NameExplanationData Type
in_mosaic_dataset

The mosaic dataset containing the rasters that will be removed.

Mosaic Layer
where_clause
(Optional)

An SQL expression to select the raster datasets that will be removed from the mosaic dataset.

You must specify a selection or a query; otherwise, the tool will not run. To delete all the records from the mosaic dataset, specify a query that selects all the rasters, such as "OBJECTID>=0".

SQL Expression
update_boundary
(Optional)

Specifies whether the boundary polygon of the mosaic dataset will be updated. By default, the boundary merges all the footprint polygons to create a single boundary representing the extent of the valid pixels.

  • UPDATE_BOUNDARYThe boundary polygon of the mosaic dataset will be updated. This is the default.
  • NO_BOUNDARY The boundary polygon of the mosaic dataset will not be updated.
Boolean
mark_overviews_items
(Optional)

Specifies whether affected overviews will be identified.

When the rasters in a mosaic dataset have been removed, overviews created using those rasters may no longer be accurate. Use this parameter to identify affected overviews so they can be updated or removed if they are no longer needed.

  • MARK_OVERVIEW_ITEMSThe affected overviews will be identified. This is the default.
  • NO_MARK_OVERVIEW_ITEMSThe affected overviews will not be identified.
Boolean
delete_overview_images
(Optional)

Specifies whether the overviews associated with the selected rasters will be removed.

  • DELETE_OVERVIEW_IMAGESThe overviews associated with the selected rasters will be deleted. This is the default.
  • NO_DELETE_OVERVIEW_IMAGESThe overviews associated with the selected rasters will not be deleted.
Boolean
delete_item_cache
(Optional)

Specifies whether the cache that is based on any source raster dataset that will be removed from the mosaic dataset will also be removed.

  • DELETE_ITEM_CACHEThe cache that is based on any source raster dataset that will be removed from the mosaic dataset will also be removed. This is the default.
  • NO_DELETE_ITEM_CACHEThe cache will not be removed and will remain a part of the mosaic dataset.
Boolean
remove_items
(Optional)

Specifies whether mosaic dataset items will be removed.

  • REMOVE_MOSAICDATASET_ITEMSMosaic dataset items will be removed. This is the default.
  • NO_REMOVE_MOSAICDATASET_ITEMSMosaic dataset items will not be removed.
Boolean
update_cellsize_ranges
(Optional)

Specifies whether the cell size ranges for the mosaic dataset will be updated.

  • UPDATE_CELL_SIZESThe cell size ranges for the mosaic dataset will be updated. Use this if you are removing all of the imagery at a specific cell size. This is the default.
  • NO_CELL_SIZESThe cell size ranges for the mosaic dataset will not be updated.
Boolean

Derived Output

NameExplanationData Type
out_mosaic_dataset

The updated mosaic dataset.

Mosaic Layer

Code sample

RemoveRastersFromMosaicDataset example 1 (Python window)

This is a Python sample for the RemoveRastersFromMosaicDataset function.

import arcpy
arcpy.RemoveRastersFromMosaicDataset_management(
     "C:/Workspace/remove.gdb/md", "YEAR<1999", "UPDATE_BOUNDARY", 
     "MARK_OVERVIEW_ITEMS",  "#", "#", "#", "#")
RemoveRastersFromMosaicDataset example 2 (stand-alone script)

This is a Python script sample for the RemoveRastersFromMosaicDataset function.

#Delete Overviews with Query

import arcpy
arcpy.env.workspace = "C:/Workspace"

mdname = "remove.gdb/md2"
query = "#"
updatebnd = "#"
markovr = "#"
delovr = "DELETE_OVERVIEW_IMAGES"
delitemcache = "#"
removeitem = "NO_REMOVE_MOSAICDATASET_ITEMS"
updatecs = "UPDATE_CELL_SIZES"

arcpy.RemoveRastersFromMosaicDataset_management(
     mdname, query, updatebnd, markovr, delovr, delitemcache, 
     removeitem, updatecs)