1

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'))  
0

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 Apr 24 '15 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.