Synchronize Mosaic Dataset (Data Management)

Summary

Synchronizes a mosaic dataset to keep it up to date. In addition to syncing data, you can update overviews if the underlying imagery has been changed, generate new overviews and cache, and restore the original configuration of mosaic dataset items. You can also remove paths to source data with this tool. To repair paths, use the Repair Mosaic Dataset Paths tool.

Synchronization is a one-way operation: changes in the source data can be synchronized to the mosaic dataset’s attribute table, thereby updating the mosaic dataset's attribute table. Changes in the mosaic dataset's attribute table will not affect the source data.

Caution:

Changes made by synchronization cannot be undone. Create a backup of your mosaic dataset if you've made modifications to the data that you don't want overwritten.

Usage

  • You can use a selection set with this tool to limit the raster items that are updated. When there is a selection or query, only those items will be processed.

  • Synchronization can add new items, update existing items, or remove items.

  • Stale items refer to source rasters that have been changed since the mosaic dataset was created or the last time the mosaic dataset was synchronized. For instance, the georeferencing may have been updated or the pyramids may have been built.

  • Since the raster items will be reconstructed, any modifications made to them since the last time they were built will be lost, such as editing functions or content in the attribute table.

  • If you remove items that have broken data sources, ensure that all network connections are working properly. This tool will remove any items that cannot be accessed.

  • This tool can also build pyramids and calculate statistics on the source rasters as well as create thumbnails and raster cache for the raster items.

  • This tool is particularly useful for keeping mosaic datasets up to date. If new raster datasets have been added to the workspaces that this mosaic dataset accesses, the new raster datasets can be added to the mosaic dataset. Mosaic datasets that are populated using tables that reside in an externally managed database can also be updated with this tool.

  • To use the Refresh Aggregate Information parameter, uncheck the Update Existing Items parameter. For multidimensional mosaic datasets, the Refresh Aggregate Information parameter refreshes the multidimensional properties of the mosaic based on the content of the attribute table of the mosaic dataset.

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

Parameters

LabelExplanationData Type
Mosaic Dataset

The mosaic dataset that will be synchronized.

Mosaic Layer
Query Definition
(Optional)

An SQL expression to select which mosaic dataset items will be synchronized. If an expression is not provided, all dataset items will be updated.

SQL Expression
Update With New Items
(Optional)

Specifies whether new items will be included when synchronizing as well as the options to use under the Update With New Items Options submenu. If you use this option, the item's workspace will be searched for new data. When data is added to the mosaic dataset, it will use the same raster type as the other items in the same workspace.

  • Unchecked—No new items will be added when synchronizing. This is the default.
  • Checked—The mosaic dataset will be updated with new items in the workspaces. Optionally, the existing items can be modified by unchecking the Skip Existing Items parameter.
Boolean
Synchronize Stale Items Only
(Optional)

Specifies whether mosaic dataset items will be updated only when the underlying raster datasets have been modified due to synchronizing. For example, building pyramids or updating the georeferencing of rasters will affect how the overviews are rendered.

  • Checked—Only the items of the underlying raster datasets that have been modified will be updated. This is the default.
  • Unchecked—All of the items in the mosaic dataset will be updated.
Boolean
Update Cell Size Ranges
(Optional)

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

  • Checked—The cell size ranges for the entire mosaic dataset will be recalculated, but only for items that have an invalid visibility. This is the default.
  • Unchecked—No cell size ranges will be recalculated.
Boolean
Update Boundary
(Optional)

Specifies whether the boundary that shows the full extent of the mosaic dataset will be rebuilt. Check this parameter if syncing will change the extent of the mosaic dataset.

  • Checked—The boundary will be rebuilt after the mosaic dataset is synchronized. This is the default.
  • Unchecked—The boundary will not be rebuilt.
Boolean
Update Overviews
(Optional)

Specifies whether obsolete overviews will be updated. The overview becomes obsolete if any underlying rasters have been modified due to synchronizing.

  • Unchecked—The overviews will not be updated. This is the default.
  • Checked—The affected overviews will be updated after the mosaic dataset is synchronized.
Boolean
Build Raster Pyramids
(Optional)

Specifies whether pyramids will be built for the specified mosaic dataset items. Pyramids can be built for each raster item in the mosaic dataset. Pyramids can improve the speed at which each raster is displayed.

  • Unchecked—Pyramids will not be built. This is the default.
  • Checked—Pyramids will be built for all the mosaic raster items that were updated due to synchronization.

Pyramids will not be built for items that were added due to synchronization.

Boolean
Calculate Statistics
(Optional)

