Select to view content in your preferred language

How to create duplicate watersheds using the same pour point? Arcpy.da.UpdateCursor Method?

731
1
01-05-2023 05:53 PM
tzz_12
by
New Contributor III

I am creating a tool that delineated multiple watersheds using a set of pourpoints and compares the area ratio of the watersheds with the same ID. Is it possible to generate two duplicate watershed feature class using the same pourpoint? If not, is it possible to use arcpy.da.UpdateCursor to change all the null and zero values within a field to it's previous non-Null value in the row above it? I know my questions seem unrelated, but these are two ways that could solve my current tool problem. If you have any questions, please let me know. I added my codes below using the arcpy.da. UpdateCursor. Thanks for your help!

 

  previous_value = non_null_value   
  with arcpy.da.UpdateCursor(ScaleRatioTable,['Area_sqmi_1'])as cursor:
     for row in cursor:
       if row[0] == 0.0:
         row[0]= previous_value
         cursor.updateRow(row)

 

 

Tags (2)
0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor

It's not entirely clear what it you are doing, you say "Is it possible to generate two duplicate watershed feature class using the same pourpoint?". This sounds like you want to run the tool twice or simply call the Copy Features tool? Then you go on to show an update cursor which seems to have nothing to do with generating watersheds...

0 Kudos