Ejemplo n.º 1
0
        /// <summary>
        /// Tests routing from a serialized file.
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="box"></param>
        /// <param name="lazy"></param>
        /// <param name="testCount"></param>
        public static void TestSerializedResolved(Stream stream, GeoCoordinateBox box, bool lazy = true, int testCount = 100)
        {
            var routingSerializer = new CHEdgeSerializer();
            var data = routingSerializer.Deserialize(stream, lazy);

            CHRoutingTest.TestResolved(data, testCount, box);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Tests routing from a serialized routing file.
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="testCount"></param>
        public static void TestSerializedResolved(Stream stream, bool lazy = true, int testCount = 100)
        {
            var routingSerializer = new CHEdgeSerializer();
            var data = routingSerializer.Deserialize(stream, lazy);

            CHRoutingTest.TestSerializedResolved(data, new GeoCoordinateBox(new GeoCoordinate(51.20190, 4.66540),
                                                                            new GeoCoordinate(51.30720, 4.89820)), testCount);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Tests routing from a serialized routing file.
        /// </summary>
        public static void TestRouting(string name, string osmPbfFile, int testCount)
        {
            var testFile = new FileInfo(string.Format(@".\TestFiles\{0}", osmPbfFile));
            var stream   = testFile.OpenRead();

            CHRoutingTest.TestRouting(name, stream, testCount);

            stream.Dispose();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Tests routing from a serialized file.
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="lazy"></param>
        /// <param name="testCount"></param>
        public static void TestSerialized(Stream stream, bool lazy = true, int testCount = 100)
        {
            var routingSerializer = new CHEdgeSerializer();
            var data = routingSerializer.Deserialize(stream, lazy);

            //data.SortHilbert(1000);

            //// copy.
            //var graphCopy = new DirectedGraph<CHEdgeData>();
            //graphCopy.CopyFrom(data);
            //var dataCopy = new RouterDataSource<CHEdgeData>(graphCopy, data.TagsIndex);

            CHRoutingTest.Test(data, testCount);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Tests routing from a serialized routing file.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="stream"></param>
        /// <param name="testCount"></param>
        public static void TestRouting(string name, Stream stream, int testCount)
        {
            var vehicle = Vehicle.Car;

            var tagsIndex = new TagsIndex();             // creates a tagged index.

            // read from the OSM-stream.
            var source = new OsmSharp.Osm.Streams.Filters.OsmStreamFilterProgress();

            source.RegisterSource(new OsmSharp.Osm.PBF.Streams.PBFOsmStreamSource(stream));
            var data = CHEdgeGraphOsmStreamTarget.Preprocess(source,
                                                             new OsmRoutingInterpreter(), vehicle);

            //(data.Graph as DirectedGraph<CHEdgeData>).Compress(true);

            CHRoutingTest.Test(data, testCount);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Tests routing from a serialized routing file.
 /// </summary>
 public static void Test(Stream stream, int testCount)
 {
     CHRoutingTest.TestRouting("CHRouting", stream, testCount);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Tests the routing.
 /// </summary>
 public static void Test()
 {
     CHRoutingTest.TestRouting("CHRouting", "kempen-big.osm.pbf", 10000);
 }