Select to view content in your preferred language

How to Calculate Secondary ID for NextDownID

1976
2
Jump to solution
05-14-2013 11:19 AM
Labels (1)
MichelleTischler
Occasional Contributor
I have my junctions that participate in the network and have assigned HydroIDs to them and calculated the NextDownID. Each Junction also has a Control Point ID (CPID) that associates to another model. I would like to use the NextDownID to populate a NextDownCPID field.  Right now, all the fields reside in the same feature class in a file GDB. Is there an easy way to do this?

Thanks,
Michelle
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MarkBoucher
Honored Contributor
Try this:
Given: Juctions(HydroID, NextdownID,CPID)
Create Junctions(NexdownCPID) field so you now have Juctions(HydroID, NextdownID,CPID,NextdownCPID)
Copy Junctions to layer Junctions2
Join Juctions(HydroID),with Junctions2(NextdownID)
Calculate Junctions(NextdownCPID)=Junctions2(CPID)
Check my logic on this but it seems to me that it should work. You may have a problem with any points that don't have a NextdownID.

View solution in original post

0 Kudos
2 Replies
MarkBoucher
Honored Contributor
Try this:
Given: Juctions(HydroID, NextdownID,CPID)
Create Junctions(NexdownCPID) field so you now have Juctions(HydroID, NextdownID,CPID,NextdownCPID)
Copy Junctions to layer Junctions2
Join Juctions(HydroID),with Junctions2(NextdownID)
Calculate Junctions(NextdownCPID)=Junctions2(CPID)
Check my logic on this but it seems to me that it should work. You may have a problem with any points that don't have a NextdownID.
0 Kudos
MichelleTischler
Occasional Contributor
Thanks, Mark!

I still have to do a couple spot checks, but I think that is going to work fine.

So, I have another variation on the same theme. Some of my control points are gages. I'd like to be able to do a next downstream for every control point and have it report the next downstream gage only. It may have to pass over several CPs until it gets to the next gage.  I can easily build a table/layer of the gages with their associated HydroIDs.

I also have a dream of running the trace upstream to calcluate all next upstream gages from the downstream gage, but that is for another day and probably learning some code.
0 Kudos