Exemple #1
0
        /// <summary>
        /// Tests interpreting all data from a given pbf source.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="mapCSS"></param>
        /// <param name="scene"></param>
        /// <param name="pbfSource"></param>
        public static void TestInterpret(string name, string mapCSS, Scene2D scene, string pbfSource)
        {
            FileInfo          cssFile     = new FileInfo(string.Format(@".\TestFiles\{0}", mapCSS));
            Stream            cssStream   = cssFile.OpenRead();
            MapCSSInterpreter interpreter = new MapCSSInterpreter(cssStream, new MapCSSDictionaryImageSource());

            MapCSSInterpreterTests.TestInterpret(name, interpreter, scene, pbfSource);

            cssStream.Dispose();
        }
Exemple #2
0
        /// <summary>
        /// Executes the tests.
        /// </summary>
        /// <returns>Serialized scene.</returns>
        public static Stream Test()
        {
            // create a layered scene.
            Scene2D scene = new Scene2D(new OsmSharp.Math.Geo.Projections.WebMercator(), new List <float>(new float[] {
                16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6
            }));

            // tests map css interpreter.
            MapCSSInterpreterTests.TestInterpret("MapCSSInterpreter", @"mapcss\default.mapcss", scene, "kempen-big.osm.pbf");

            var merger = new Scene2DObjectMerger();

            scene = merger.BuildMergedScene(scene);

            // tests serialization of the scene.
            return(Scene2DTests.TestSerialize("Scene2DLayered", @"mapcss\default.map", scene, true));
        }