Select to view content in your preferred language

Calling Arc Hydro Tools in Python in ArcGIS Pro?

6039
20
03-02-2018 02:51 PM
Labels (1)
JohnGaiot
Occasional Contributor

Hello,

I am testing some python scripts created originally in ArcGIS 10.3.1/10.5.1 which utilize the ArcHydroTools module. I have installed the latest Arc Hydro package in ArcGIS Pro, but it still doesn't recognize this module. I get the following error when trying to import the module:

" ModuleNotFoundError: No module named 'ArcHydroTools' "

Is this functionality not yet available? Or should I be doing something else?

I tried scouring the documentation but it all relates to ArcGIS desktop not Pro. Not that I could find anyway!

Thanks in advance,

John

0 Kudos
20 Replies
ChristineDartiguenave
Esri Contributor

import archydro

oProcessor = archydro.streamdefinition.StreamDefinition()
oProcessor.bCallFromPYT = False
params = (flow_accum, int(stream_threshold),os.path.join(grid_location, "str"))
str_defres = oProcessor.execute(params, None)
if str_defres and str_defres[0] == apwrutils.C_OK:
str_def = str_defres[1]
else:
arcpy.AddError("Stream definition operation failed.")
return(apwrutils.C_NOTOK,)

0 Kudos