2

I am currently using ArcGIS ArcHydro tools to perform 'Catchment Polygon Processing'.

However, it is proving time consuming to perform this for multiple rasters. How might a write a python script to import ArcHydro tools?

1
  • 1
    Are you just looking for: arcpy.CatchmentPolyProcessing_archydro()? What versions are you using? Do you have the script started? See if the python automation slides here answer any of your questions.
    – jbosq
    Commented Apr 5, 2016 at 17:27

3 Answers 3

2

I've discovered there is an ArcHydro Tools Python toolbox which is installed in the ArcHydro Set-up. C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Toolboxes

This covers most ArcHydro tools contained in the main interface.

1

You can import Archydro like any other module

import ArcHydroTools

Then you can access functions like

ArcHydroTools.CatchmentPolyProcessing(...)
1
  • 1
    Note that for standalone scripts one has to add C:\Program Files (x86)\ESRI\WaterUtils\ArcHydro\bin to PYTHONPATH besides everything else.
    – mlt
    Commented Dec 1, 2017 at 18:01
0

Like Richard G suggested, the toolbox is the way to go. I had nothing but trouble trying to import functions via:

import ArcHydroTools

An example:

import arcpy
toolbox = ('C:/Program Files (x86)/ArcGIS/Desktop10.3/ArcToolbox'
           '/Toolboxes/Arc Hydro Tools Python')
arcpy.ImportToolbox(toolbox)
arcpy.LevelDEM_archydropy(Input_Raw_DEM_Raster="demfixed",
                          Input_Lake_Feature_Class="watbody.shp",
                          Output_Level_DEM_Raster="D:/leveldem")
1
  • "nothing but trouble" is not a good description of a problem. You don't need to import toolbox nor ArcHydroTools. If you'd like to use arcpy style calls, you'd want arcpy.gp.DEMReconditioning_archydro (tested with ArcGIS 10.5). P.S. I believe Richard suggested archydropy instead of archydro.
    – mlt
    Commented Dec 1, 2017 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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