コード例 #1
0
        /// <summary>
        /// Tests preprocessing data from a PBF file.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pbfFile"></param>
        public static Stream TestSerialization(string name, string pbfFile)
        {
            var testFile = new FileInfo(string.Format(@".\TestFiles\{0}", pbfFile));
            var stream   = testFile.OpenRead();
            var source   = new OsmSharp.Osm.Streams.Filters.OsmStreamFilterProgress();

            source.RegisterSource(new PBFOsmStreamSource(stream));

            var data = CHEdgeGraphOsmStreamTarget.Preprocess(
                source, new OsmRoutingInterpreter(), Vehicle.Car);

            stream.Dispose();

            return(CHEdgeGraphFileStreamTargetTests.TestSerialization(name, pbfFile, data));
        }
コード例 #2
0
 /// <summary>
 /// Tests the CH serializer.
 /// </summary>
 /// <returns>A stream to the file that was serialized.</returns>
 public static Stream Test()
 {
     return(CHEdgeGraphFileStreamTargetTests.TestSerialization("CHSerializer", "kempen-big.osm.pbf"));
 }
コード例 #3
0
 /// <summary>
 /// Tests the CH serializer.
 /// </summary>
 /// <returns>A stream to the file that was serialized.</returns>
 public static Stream Test(DynamicGraphRouterDataSource <CHEdgeData> data)
 {
     return(CHEdgeGraphFileStreamTargetTests.TestSerialization("CHSerializer", "kempen-big.osm.pbf", data));
 }
コード例 #4
0
 /// <summary>
 /// Tests the CH serializer.
 /// </summary>
 public static void Test()
 {
     CHEdgeGraphFileStreamTargetTests.TestSerialization("CHSerializer", "kempen-big.osm.pbf");
 }