So I developed a script that traverses through a root directory, and any subdirectories and catalogs layers files. Then exports these layer files' FGDC metadata and outputs them to a folder. The code at this point is hit/miss sometimes completes and sometimes processes "most" of the input and errors out close to being done.
Can anyone point out what's going on here? Error code is:
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\conversion.py", line 624, in ExportMetadata raise e
ExecuteError: ERROR 000582: Error occurred during execution.
import arcpy,os
arcpy.env.overwriteOutput=True
metadataout=r'C:\tmp\out'
for dirpath,dirnames,filenames in arcpy.da.Walk(r'C:\folder\files',datatype="Layer"):
for filename in filenames:
print filename
translator = r'C:\Program Files (x86)\ArcGIS\Desktop10.2\Metadata\Translator\ARCGIS2FGDC.xml'
arcpy.ExportMetadata_conversion(os.path.join(dirpath,filename),translator,os.path.join(metadataout,str(filename).split(".")[0]+'.xml'))
1 Answer 1
The python code for the ESRI Metadata Translator instead of the export command seemed to solve the issue.
-
Somehow this answer automatically got downvoted by the "Community" bot because it is so short. I apologize for that.whuber– whuber2015年04月24日 18:27:43 +00:00Commented Apr 24, 2015 at 18:27