/// <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); }
/// <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(); }
/// <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)); }
/// <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"); }
/// <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); }
/// <summary> /// Tests the CH pre-processor. /// </summary> public static void Test(Stream stream) { CHSerializedRoutingTest.Test( stream, 1000); }