コード例 #1
0
        /// <summary>
        /// Tests routing from a serialized routing file.
        /// </summary>
        public static void TestResolved(string name, string osmPbfFile, GeoCoordinateBox box, int testCount)
        {
            var testFile = new FileInfo(string.Format(@".\TestFiles\{0}", osmPbfFile));
            var stream   = testFile.OpenRead();

            RoutingResolveTest.TestResolved(name, stream, box, testCount);

            stream.Dispose();
        }
コード例 #2
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 TestResolved(string name, Stream stream, GeoCoordinateBox box, 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 = GraphOsmStreamTarget.Preprocess(source,
                                                       new OsmRoutingInterpreter());

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

            RoutingResolveTest.TestResolved(data, testCount, box);
        }
コード例 #3
0
 /// <summary>
 /// Tests the resolve for routing.
 /// </summary>
 /// <param name="box"></param>
 public static void Test(GeoCoordinateBox box)
 {
     RoutingResolveTest.TestResolved("CHRoutingResolveTest", "kempen-big.osm.pbf", box, 10000);
 }