Thanks @FelixIP. I see there are enough steps to do and I understand that witout automation it’s a lot of work. Unfortunely, I’m quite new with python, but even so, I’ve use a trace downstream code from an older reply of yours regarding cumulative polygon basin calculation and resulted total surfaces at hydrometric station (BH is partial basin, BH_DS is downstream basin, AREA_BH is partial surface and AREA_TOT is total surface of basin). I guess I could use some parts of this code and add a mergeList = [ ] in which to merge polygons with arcpy.Merge_management and then to dissolve them with arcpy.Dissolve_management and save to disk...but I’m prety stuck.
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
bh = arcpy.mapping.ListLayers(mxd)[0]
table = arcpy.da.TableToNumPyArray("bh", ("BH", "AREA_BH", "BH_DS"))
nod = {}; total = {}
for id, load, dsNode in table:
nod[id] = [dsNode.rstrip(), load]
total[id] = load
for id, x in nod.iteritems():
fromNode = id; load = x[1]
while True:
dsNode = nod[fromNode][0]
if dsNode =="": break
total[dsNode] += load
fromNode = dsNode
with arcpy.da.UpdateCursor("bh", ("BH", "AREA_TOT")) as cursor:
for id, sum in cursor:
sum = total[id]
cursor.updateRow((id, sum))
del mxd
