I would like to get a pair of scripts/tools to update all the "Description" and "Credits" in the layer properties of each layer in an ArcMap MXD from the corresponding values in the source data's metadata fields. These values are inherited from the source only when the data is added to the ArcMap project, with no ongoing connection. As metadata is updated, the old or missing values in the MXD are not updated.
Since the metadata for the layers on the published map service for web maps come from the MXD, not from the data layers themselves, it is essential that the current metadata be written to the MXD before publishing. Currently this must be done manually, which is a prohibitively time consuming process. Since there are potentially many layers in an MXD, it would be useful to have a script tool that would update metadata on all layers at once.
In some cases, there may be values for these fields that are intentionally different in the MXD than on the source data's metadata, so the script should provide for identifying layers to be excluded from the process.
Consequently there should be two scripts/tools. One to create matrix of the values for each layer in both the MXD and layer metadata, the second would do the updates.
The specifications for the first script are as follows:
The file created above could be used to preview the results of the update script, including potential discovery of unintended overwriting of better metadata. Such layers could be excluded from the update in the following script.
The specifications for the second script are as follows:
The complications to this script would be that the layer's source data could be in several formats, all of which store metadata differently. The easiest would be shapefiles and images, where it would simply parse the xml file for these values, but to be complete, it would also need to be able to extract them from a file geodatabase, a personal geodatabase, and an SDE layer. Metadata could also simply be missing. It would also need to navigate the structure of grouped layers, updating the properties of the sublayers that actually point to a data source, and leaving the group layer's properties alone.
If the "exclude list" makes this too complicated, it could be omitted. Though it would be a nice thing to have, its use would be rare enough that I'd hate to have that feature discourage development of the basic functionality.
Though I want this for ArcMap, where I work now, it would be useful to have it for Pro as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.