Пример #1
0
        /// <summary>
        /// Tests routing from a serialized routing file.
        /// </summary>
        public static void Test(Stream stream, int testCount)
        {
            GeoCoordinateBox box = new GeoCoordinateBox(
                new GeoCoordinate(51.20190, 4.66540),
                new GeoCoordinate(51.30720, 4.89820));

            CHSerializedRoutingTest.TestSerializedRouting("CHSerializedRouting",
                                                          stream, box, testCount);
        }
Пример #2
0
        /// <summary>
        /// Tests routing from a serialized routing file.
        /// </summary>
        public static void TestSerializedRouting(string name, string routeFile,
                                                 GeoCoordinateBox box, int testCount)
        {
            FileInfo testFile = new FileInfo(string.Format(@".\TestFiles\routing\{0}", routeFile));
            Stream   stream   = testFile.OpenRead();

            CHSerializedRoutingTest.TestSerializedRouting(name, stream, box, testCount);

            stream.Dispose();
        }
Пример #3
0
        /// <summary>
        /// Tests the instructions.
        /// </summary>
        public static void TestInstructions(string name)
        {
            FileInfo testFile = new FileInfo(string.Format(@".\TestFiles\routing\{0}",
                                                           "kempen-big.osm.pbf.routing"));
            Stream stream = testFile.OpenRead();

            CHSerializedRoutingTest.TestSerializeRoutingInstrictions(
                name, stream,
                new GeoCoordinate(51.261203, 4.780760),
                new GeoCoordinate(51.267797, 4.801362));
        }
Пример #4
0
        /// <summary>
        /// Tests the CH pre-processor.
        /// </summary>
        public static void Test()
        {
            GeoCoordinateBox box = new GeoCoordinateBox(
                new GeoCoordinate(51.20190, 4.66540),
                new GeoCoordinate(51.30720, 4.89820));

            CHSerializedRoutingTest.TestSerializedRouting("CHSerializedRouting",
                                                          "kempen-big.osm.pbf.routing", box, 100);

            // test instructions.
            //CHSerializedRoutingTest.TestInstructions("CHSerializedRouting");
        }
Пример #5
0
        /// <summary>
        /// Tests routing from a serialized routing file.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="stream"></param>
        /// <param name="box"></param>
        /// <param name="testCount"></param>
        public static void TestSerializedRouting(string name, Stream stream,
                                                 GeoCoordinateBox box, int testCount)
        {
            TagsCollectionBase metaData = null;
            var routingSerializer       = new CHEdgeSerializer();
            var graphDeserialized       = routingSerializer.Deserialize(
                stream, out metaData, false);

            var router = Router.CreateCHFrom(
                graphDeserialized, new CHRouter(),
                new OsmRoutingInterpreter());

            CHSerializedRoutingTest.TestRouting(router, box, testCount);
        }
Пример #6
0
 /// <summary>
 /// Tests the CH pre-processor.
 /// </summary>
 public static void Test(Stream stream)
 {
     CHSerializedRoutingTest.Test(
         stream, 1000);
 }