Select to view content in your preferred language

Technique to programmatically determine the immediate upstream and downstream features to a given feature in my electric geometric network?

1992
3
Jump to solution
04-26-2017 02:30 PM
JessicaHanscom
Occasional Contributor

I am relatively new to ESRI geometric networks and working with an electric distribution system model in a file gdb.  My goal is to make a python script that generates an export file that our power modeling software WindMil can use.  I want to iterate through every feature in our GN and as efficiently as possible determine the immediate upstream feature(s) because each row in the csv export has to have the identifier of the current feature and the id of the immediate upstream feature.  I have learned to use arcpy to perform network traces but I see no clear-cut way to get the immediate upstream feature.  All I can think of is to find all the features immediately connected to my feature by geometry, then run an upstream trace and check to see what immediately connected features are also in the upstream trace features.  This seems inefficient to do 80,000 times.  Is there a better way?  There probably is something incredibly easy I am just not seeing...

Thanks! Jessica

0 Kudos
1 Solution

Accepted Solutions
MikeMillerGIS
Esri Frequent Contributor

You could use the attribute assistant. It had from junctions and to junction methods.

View solution in original post

3 Replies
JessicaHanscom
Occasional Contributor

Looks like I will have to delve into ArcObjects again as the methods to access adjacent network features don't seem to exist in arcpy. 

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

You could use the attribute assistant. It had from junctions and to junction methods.

JessicaHanscom
Occasional Contributor

Thanks Michael!  I didn't know this existing.  It looks super promising.

0 Kudos