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)