Summary
Imports metadata to the target item after converting the source item's metadata to ArcGIS metadata, if appropriate. The source and target may be ArcGIS items or stand-alone metadata XML files.
This tool processes the source metadata before importing it and updates the target metadata after. Any intrinsic properties of the source item that were added automatically to its metadata by ArcGIS are removed along with any unique identifiers before converting the information to the ArcGIS metadata format, if necessary. After the imported information is saved, the target item's metadata is automatically updated with its intrinsic properties.
This tool is useful for copying metadata from one item to another when you start creating its metadata; the imported metadata acts as a template. Using another metadata document as a template can save time if two items share some information such as legal restrictions or a description of the project for which they were created.
Usage
Metadata may include unique identifiers that help to manage documents in a metadata catalog. As a precaution, this tool removes any unique identifiers in the source metadata before importing it. This is the desired behavior if your intention is to copy common information from one item to another. If many items share the same identifier it is no longer unique, and problems can arise if the metadata is later published.
However, if you modify a source item's metadata using the XSLT Transformation tool, for example, to update contact information, and need to import the resulting XML file back to the source item, use Metadata Importer instead. In this case it is not appropriate to remove the source item's unique identifier or alter its content before importing the metadata.
After importing, the metadata is updated automatically to include the current properties of the target item. By default, the Enable automatic updates parameter is checked. With this option, the imported information will be modified to contain the actual properties of the item. Any properties not already recorded in the metadata will be added. This ensures the metadata will remain current as the item changes. For example, if the imported metadata included a title describing another item, that title will be replaced with the target item's name. You can edit the title later so it better describes the target item.
If you choose not to enable automatic updates, properties of the target item that aren't recorded in the metadata will still be added. However, the imported information will never be updated by ArcGIS. For example, if the imported metadata describes the item as having a specific number of features and this number changes later, this change won't be recorded in the metadata when automatic updates occur.
By default, metadata is updated automatically when you view it.
If you import items into a geodatabase using the ArcSDE administrative commands, the original item's metadata won't be imported. Import the original item's metadata into the new item with this tool.
This tool can import one source item to one target item. To import one source item to many target items or to import different source items to different target items, open the tool in batch mode and set the tool's parameters appropriately.
Text or HTML files containing metadata can't be imported using this tool. If you try to import a text file using this tool, it will look for any metadata that may exist describing the text file's data and import that. If a text file actually contains metadata content, that content must be reformatted to follow a metadata standard's XML format. Then, the metadata content contained within the XML file can be imported using this tool.
When using this tool in ModelBuilder, the Output Metadata parameter is derived from the Target Metadata parameter.
If you do not have write access to the ArcGIS item or its metadata or the stand-alone metadata XML file that you are trying to modify, this tool will complete successfully, but the item's original metadata will remain unchanged.
Syntax
arcpy.conversion.ImportMetadata(Source_Metadata, Import_Type, Target_Metadata, Enable_automatic_updates)
Parameter | Explanation | Data Type |
Source_Metadata | The item whose metadata will be imported or a stand-alone XML file that will be imported. If the source item is a stand-alone file, it must contain well-formed XML data. | Data Element; Layer |
Import_Type | The format of the metadata that will be imported.
By default, the FROM_ISO_19139 conversion will be performed. | String |
Target_Metadata | The item to which the metadata will be imported or a stand-alone XML file that will be replaced. | Data Element; Layer |
Enable_automatic_updates |
| Boolean |
Code sample
ImportMetadata example (Python window)
Imports the source data's FGDC metadata to a geodatabase item. The original metadata is converted to ArcGIS metadata. Some methods of importing data into a geodatabase handle the original item's metadata while others do not.
import arcpy
from arcpy import env
env.workspace = "c:/data/data.gdb"
arcpy.ImportMetadata_conversion ("c:/data/streams.shp","FROM_FGDC","streams")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes