Inizialized Flow Direction if you need downstream or upstream
you can use similiar code for find edge in downstream or upstream with your business logic.
INetTopologyEditGEN netTopology = networkElements as INetTopologyEditGEN; int edgeCount = netTopology.GetAdjacentEdgeCount(yourEIDJunction); bool reverseOrientation; int adjacentEdge; for (int i = 0; i < edgeCount; i++) { netTopology.GetAdjacentEdge(yourEIDJunction, i, out adjacentEdge, out reverseOrientation); netTopology.GetFromToJunctionEIDs(adjacentEdge, out fromEIDJunction, out toEIDJunction);
reverseOrientation = true // into Junction -> upstream
reverseOrientation = false // exit Junction -> downstream
Hi Milos,
One can get featureclass id from EID with INetworkElements.QueryIDs interface
ArcObjects 10 .NET SDK Help
Here is some quick sample code
Dim userclassid1 As Long, userid1 As Long, usersubid1 As LongDim pNetElements As INetElementsSet pNetElements = pNetworkpNetElements.QueryIDs EIDp, esriETEdge, userclassid1, userid1, usersubid1
Debug.Print "classid: " & userclassid1 & " userid: " & userid1 & " subid: " & usersubid1
This helped me:
https://community.esri.com/message/15434?sr=search&searchId=a454f382-ad3d-4d79-8a35-b837bf8ed7b8&searchIndex=2#15434
Now I am trying to get feature class of e.g. junction that was returned to me by the trace.
I got this far:
pTraceFlowSolver.FindFlowElements(strTraceType,esriFlowElements.esriFEJunctionsAndEdges, out pJunctionEIDs, out pEdgeEIDs);
int idJunction = pJunctionEIDs.Next();
while (idJunction != -1)
{
idJunction = pJunctionEIDs.Next();
}
How can I get a layer, or feature class or something that can give me attributes of the returned objects.
All I have is ID of a junction.
Tnx,
Here is the documentation on that..
"Use the INetSolver interface to specify which network on which you want to perform an analysis, which elements in the network are barriers, and which element classes are disabled."
"When you create a TraceFlowSolver object, you also get a reference to a NetSolver object, since TraceFlowSolver inhereits from NetSolver."
Hi Kromo,
I can see that network is not set for the ITraceFlowSolver. you can doing this by following code. Cast the ITraceFlowSolve to a INetSolver and set the sourceNetwork with INetwork which can get access from IGeometricNetwork::Network. May be this will help.
Dim pNetSolver As ESRI.ArcGIS.NetworkAnalysis.INetSolverSet pNetSolver = ipTraceFlowSolver
Set ipNetwork = pGeometricNetwork.NetworkSet pNetSolver.SourceNetwork = ipNetwork
Hello,
I have been trying to do the same, and I keep getting the same error.
Did You find a solution to this?
Thanks.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.