Specifies whether statistics will be calculated for the specified mosaic dataset items. Statistics are required for a mosaic dataset when performing certain tasks, such as applying a contrast stretch.

  • Unchecked—Statistics will not be calculated. This is the default.
  • Checked—Statistics will be calculated for the mosaic dataset items that were updated due to synchronization.

Statistics will not be calculated for items that were added due to synchronization.

Boolean
Build Thumbnails
(Optional)

Specifies whether thumbnails will be built for the specified mosaic dataset items. 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 item description.

  • Unchecked—Thumbnails will not be built or updated. This is the default.
  • Checked—Thumbnails will be built or updated for all the raster items that were updated due to synchronization.

Thumbnails will not be built for items that were added due to synchronization.

Boolean
Build Item Cache
(Optional)

Choose whether to build a cache for the specified mosaic dataset items. A cache can be built when you've added data using the LAS, Terrain, or LAS dataset raster types.

  • Unchecked—A cache will not be built or updated. This is the default.
  • Checked—A cache will be built or updated for all the raster items specified.

A cache will not be built for items that were added due to synchronization.

Boolean
Rebuild Raster From Data Source
(Optional)

Specifies whether the raster items will be rebuilt from the data source using the original raster type.

  • Checked—The rasters will be rebuilt from the source data. Any changes that you have performed on the mosaic dataset will be lost. This is the default.
  • Unchecked—The rasters will not be rebuilt. Other primary fields will be reset if the Update Fields parameter is checked.

This only affects items that will be synchronized. This parameter is not applicable if the Update With New Items parameter is checked.

Boolean
Update Fields
(Optional)

Specifies whether the fields in the table will be updated. This only affects items that will be synchronized.

  • Checked—The fields will be updated from the source files. This is the default.
  • Unchecked—The fields in the table will not be updated from the source.

If you update the fields, you can control which fields are updated using the Fields To Update parameter. If you made edits to some of the fields, you can deselect them using the Fields To Update parameter.

Boolean
Fields To Update
(Optional)

The fields that will be updated.

This parameter is only valid if the Update Fields parameter is checked.

If you made edits to some of the fields, you can deselect them.

The RASTER field can be refreshed, even if the Rebuild Raster From Data Source parameter is unchecked. However, if Rebuild Raster From Data Source is checked, the RASTER field will be rebuilt, even if the Fields To Update parameter is unchecked.

String
Update Existing Items
(Optional)

Specifies whether existing items in the mosaic dataset will be updated. If you check this parameter, you must specify the options to update under the Update Existing Items Options submenu.

  • Checked—The existing items will be updated with the options you chose to update. This is the default.
  • Unchecked—The existing items will not be updated.
Boolean
Remove Items With Broken Data Source
(Optional)

Specifies whether items with broken links will be removed.

Ensure that all network connections are working properly. This tool will remove any items that cannot be accessed.

  • Unchecked—Items with broken links will not be removed from the mosaic dataset. This is the default.
  • Checked—Items with broken links will be removed from the mosaic dataset.
Boolean
Skip Existing Items
(Optional)

Specifies whether existing mosaic dataset items will be skipped or updated with the modified files from disk. To use this parameter, the Update With New Items parameter must be checked.

  • Checked—While adding new mosaic dataset items, existing mosaic dataset items will be skipped; they will not be updated. This is the default.
  • Unchecked—While adding new mosaic dataset items, existing mosaic dataset items that correspond to modified files on disk will be updated.
Boolean
Refresh Aggregate Information
(Optional)

Specifies whether data that may have been removed from the mosaic dataset will be included. To use this parameter, the Update Existing Items parameter must be unchecked.

  • Unchecked—When synchronizing, rasters that may have been removed from the mosaic dataset will be excluded. This is the default.
  • Checked—When synchronizing, rasters that may have been removed from the mosaic dataset will be included.
Boolean
Estimate Mosaic Dataset Statistics

Specifies whether statistics on the mosaic dataset will be estimated.

  • Unchecked—When synchronizing, statistics on the mosaic dataset will not be estimated. This is the default.
  • Checked—When synchronizing, statistics on the mosaic dataset will be estimated.
Boolean

Derived Output

LabelExplanationData Type
Updated Mosaic Dataset

The updated mosaic dataset.

Mosaic Layer

arcpy.management.SynchronizeMosaicDataset(in_mosaic_dataset, {where_clause}, {new_items}, {sync_only_stale}, {update_cellsize_ranges}, {update_boundary}, {update_overviews}, {build_pyramids}, {calculate_statistics}, {build_thumbnails}, {build_item_cache}, {rebuild_raster}, {update_fields}, {fields_to_update}, {existing_items}, {broken_items}, {skip_existing_items}, {refresh_aggregate_info}, estimate_statistics)
NameExplanationData Type
in_mosaic_dataset

