public static bool ContainsEdge(this RoutingNetwork network, uint vertex1, uint vertex2)
 {
     RoutingNetwork.EdgeEnumerator edgeEnumerator = network.GetEdgeEnumerator(vertex1);
     while (edgeEnumerator.MoveNext())
     {
         if ((int)edgeEnumerator.To == (int)vertex2)
         {
             return(true);
         }
     }
     return(false);
 }
        public static FeatureCollection GetFeaturesIn(this RoutingNetwork network, float minLatitude, float minLongitude, float maxLatitude, float maxLongitude)
        {
            FeatureCollection featureCollection = new FeatureCollection();
            HashSet <uint>    uintSet           = network.GeometricGraph.Search(minLatitude, minLongitude, maxLatitude, maxLongitude);
            HashSet <long>    longSet           = new HashSet <long>();

            RoutingNetwork.EdgeEnumerator edgeEnumerator = network.GetEdgeEnumerator();
            foreach (uint vertex1 in uintSet)
            {
                GeoCoordinateSimple vertex2 = network.GeometricGraph.GetVertex(vertex1);
                featureCollection.Add(new Feature((Geometry) new Point(new GeoCoordinate((double)vertex2.Latitude, (double)vertex2.Longitude)), (GeometryAttributeCollection) new SimpleGeometryAttributeCollection((IEnumerable <Tag>) new Tag[1]
                {
                    Tag.Create("id", vertex1.ToInvariantString())
                })));
                edgeEnumerator.MoveTo(vertex1);
                edgeEnumerator.Reset();
                while (edgeEnumerator.MoveNext())
                {
                    if (!longSet.Contains((long)edgeEnumerator.Id))
                    {
                        longSet.Add((long)edgeEnumerator.Id);
                        List <ICoordinate>   shape             = network.GetShape(edgeEnumerator.Current);
                        List <GeoCoordinate> geoCoordinateList = new List <GeoCoordinate>();
                        foreach (ICoordinate coordinate in shape)
                        {
                            geoCoordinateList.Add(new GeoCoordinate((double)coordinate.Latitude, (double)coordinate.Longitude));
                        }
                        LineString lineString = new LineString((IEnumerable <GeoCoordinate>)geoCoordinateList);
                        featureCollection.Add(new Feature((Geometry)lineString, (GeometryAttributeCollection) new SimpleGeometryAttributeCollection((IEnumerable <Tag>) new Tag[1]
                        {
                            Tag.Create("id", edgeEnumerator.Id.ToInvariantString())
                        })));
                    }
                }
            }
            return(featureCollection);
        }
        public static void MergeVertices(this RoutingNetwork network, uint vertex1, uint vertex2)
        {
            List <RoutingEdge> routingEdgeList = new List <RoutingEdge>((IEnumerable <RoutingEdge>)network.GetEdgeEnumerator(vertex2));

            network.RemoveEdges(vertex2);
            for (int index = 0; index < routingEdgeList.Count; ++index)
            {
                if (!routingEdgeList[index].DataInverted)
                {
                    int num1 = (int)network.AddEdge(vertex1, routingEdgeList[index].To, routingEdgeList[index].Data, routingEdgeList[index].Shape);
                }
                else
                {
                    int num2 = (int)network.AddEdge(routingEdgeList[index].To, vertex1, routingEdgeList[index].Data, routingEdgeList[index].Shape);
                }
            }
        }