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.
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, pointing to Make Variable, pointing to From Parameter, and then clicking Source Metadata.
Syntax
arcpy.conversion.USGSMPTranslator(source, {config}, {conversion}, {output}, {errors})
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 # 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, use the pound sign (#) instead of a file name. | File |
Code sample
Export an ArcGIS item's existing FGDC metadata
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")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes