/// <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); CHRoutingResolveTest.TestResolved(data, testCount, box); }
/// <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(); CHRoutingResolveTest.TestResolved(name, stream, box, testCount); stream.Dispose(); }
/// <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 = CHEdgeGraphOsmStreamTarget.Preprocess(source, new OsmRoutingInterpreter(), vehicle); //(data.Graph as DirectedGraph<CHEdgeData>).Compress(true); CHRoutingResolveTest.TestResolved(data, testCount, box); }
/// <summary> /// Tests the resolve for routing. /// </summary> /// <param name="box"></param> public static void Test(GeoCoordinateBox box) { CHRoutingResolveTest.TestResolved("CHRouting", "kempen-big.osm.pbf", box, 10000); }