Remove Rasters From Mosaic Dataset (Data Management)
Summary
Removes selected rasters (items) 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.
This tool will not recalculate the extent of the mosaic dataset. To recalculate the extent, you will need to recalculate the feature extent within the Mosaic Dataset Properties window.
Database fragmentation and frequent data manipulation may increase the size of your mosaic dataset dramatically. If your database size is inflated due to constant transactions, you should run the Compact tool.
Syntax
Parameter | Explanation | Data Type |
in_mosaic_dataset |
Path and name of mosaic dataset. | Mosaic Layer |
where_clause (Optional) |
Using SQL you can define a query, or use the Query Builder to build a query to define the raster datasets that will be 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.
| 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.
| Boolean |
delete_overview_images (Optional) |
Any overviews that are no longer required as a result of the source rasters being removed can also be removed from the mosaic dataset. The overviews are removed only when the overview items are selected.
| Boolean |
delete_item_cache (Optional) | Choose whether to delete the cache that is associated with any of the mosaic dataset items that you are removing.
| Boolean |
remove_items (Optional) | Choose whether to delete the item from the mosaic dataset, such as a raster dataset, or only delete the associated overviews or cache.
| Boolean |
update_cellsize_ranges (Optional) | Choose whether to update the cell size ranges for the mosaic dataset.
| Boolean |
Code Sample
This is a Python sample for RemoveRastersFromMosaicDataset.
import arcpy
arcpy.RemoveRastersFromMosaicDataset_management(
"C:/Workspace/remove.gdb/md", "YEAR<1999", "UPDATE_BOUNDARY",
"MARK_OVERVIEW_ITEMS", "#", "#", "#", "#")
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)