The mosaic dataset that will be synchronized.

Mosaic Layer
where_clause
(Optional)

An SQL expression to select which mosaic dataset items will be synchronized. If an expression is not provided, all dataset items will be updated.

SQL Expression
new_items
(Optional)

Specifies whether new items will be included when synchronizing as well as the options to use to update the new items.

If you use this option, the item's workspace will be searched for new data. When data is added to the mosaic dataset, it will use the same raster type as the other items in the same workspace.

  • NO_NEW_ITEMSNo new items will be added when synchronizing. This is the default.
  • UPDATE_WITH_NEW_ITEMSThe mosaic dataset will be updated with new items in the workspaces. Optionally, the existing items can be modified by setting the skip_existing_items parameter to OVERWRITE_EXISTING_ITEMS.
Boolean
sync_only_stale
(Optional)

Specifies whether mosaic dataset items will be updated only when the underlying raster datasets have been modified due to synchronizing. For example, building pyramids or updating the georeferencing of rasters will affect how the overviews are rendered.

  • SYNC_STALEOnly the items of the underlying raster datasets that have been modified will be updated. This is the default.
  • SYNC_ALLAll of the items in the mosaic dataset will be updated.
Boolean
update_cellsize_ranges
(Optional)

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

  • UPDATE_CELL_SIZESThe cell size ranges for the entire mosaic dataset will be recalculated, but only for items that have an invalid visibility. This is the default.
  • NO_CELL_SIZESNo cell size ranges will be recalculated.
Boolean
update_boundary
(Optional)

Specifies whether the boundary that shows the full extent of the mosaic dataset will be rebuilt. Choose UPDATE_BOUNDARY if syncing will change the extent of the mosaic dataset.

  • UPDATE_BOUNDARY The boundary will be rebuilt after the mosaic dataset is synchronized. This is the default.
  • NO_BOUNDARY The boundary will not be rebuilt.
Boolean
update_overviews
(Optional)

Specifies whether obsolete overviews will be updated. The overview becomes obsolete if any underlying rasters have been modified due to synchronizing.

  • NO_OVERVIEWS The overviews will not be updated. This is the default.
  • UPDATE_OVERVIEWS The affected overviews will be updated after the mosaic dataset is synchronized.
Boolean
build_pyramids
(Optional)

Specifies whether pyramids will be built for the specified mosaic dataset items. Pyramids can be built for each raster item in the mosaic dataset. Pyramids can improve the speed at which each raster is displayed.

  • NO_PYRAMIDSPyramids will not be built. This is the default.
  • BUILD_PYRAMIDS Pyramids will be built for all the mosaic raster items that were updated due to synchronization.

Pyramids will not be built for items that were added due to synchronization.

Boolean
calculate_statistics
(Optional)

Specifies whether statistics will be calculated for the specified mosaic dataset items. Statistics are required for a mosaic dataset when performing certain tasks, such as applying a contrast stretch.

  • NO_STATISTICSStatistics will not be calculated. This is the default.
  • CALCULATE_STATISTICS Statistics will be calculated for the mosaic dataset items that were updated due to synchronization.

Statistics will not be calculated for items that were added due to synchronization.

Boolean
build_thumbnails
(Optional)

Specifies whether thumbnails will be built for the specified mosaic dataset items. 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 item description.

  • NO_THUMBNAILSThumbnails will not be built or updated. This is the default.
  • BUILD_THUMBNAILSThumbnails will be built or updated for all the raster items that were updated due to synchronization.

Thumbnails will not be built for items that were added due to synchronization.

Boolean
build_item_cache
(Optional)

Choose whether to build a cache for the specified mosaic dataset items. A cache can be built when you've added data using the LAS, Terrain, or LAS dataset raster types.

  • NO_ITEM_CACHEA cache will not be built or updated. This is the default.
  • BUILD_ITEM_CACHEA cache will be built or updated for all the raster items that were updated due to synchronization.

A cache will not be built for items that were added due to synchronization.

Boolean
rebuild_raster
(Optional)

Specifies whether the raster items will be rebuilt from the data source using the original raster type.

  • REBUILD_RASTERThe rasters will be rebuilt from the source data. Any changes that you have performed on selected items in the mosaic dataset will be lost. This is the default.
  • NO_RASTERThe rasters will not be rebuilt. Other primary fields will be reset if the update_fields parameter is set to UPDATE_FIELDS.

This only affects items that will be synchronized. This parameter is not applicable if the new_items parameter is set to UPDATE_WITH_NEW_ITEMS.

