USGS MP Metadata Translator (Conversion)
Summary
Uses the USGS metadata parser utility, known as mp, to export or validate FGDC metadata content. The mp utility is created and maintained by the USGS for managing metadata that follows the FGDC Content Standard for Digital Geospatial Metadata (CSDGM). A version of mp is provided with ArcGIS.
This tool only uses metadata elements in an item's metadata or a stand-alone metadata XML file that follow the FGDC CSDGM metadata format. FGDC content may exist in an ArcGIS item's metadata. For example, if the metadata was created in ArcGIS Desktop 9.3.1 or earlier using the FGDC metadata editor or created in the current version of ArcGIS Desktop using the FGDC metadata editor add-in, the item's metadata will include elements that follow the FGDC XML format. This tool only exports these FGDC XML metadata elements—the information displayed in the FGDC Metadata (read-only) section in the Description tab if you are using a metadata style that provides access to an item's complete metadata.
If an item's metadata only contains information edited in the Description tab it won't contain any XML elements that can be exported using this tool. After selecting the FGDC CSDGM Metadata style you can export ArcGIS metadata to the FGDC XML format. Use this tool with the exported FGDC XML file to generate the HTML, text, and SGML files that are commonly associated with FGDC metadata.
Usage
-
Documentation for the mp utility can be found on the USGS metadata tools Web site.
-
FGDC metadata elements, if they exist in ArcGIS metadata, will not be in the correct order as specified by the FGDC CSDGM rules. If the mp utility is used independently to validate or export ArcGIS metadata, mp will record warnings in the log file indicating the elements are out of order. This tool internally processes ArcGIS metadata using the _MPXML2.xsl stylesheet in the <ArcGIS Installation Location>\Metadata\Stylesheets folder to select only FGDC metadata elements and order them correctly before using mp to export or validate the resulting XML file.
-
When using the tool dialog, the default Output File name will have a file extension that is appropriate for the conversion type that is selected at the time that the source metadata is defined. If you change the conversion type after specifying the source, delete the default output file name and a new file name will be generated with an appropriate file extension. Or, you can change the output file extension manually.
-
For all conversion types, the source metadata will be validated according to the FGDC CSDGM rules and any warnings or errors regarding the metadata content will be reported in the tool's messages. If a Log File is specified, the same warnings or errors will be saved to the specified file. If the "none" conversion is specified, only the Log File will be created. A conversion won't be performed and an output file won't be generated.
-
The output files produced by this tool can't be stored in a geodatabase. If the Current_workspace environment is set to a geodatabase, the output files will be stored in a different location, as described below.
- If Current_workspace is set to a file or personal geodatabase, the output files will be stored in the folder in which the geodatabase is stored.
- If Current_workspace is set to an enterprise or workgroup geodatabase, the output files will be stored in the location defined by the system TEMP environment variable.
-
The Source Metadata parameter has a complex data type. If you use this tool in a model, create a variable for the Source Metadata parameter in ModelBuilder by right-clicking the tool and choosing Make Variable > From Parameter > Source Metadata.
Syntax
Parameter | Explanation | Data Type |
source |
The item whose metadata will be converted or a stand-alone XML file that will be converted. | Data Element; Layer |
config (Optional) |
A file that defines custom parameters that mp will consider when processing the metadata. To export metadata without using a configuration file, provide # instead of a file name. | File |
conversion (Optional) |
The type of conversion that will take place.
By default, the "XML" conversion will be performed. | String |
output (Optional) |
A file that will be created containing the converted metadata. The type of file created is defined by the conversion type. To check for problems in the FGDC metadata using mp and not produce a output file, provide the pound sign (#) instead of a file name. | File |
errors (Optional) |
A text file that will be created listing the warnings and errors that occurred during the conversion process. To export metadata without producing a log file, provide the pound sign (#) instead of a file name. | File |
Code Sample
Exports information in an ArcGIS item's metadata that is formatted according to the FGDC CSDGM standard to an HTML file.
import arcpy from arcpy import env env.workspace = "C:/data" arcpy.USGSMPTranslator_conversion("yellowstone.mxd", "#", "HTML", "yellowstone_map.html", "yellowstone_map.log")