/// <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); }
/// <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); }
/// <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(); }
/// <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); }
/// <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); }
/// <summary> /// Tests routing from a serialized routing file. /// </summary> public static void Test(Stream stream, int testCount) { CHRoutingTest.TestRouting("CHRouting", stream, testCount); }
/// <summary> /// Tests the routing. /// </summary> public static void Test() { CHRoutingTest.TestRouting("CHRouting", "kempen-big.osm.pbf", 10000); }