Remove Rasters From Mosaic Dataset (Data Management)

Summary

Removes rasters from a mosaic dataset.

Usage

Syntax

RemoveRastersFromMosaicDataset_management (in_mosaic_dataset, {where_clause}, {update_boundary}, {mark_overviews_items}, {delete_overview_images})
ParameterExplanationData Type
in_mosaic_dataset

Path and name of mosaic dataset.

Mosaic Dataset; Mosaic Layer
where_clause
(Optional)

An SQL query that defines 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.

  • BUILD_BOUNDARYThe boundary will be updated. This is the default.
  • NO_BUILD_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_OVERVIEWSThe affected overviews will be identified. This is the default.
  • NO_MARK_OVERVIEWSThe affected overviews will not be identified.
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.

  • DELETE_OVERVIEW_IMAGESThe boundary will be updated. This is the default.
  • NO_DELETE_OVERVIEW_IMAGES The boundary will not be updated.
Boolean

Code Sample

RemoveRastersFromMosaicDataset example 1 (Python window)

This is a Python sample for RemoveRastersFromMosaicDataset.

import arcpy  
arcpy.RemoveRastersFromMosaicDataset_management("c:/workspace/fgdb.gdb/md2",
                                          "Category=2", "BUILD_BOUNDARY",
                                          "#", "#")
RemoveRastersFromMosaicDataset example 2 (stand-alone script)

This is a Python script sample for RemoveRastersFromMosaicDataset.

##===========================
##Remove Rasters From Mosaic Dataset
##Usage: RemoveRastersFromMosaicDataset_management in_mosaic_dataset {where_clause}
##                                                 {UPDATE_BOUNDARY | NO_BOUNDARY} 
##                                                 {MARK_OVERVIEW_ITEMS | NO_MARK_OVERVIEW_ITEMS}
##                                                 {DELETE_OVERVIEW_IMAGES | NO_DELETE_OVERVIEW_IMAGES}

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

    # Remove everything in the Mosaic Dataset
    arcpy.RemoveRastersFromMosaicDataset_management("Remove.gdb/md", "OBJECTID>=0", "#", "#",
                                                    "#")                                      
    
    # Delete Overviews with Query
    arcpy.RemoveRastersFromMosaicDataset_management("Remove.gdb/md2", "Category=2",
                                                    "UPDATE_BOUNDARY", "#", "#")
    
    # Delete Selected items along with Overviews
    arcpy.RemoveRastersFromMosaicDataset_management("Remove.gdb/md3", "OBJECTID<3",
                                                    "UPDATE_BOUNDARY", "MARK_OVERVIEW_ITEMS",
                                                    "DELETE_OVERVIEW_IMAGES")
    
except:
    print "Remove Rasters From Mosaic Dataset example failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: Yes
ArcInfo: Yes

10/27/2014