I'm very new to ArcGIS, and GIS is general. I am trying to build a script that will extract metadata from orthoimagery .tifs. Below is my test code to see if I can get the metadata from one file. It is basically the code from ESRI's docs on arcpy and the metadata toolbox.
import arcpy from os import path from arcpy import env env.workspace = path.normpath("E:/RESOURCES/TEST_RESOURCES/Pasquotank/TIF/data") dir = arcpy.GetInstallInfo("desktop")["InstallDir"] translator = dir + path.normpath("Metadata/Translator/ESRI_ISO2ISO19139.xml") arcpy.ExportMetadata_conversion(path.normpath("E:/RESOURCES/TEST_RESOURCES/Pasquotank/TIF/data/OC6i0_37_000_20793902_20100411R1.tif"), translator)
When I run this is get the following error.
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000816: The tool is not valid. Failed to execute (ExportMetadata).
I've tried just using the file name as the first parameter in the ExportMetadata_conversion(), and got the same error.
When I run the tool from ArcCatalog, I get results. So, I'm stuck. I am using ArcGIS 10.0