Synchronize Mosaic Dataset (Data Management)
Summary
Rebuilds the raster item and updates affected fields in the mosaic dataset using the raster type and options that were used when it was originally added.
Usage
-
This tool rebuilds selected items in the mosaic dataset using a corresponding data source. Since selected items are reconstructed, any modifications made to these items since the last time they were built would be lost.
This tool is particularly useful for keeping mosaic datasets up-to-date. You can use this tool to detect and add new raster dataset that have been added to folder locations from where data in the mosaic dataset was added. Mosaic dataset that are populated using tables that reside in an externally managed database can also be updated with this tool.
This tool can also build pyramids, calculate statistics, and create thumbnails for all raster datasets referenced by the mosaic dataset.
Database fragmentation and frequent data manipulation may increase the size of your mosaic dataset exponentially. If your database size is inflated due to constant transactions, you should run the Compact tool.
Syntax
Parameter | Explanation | Data Type |
in_mosaic_dataset |
The path and name of the mosaic dataset. | Mosaic Layer |
where_clause (Optional) |
Using SQL, you can define a query or use the Query Builder to build a query. | SQL Expression |
new_items (Optional) | Choose whether to synchronize your mosaic dataset with newly added items. If you choose to use this option, the item's workspace will be searched for new images. When an image is added to the mosaic dataset, it will use the same raster type as the other items within the same workspace. If you choose to update with the new items, then you can choose whether to Update Cell Size Ranges, Update Boundary, or Update Overview parameters.
| Boolean |
sync_only_stale (Optional) |
If the base rasters used to create a derived raster, such as an overview, have been synchronized, then the overview will be updated.
| Boolean |
update_cellsize_ranges (Optional) | Choose whether to update the cell size ranges. This parameter is only available if new_items has been set to UPDATE_WITH_NEW_ITEMS.
| Boolean |
update_boundary (Optional) | Choose whether to update the boundary. This parameter is only available if new_items has been set to UPDATE_WITH_NEW_ITEMS.
| Boolean |
update_overviews (Optional) | Choose whether to update the cell size ranges. This parameter is only available if new_items has been set to UPDATE_WITH_NEW_ITEMS.
| Boolean |
build_overviews (Optional) |
Overviews are low-resolution raster datasets created to improve the display speed when viewing a mosaic dataset. Generally, they are created to cover the extent of the raster data in the mosaic dataset. They are similar to raster pyramids. Overviews may need to be rebuilt if the underlying rasters are modified.
| Boolean |
build_pyramids (Optional) |
Pyramids can be built for each raster item in the mosaic dataset. Pyramids can improve the speed at which each raster is displayed.
| Boolean |
calculate_statistics (Optional) |
Statistics can be calculated for each raster item in the mosaic dataset. Statistics are required for your mosaic dataset when performing certain tasks, such as applying a contrast stretch.
| Boolean |
build_thumbnails (Optional) |
Thumbnails are small, highly resampled images that can be created for each raster item in the mosaic definition. Thumbnails can be accessed when the mosaic dataset is accessed as an image service and will display as part of the metadata (Item Description).
| Boolean |
Code Sample
This is a Python sample for SynchronizeMosaicDataset.
import arcpy arcpy.SynchronizeMosaicDataset_management("c:/workspace/fgdb.gdb/sync", \ "Year>1999", "UPDATE_WITH_NEW_ITEMS", \ "SYNC_STALE","#", "#", \ "UPDATE_OVERVIEWS", "#", "#", \ "BUILD_THUMBNAILS")
This is a Python script sample for SynchronizeMosaicDataset.
##=========================== ##Synchronize Mosaic Dataset ##Usage: SynchronizeMosaicDataset_management in_mosaic_dataset {where_clause} ## {NO_NEW_ITEMS | UPDATE_WITH_NEW_ITEMS} ## {SYNC_STALE | SYNC_ALL} {UPDATE_CELL_SIZES ## | NO_CELL_SIZES} {UPDATE_BOUNDARY | NO_BOUNDARY} ## {NO_OVERVIEWS | UPDATE_OVERVIEWS} {NO_PYRAMIDS ## | BUILD_PYRAMIDS} {NO_STATISTICS | ## CALCULATE_STATISTICS} {NO_THUMBNAILS ## | BUILD_THUMBNAILS} try: import arcpy arcpy.env.workspace = r"C:/Workspace" # Synchronize data item after Year 1999 arcpy.SynchronizeMosaicDataset_management("Sync.gdb/md", "Year>1999", \ "UPDATE_WITH_NEW_ITEMS", "SYNC_STALE",\ "#", "#", "UPDATE_OVERVIEWS", "#", "#", "BUILD_THUMBNAILS") except: print "Synchronize Mosaic Dataset example failed." print arcpy.GetMessages()