I am working on trying to do some batch watershed processing.
I have watersheds created using ArcHydro, and was trying to run the Longest Flow Path tool in a batch method, on different feature classes (watershed polygons) in a feature dataset, using the code below:
# import stuff
import arcpy, os, traceback, sys, time
Flow_Dir_Grid = "C://Entire_State//Souhegan_River//Layers//fdr"
feat_classes = arcpy.ListFeatureClasses()
for feat in feat_classes:
in_name = arcpy.env.workspace + "//Watersheds_Separate//" + str(feat)
out_name = arcpy.env.workspace + "//Watersheds_Separate//" + str(feat) + "_LFP"
name = feat + "_LFP"
message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info())
message = "Python Error Info: " + str(sys.exc_type) + ": " + str(sys.exc_value) + "\n"
arcpy.AddMessage("Done generating LFPs.")
And I get this error: "The default vector location () cannot be a directory. Modify the current geoprocessing workspace or set the Arc Hydro target locations. Failed to execute (LongestFlowPath)."
I don't really understand this error and how to fix it - would someone advise or provide an example of a working script that access this tool correctly?