Accessing the Logical Network - Retrieve From-To EdgesID from polyline shapefile

1350
3
05-10-2012 04:30 PM
HarisBallis
New Contributor
Hello

My project involves finding the shortest path within a polyline shapefile, without using the network analyst (not an owner of a licence for the specific product).
Eventually i need the ID's of the nodes(edges) that "create" this network although i cannot find where this information is stored.
After some research I believe the answer lays somewhere the INetwork interface but my skills at ArcObjects with VBA are still novice.

I'd be glad if someone could help me further.
Tags (2)
0 Kudos
3 Replies
curtvprice
MVP Esteemed Contributor
My project involves finding the shortest path within a polyline shapefile, without using the network analyst (not an owner of a licence for the specific product).


There is a great deal of network functionality that does not require the Network Analyst extension. You may want to take a look at:

Arc 10 help: What are geometric networks?
0 Kudos
HarisBallis
New Contributor
The algorithm for finding the shortest path is up and running. My only problem is how to access the "Logical network" in order to get the ID's of the nodes at the edges of each link.
0 Kudos
nicogis
MVP Frequent Contributor
From result of trace solver you can use EIDHelperClass for get feature


            IEIDHelper eidHelper = new EIDHelperClass();
            eidHelper.GeometricNetwork = geometricNetwork;
            eidHelper.ReturnGeometries = true;
            eidHelper.ReturnFeatures = true;

            IEnumEIDInfo enumEIDinfo = eidHelper.CreateEnumEIDInfo(eids);
            enumEIDinfo.Reset();
            IEIDInfo eidInfo = enumEIDinfo.Next();
            while (eidInfo != null)
            {
                IFeatureClass featureClass = eidInfo.Feature.Class as IFeatureClass;
                IFeature feature = eidInfo.Feature;
                int featureClassID = featureClass.FeatureClassID;
                ...                
                eidInfo = enumEIDinfo.Next();
            }

you can also use IEIDHelper::AddField() to get attribute for field added and IEIDHelper::get_DisplayEnvelope() for get feature valid cointained in a envelope
0 Kudos