I am having issues with the OptimalPathAsLine tool in ArcPy as well as in ArcGIS Pro. My ArcPy workflow, which I run in a cloned environment in PyCharm Community Edition, takes point features and a cost surface as input and runs DistanceAccumulation and OptimalPathAsLine iteratively for the annual timesteps 2008 - 2023.
Issue 1: [SOLVED by bugfix in ArcGIS Pro v3.2.2]
It all worked well, until I decided to transform the scale of the cost surface input from a range of ~33.8 - ~930.2 to 1 - 100 using the Rescale by Function tool (linear function) (EDIT: Raster Calculator also tested with same result). After I had changed the cost surface input to my script, OptimalPathAsLine stopped working for two specific timesteps (two specific combinations of input rasters and destination features): It threw no error, but the calculation would never end and memory consumption kept increasing until I stopped the script.
The behaviour is reproducible by manually running the tool with the same inputs in ArcGIS Pro (EDIT: see screenshots). I did not find any difference between the old and new accumulated cost rasters (both showing 32 bit float as pixel type).
Issue 2: [SOLVED by avoiding int64 field type in the input feature class]
Then I updated ArcGIS Pro from 3.1 (or any 3.x, not sure) to 3.2 in an attempt to fix issue 1. Since then, OptimalPathAsLine in my script does not work anymore. It always throws the following error:
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 010778: Big Integer field type is currently not supported.
Failed to execute (OptimalPathAsLine).
I have no idea why I get this error message and to which data and field it refers to.
EDIT: I found out that issue 2 has nothing to do with the rasters, but is caused by the destination feature class: The destination field is a Big Integer. My script imports this feature class from a GeoPackage into a FileGDB using CopyFeatures_management. All integers in the GeoPackage are saved as int64. Since the update to ArcGIS Pro 3.2, these fields are, not surprisingly, imported as Big Integer. I am not sure why the script worked earlier - if CopyFeatures converted int64 to something supported by ArcGIS, or if the GeoPackage changed. Anyway, issue 2 is solved by saving int32 to the GeoPackage.