Remove Rasters From Mosaic Dataset (Data Management)

Summary

Removes selected raster datasets from a mosaic dataset.

Usage

  • There must be a selection or a query specified; otherwise, the tool will not run. If you want to delete all the records from the mosaic dataset, specify a query that would select all the rasters, such as "OBJECTID>=0".

  • You have the option to remove overviews but not to delete them. If the overviews are generated within the mosaic dataset, they will be deleted when they are removed, because they are managed by the mosaic dataset. If you have created the overviews in a folder, or nondefault location, they are not fully managed by the mosaic dataset; therefore, you can remove them but not delete them from disk. You may not want to delete overviews if you are using them elsewhere.

  • If you choose to mark the affected overviews but 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 dramatically increase the size of a mosaic dataset. If your database size is inflated due to constant transactions, run the Compact tool.

Parameters

LabelExplanationData Type
Mosaic Dataset

The mosaic dataset containing the rasters you want to remove

Mosaic Layer
Query Definition
(Optional)

An SQL expression to select the raster datasets that you want removed from the mosaic dataset.

There must be a selection or a query specified; otherwise, the tool will not run. If you want to delete all the records from the mosaic dataset, specify a query that would select all the rasters, such as "OBJECTID>=0".

SQL Expression
Update Boundary
(Optional)

Updates the boundary polygon of a mosaic dataset. By default, the boundary merges all the footprint polygons to create a single boundary representing the extent of the valid pixels.

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

When the rasters in a mosaic catalog have been removed, any overviews created using those rasters may no longer be accurate; therefore, they can be identified 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)

Remove overviews associated with the selected rasters.

  • Checked—Delete overviews associated with the selected rasters. This is the default.
  • Unchecked—Do not delete the overviews associated with the selected rasters.
Boolean
Delete Item Cache
(Optional)

Remove cache that is based on any source raster datasets that you are removing from the mosaic dataset.

  • Checked—Remove the item and its corresponding cache. This is the default.
  • Unchecked—Keep the cache as part of the mosaic dataset.
Boolean
Remove Mosaic Dataset Items
(Optional)

Remove item, cache, overviews, and raster datasets. Or, remove only the cache and overviews, and keep the raster datasets.

  • Checked—Remove the item from the mosaic dataset. This is the default.
  • Unchecked—Remove the item cache and any associated overviews, but not the item itself.
Boolean
Update Cell Size Ranges
(Optional)

Update cell size ranges for the mosaic dataset. Choose this option if you are removing all of the imagery at a specific cell size.

  • Checked—Update the cell size ranges. This is the default.
  • Unchecked—Do not update the cell size ranges.
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 you want to remove

Mosaic Layer
where_clause
(Optional)

An SQL expression to select the raster datasets that you want removed from the mosaic dataset.

There must be a selection or a query specified; otherwise, the tool will not run. If you want to delete all the records from the mosaic dataset, specify a query that would select all the rasters, such as "OBJECTID>=0".

SQL Expression
update_boundary
(Optional)

Updates the boundary polygon of a mosaic dataset. By default, the boundary merges all the footprint polygons to create a single boundary representing the extent of the valid pixels.

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

When the rasters in a mosaic catalog have been removed, any overviews created using those rasters may no longer be accurate; therefore, they can be identified 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)

Remove overviews associated with the selected rasters.

  • DELETE_OVERVIEW_IMAGESDelete overviews associated with the slected rasters. This is the default.
  • NO_DELETE_OVERVIEW_IMAGES Remove overviews associated with the selected rasters.
Boolean
delete_item_cache
(Optional)

Remove cache that is based on any source raster datasets that you are removing from the mosaic dataset.

  • DELETE_ITEM_CACHERemove the item and its corresponding cache. This is the default.
  • NO_DELETE_ITEM_CACHEKeep the cache as part of the mosaic dataset.
Boolean
remove_items
(Optional)

Remove item, cache, overviews, and raster datasets. Or, remove only the cache and overviews, and keep the raster datasets.

  • REMOVE_MOSAICDATASET_ITEMSRemove the item from the mosaic dataset. This is the default.
  • NO_REMOVE_MOSAICDATASET_ITEMSRemove the item cache and any associated overviews, but not the item itself.
Boolean
update_cellsize_ranges
(Optional)

Update cell size ranges for the mosaic dataset. Choose this option if you are removing all of the imagery at a specific cell size.

  • UPDATE_CELL_SIZESUpdate the cell size ranges. This is the default.
  • NO_CELL_SIZESDo not update the cell size ranges.
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 RemoveRastersFromMosaicDataset.

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 RemoveRastersFromMosaicDataset.

#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)

Environments

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics