<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error Trapping: ArcHydro LongestFlowPath in Water Resources Questions</title>
    <link>https://community.esri.com/t5/water-resources-questions/error-trapping-archydro-longestflowpath/m-p/528853#M2726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've a very large model where I'm processing 650 watersheds. My model is failing when trying to generate the longest flow paths for the 650 watersheds. I would like to trap the individual watersheds that are causing the longest flow path to fail, report the hydroID and continue the the rest of the watersheds at least. I can always go back to look at the watersheds that throw an exception to see whats causing the the tool to fail. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, ArcHydroTools
watshed = r'E:\Projects\H109355_2\ArcHydro\Model3\Nigeria03.gdb\Layers\Watershed'
fdr = r'E:\Projects\H109355_2\Archydro\GRID\layers.gdb\Fdr'
ArcHydroTools.LongestFlowpath(watshed,fdr,r'E:\Projects\H109355_2\ArcHyro\Model3\Nigeria03.gdb\Layers\LongestFlowPath')&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried the following approach, but over write output doesn't work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, ArcHydroTools
outpath = arcpy.env.workspace = r'E:\Projects\H109355_2\ArcHydro\Model3\Nigeria03.gdb\Layers'
arcpy.env.overwriteOutput = True
fdr = r'E:\Projects\H109355_2\ArcHydro\GRID\Layers.gdb\Fdr'
watshed = "Watershed"
with arcpy.da.SearchCursor(watshed,("Name",)) as scur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in scur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cuindex = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlexp = """{0} = '{1}'""".format(arcpy.AddFieldDelimiters(watshed,"Name"),cuindex)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; watshedind = arcpy.FeatureClassToFeatureClass_conversion(watshed,outpath,"watshed",sqlexp)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; longflowpath1 = ArcHydroTools.LongestFlowPath(watshedind,fdr,"in_memory\longestflowpath")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print cuindex&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help will be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 May 2013 16:38:15 GMT</pubDate>
    <dc:creator>PeterWilson</dc:creator>
    <dc:date>2013-05-20T16:38:15Z</dc:date>
    <item>
      <title>Error Trapping: ArcHydro LongestFlowPath</title>
      <link>https://community.esri.com/t5/water-resources-questions/error-trapping-archydro-longestflowpath/m-p/528853#M2726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've a very large model where I'm processing 650 watersheds. My model is failing when trying to generate the longest flow paths for the 650 watersheds. I would like to trap the individual watersheds that are causing the longest flow path to fail, report the hydroID and continue the the rest of the watersheds at least. I can always go back to look at the watersheds that throw an exception to see whats causing the the tool to fail. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, ArcHydroTools
watshed = r'E:\Projects\H109355_2\ArcHydro\Model3\Nigeria03.gdb\Layers\Watershed'
fdr = r'E:\Projects\H109355_2\Archydro\GRID\layers.gdb\Fdr'
ArcHydroTools.LongestFlowpath(watshed,fdr,r'E:\Projects\H109355_2\ArcHyro\Model3\Nigeria03.gdb\Layers\LongestFlowPath')&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried the following approach, but over write output doesn't work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, ArcHydroTools
outpath = arcpy.env.workspace = r'E:\Projects\H109355_2\ArcHydro\Model3\Nigeria03.gdb\Layers'
arcpy.env.overwriteOutput = True
fdr = r'E:\Projects\H109355_2\ArcHydro\GRID\Layers.gdb\Fdr'
watshed = "Watershed"
with arcpy.da.SearchCursor(watshed,("Name",)) as scur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in scur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cuindex = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlexp = """{0} = '{1}'""".format(arcpy.AddFieldDelimiters(watshed,"Name"),cuindex)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; watshedind = arcpy.FeatureClassToFeatureClass_conversion(watshed,outpath,"watshed",sqlexp)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; longflowpath1 = ArcHydroTools.LongestFlowPath(watshedind,fdr,"in_memory\longestflowpath")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print cuindex&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help will be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2013 16:38:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/water-resources-questions/error-trapping-archydro-longestflowpath/m-p/528853#M2726</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2013-05-20T16:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error Trapping: ArcHydro LongestFlowPath</title>
      <link>https://community.esri.com/t5/water-resources-questions/error-trapping-archydro-longestflowpath/m-p/528854#M2727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have modified the function so that it now runs through all selected input features and report the issues at the end (10.1.0.160). Give it a try.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Christine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Christine Dartiguenave&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri Water Resources Team&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 14:29:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/water-resources-questions/error-trapping-archydro-longestflowpath/m-p/528854#M2727</guid>
      <dc:creator>ChristineDartiguenave</dc:creator>
      <dc:date>2013-06-12T14:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error Trapping: ArcHydro LongestFlowPath</title>
      <link>https://community.esri.com/t5/water-resources-questions/error-trapping-archydro-longestflowpath/m-p/528855#M2728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Christine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Appreciate the following, I'll rerun the following section and let you know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 15:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/water-resources-questions/error-trapping-archydro-longestflowpath/m-p/528855#M2728</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2013-06-12T15:19:58Z</dc:date>
    </item>
  </channel>
</rss>

