Error importing Metadata

71 views
Skip to first unread message

John O'Donnell

unread,
Jan 31, 2023, 1:23:16 PM1/31/23
to ACPF Forum
Hi all,

So I've been hitting my head against a problem that has stopped me at step one. I have prepared my DEM and am trying to run the first steps and I am getting a weird error where the tool works but it fails when trying to import metadata.

I was worried that it was an issue with naming and have moved my files to a location directly on C Drive with no spaces in the name. I uninstalled and reinstalled ArcPro from 3.0.2 to 3.0.3 and still the same error. I reprojected the DEM and uninstalled an old version if python from my computer and still no change.

I hope someone here can help explain what I'm missing! Here's the full output from running the tool with the error code highlighted in red at the end.

a.  DEM: Pit Fill / Hole Punch
=====================
Parameters

Input DEM     DEM_0711000904
Output DEM     C:\ACPF\PDS_ACPF1\PDS_ACPF1.gdb\USGS_13_n40w09_P_proj_Resample
Input Maximum Fill Depth (Z-units)     .5
=====================
Messages

Start Time: Tuesday, January 31, 2023 12:02:47 PM
Hole-punching: DEM_0711000904
Find Pits...
Fill everything else...
Current maximum depth: 81.65434265136719
Punch holes...
Total holes punched: 8008677.0
Current maximum depth: 19.348129272460938
Punch holes...
Total holes punched: 8009835.0
Current maximum depth: 5.140251159667969
Punch holes...
Total holes punched: 8010544.0
Current maximum depth: 3.1234664916992188
Punch holes...
Total holes punched: 8010623.0
Current maximum depth: 0.9244232177734375
Punch holes...
Total holes punched: 8010630.0
Current maximum depth: 0.4998779296875
Saving Output...
C:\ACPF\PDS_ACPF1\PDS_ACPF1.gdb\USGS_13_n40w09_P_proj_Resample
updataing metadata...
Exception: Failed to import metadata from 's'.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\ACPF\ACPF_V4_Pro_Hub_01092023\Scripts\PitFillHolePunchP4.py", line 255, in <module>
    addMetadata(outDEM, paraDict)
  File "C:\ACPF\ACPF_V4_Pro_Hub_01092023\Scripts\PitFillHolePunchP4.py", line 69, in addMetadata
    tgt_item_md.importMetadata(src_file_path)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\utils.py", line 191, in fn_
    return fn(*args, **kw)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\metadata.py", line 127, in importMetadata
    return _convertArcObjectToPythonObject(arcgisscripting.metadata.Metadata.importMetadata(*_gp_fixargs((self, sourceUri, metadata_import_option, customStylesheetPath), True)))
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\arcobjectconversion.py", line 67, in convertArcObjectToPythonObject
    name=type(obj).__name__
SystemError: <class 'type'> returned a result with an error set

Failed script a.  DEM: Pit Fill / Hole Punch...
Failed to execute (PitFillHolePnch).
Failed at Tuesday, January 31, 2023 12:05:06 PM (Elapsed Time: 2 minutes 19 seconds)

Obrecht, Joshua D [IDRO]

unread,
Feb 2, 2023, 8:53:10 AM2/2/23
to ACPF Forum

John

 

I will be reaching out to you to try and resolve this issue.

 

cid:image001.png@01D80E45.AA84C5B0

Josh Obrecht

GIS Analyst

jobr...@iastate.edu  Iowa State University

National Hub for the Agricultural Conservation Planning Framework

https://acpf4watersheds.org/

 

cid:image002.png@01D80E45.AA84C5B0

--
The ACPF Forum is an online group for discussing technical issues related to using the ACPF tools. Anyone can view the discussions at https://groups.google.com/a/umn.edu/d/forum/acpf-group. Only members can participate in discussions. Join the group by sending an email to acpf-group...@umn.edu
---
You received this message because you are subscribed to the Google Groups "ACPF Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to acpf-group+...@umn.edu.
To view this discussion on the web visit https://groups.google.com/a/umn.edu/d/msgid/acpf-group/3c6de706-3319-412e-880f-8bc7a5ab5bb4n%40umn.edu.

John O'Donnell

unread,
Feb 2, 2023, 10:15:11 AM2/2/23
to ACPF Forum, jobr...@iastate.edu
Josh,

Thank you for reaching out! I look forward to getting some insight on the problem.

David James

unread,
Feb 2, 2023, 10:16:01 AM2/2/23
to John O'Donnell, ACPF Forum
Hi John
It appears that the problem is due to the non-ACPF database structure that you are using. Typically, the ACPF tools expect to see the naming conventions developed to support the standard HUC12-based data structure. Yours does not. I would suggest that you edit the scripts\PitFillHolePunchP4.py and comment out the very last line (255), which makes the call to import the metadata xml for this tool. I suspect that should resolve the issue. Alternatively, you could assemble a traditional ACPF fgdb, e.g.  acpf070801040203.gdb.

DAve JAmes

--
Reply all
Reply to author
Forward
0 new messages