Bug: INetworkJunction::EdgeCount() returns an incorrect value when the junction is at the endpoint of a self-looping feature


In ArcObjects, calling the INetworkJunction::EdgeCount() method on a junction at the end of a self-looping feature, a feature that has the same start and end vertex, returns the incorrect number of edges.

For example, if a junction was adjacent to only one edge such that both ends of the edge were adjacent to that junction, the EdgeCount() method will incorrectly return 2 when it should return 1, since there is only one edge adjacent to that junction.


The INetworkJunction::EdgeCount() method is incorrectly returning the cardinality of the junction, the number of different ways to enter or leave the junction, instead of the actual number of edges adjacent to the junction.


If the network dataset contains self-looping edges, then it is possible to get the same edge element returned twice when querying the adjacent edges of the junction. Ensure the code handles this situation.