Select to view content in your preferred language

Network flow trace with measures / distance

797
2
06-14-2012 01:40 AM
SzymonPiskula
Deactivated User
Hi,

I wrote a tool that finds upstream and downstream trace in a river network from a start point X. This is based on a network flag for the point X. The network has defined flow direction/sinks. Now there is a requirement to find the distance of objects laying along the network (trace result in particular) to the point X. Is it possible for the network solver to add M Values to the resulting geometries? For example it would be enough if all the M Values would indicate how far a given FromPoint or ToPoint of the returned edge is from the end (last sink) of the whole 'branch'  of the river.  I''ve programmatically added  weights to the solver:

INetSchema netSchema = m_geometricNetwork.Network as INetSchema;
INetSolverWeightsGEN netSolverWeights = m_traceFlowSolver as INetSolverWeightsGEN;

INetWeight netWeight = netSchema.get_WeightByName("Distance");
      
netSolverWeights.FromToEdgeFilterWeight = netWeight;
netSolverWeights.ToFromEdgeFilterWeight = netWeight;


but the results have no measures.  Any suggestions?

Thanks,
Szymon
0 Kudos
2 Replies
DuncanHornby
MVP Notable Contributor
Szymon,

It's been a long time time I've programmed a geometric network so I may be wrong here but I don't think you can mix M values with a geometric network, thats a linear referencing thing?

If your trace is returning a valid solution you can then enumerate the results using the Interface IEnumNetEID and build a polyline. You could then use the IMSegmentation3 Interface (once you made the polyline MAware) to calibrate M values to it. Then using the QueryPointAndDistance on the IPolyline interface you could "snap" your points to your measured trace polyline.

Duncan
0 Kudos
SzymonPiskula
Deactivated User
Duncan,

Thanks for the response. This IMSegmentation3  is almost fine, but... . If the trace result, say upstream, consist of several patsh that split (say in a form of Y letter) then the measures would go up one branch, (say up to upper left left point of Y letter). Then M values would continue from the middle of Y letter up to the right upper point. The more splits there are the less consistent/reliable M values become. In general this would work OK only for a single path without splits. Correct me if im wrong please !

Thanks,
Szymon
0 Kudos