Boolean
update_fields
(Optional)

Specifies whether the fields in the table will be updated. This only affects items that will be synchronized.

  • UPDATE_FIELDSThe fields will be updated from the source files. This is the default.
  • NO_FIELDSThe fields in the table will not be updated from the source.

If you update the fields, you can control which fields are updated using the fields_to_update parameter. If you made edits to some of the fields, you can remove them using the fields_to_update parameter.

Boolean
fields_to_update
[field_to_update,...]
(Optional)

The fields that will be updated.

This parameter is only valid if the update_fields parameter is set to UPDATE_FIELDS.

If you made edits to some of the fields, make sure they are not listed.

The RASTER field can be refreshed, even if REBUILD_RASTER is not specified. However, if REBUILD_RASTER is specified, the RASTER field will be rebuilt, even if the fields_to_update parameter value is not specified.

String
existing_items
(Optional)

Specifies whether existing items in the mosaic dataset will be updated.

If you use this parameter, choose which existing parameters to update: sync_only_stale, build_pyramids, calculate_statistics, build_thumbnails, build_item_cache, update_fields, or fields_to_update.

  • UPDATE_EXISTING_ITEMSThe existing items will be updated with the parameters you chose to update. This is the default.
  • IGNORE_EXISTING_ITEMSThe existing items will not be updated.
Boolean
broken_items
(Optional)

Specifies whether items with broken links will be removed.

Ensure that all network connections are working properly. This tool will remove any items that cannot be accessed.

  • IGNORE_BROKEN_ITEMSItems with broken links will not be removed from the mosaic dataset. This is the default.
  • REMOVE_BROKEN_ITEMSItems with broken links will be removed from the mosaic dataset.
Boolean
skip_existing_items
(Optional)

Specifies whether existing mosaic dataset items will be skipped or updated with the modified files from disk. To use this parameter, the new_items parameter must be set to UPDATE_WITH_NEW_ITEMS.

  • SKIP_EXISTING_ITEMSWhile adding new mosaic dataset items, existing mosaic dataset items will be skipped; they will not be updated. This is the default.
  • OVERWRITE_EXISTING_ITEMSWhile adding new mosaic dataset items, existing mosaic dataset items that correspond to modified files on disk will be updated.
Boolean
refresh_aggregate_info
(Optional)

Specifies whether data that may have been removed from the mosaic dataset will be included. To use this parameter, the existing_items parameter must be set to IGNORE_EXISTING_ITEMS.

  • NO_REFRESH_INFOWhen synchronizing, rasters that may have been removed from the mosaic dataset will be excluded. This is the default.
  • REFRESH_INFOWhen synchronizing, rasters that may have been removed from the mosaic dataset will be included.
Boolean
estimate_statistics

Specifies whether statistics on the mosaic dataset will be estimated.

  • NO_STATISTICSWhen synchronizing, statistics on the mosaic dataset will not be estimated. This is the default.
  • ESTIMATE_STATISTICSWhen synchronizing, statistics on the mosaic dataset will be estimated.
Boolean

Derived Output

NameExplanationData Type
out_mosaic_dataset

The updated mosaic dataset.

Mosaic Layer

Code sample

SynchronizeMosaicDataset example 1 (Python window)

This is a Python sample for the SynchronizeMosaicDataset function.

import arcpy
arcpy.SynchronizeMosaicDataset_management(
    "c:/data/syncmd.gdb/md", "Year>1999", "NO_NEW_ITEMS", "SYNC_STALE",
    "#", "#", "#", "NO_PYRAMIDS", "NO_STATISTICS", "NO_THUMBNAILS", 
    "NO_ITEM_CACHE", "NO_RASTER", "NO_FIELDS", "#", "#")
SynchronizeMosaicDataset example 2 (stand-alone script)

This is a Python script sample for the SynchronizeMosaicDataset function.

# Synchronize source and add new data

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

mdname = "syncmd.gdb/mdnew"
query = "#"
updatenew = "UPDATE_WITH_NEW_ITEMS"
syncstale = "SYNC_STALE"
updatecs = "#"
updatebnd = "#"
updateovr = "#"
buildpy = "NO_PYRAMIDS"
calcstats = "NO_STATISTICS"
buildthumb = "NO_THUMBNAILS"
buildcache = "NO_ITEM_CACHE"
updateras = "NO_RASTER"
updatefield = "NO_FIELDS"
fields = "#"

arcpy.SynchronizeMosaicDataset_management(
    mdname, query, updatenew, syncstale, updatecs, updatebnd, 
    updateovr, buildpy, calcstats, buildthumb, buildcache,
    updateras, updatefield, fields)

Related topics