Exemplo n.º 1
0
        public void VectorTile_OverzoomComposite()
        {
            Mapnik.RegisterDatasource(Path.Combine(Mapnik.Paths["InputPlugins"], "shape.input"));
            Map m = new Map(256, 256);

            m.Load(@".\data\layer.xml");

            VectorTile v1 = new VectorTile(1, 0, 0, 256, 256);

            m.ZoomToBox(-20037508.34, 0, 0, 20037508.34);
            m.Render(v1);
            int v1before = v1.GetData().Length;

            VectorTile v2 = new VectorTile(0, 0, 0, 256, 256);

            m.ZoomToBox(-20037508.34, -20037508.34, 20037508.34, 20037508.34);
            m.Render(v2);

            v1.Composite(new List <VectorTile>()
            {
                v2
            });
            int v1after = v1.GetData().Length;

            //composite bytes will actually be a little bit bigger than 2* original
            //Assert.AreEqual(v1before * 2, v1after);
        }
Exemplo n.º 2
0
        public void VectorTile_SimpleComposite()
        {
            Mapnik.RegisterDatasource(Path.Combine(Mapnik.Paths["InputPlugins"], "shape.input"));
            Map m = new Map(256, 256);

            m.Load(@".\data\layer.xml");
            m.ZoomAll();

            VectorTile v1 = new VectorTile(0, 0, 0, 256, 256);

            m.Render(v1);
            int v1before = v1.GetData().Length;

            VectorTile v2 = new VectorTile(0, 0, 0, 256, 256);

            m.Render(v2);

            v1.Composite(new List <VectorTile>()
            {
                v2
            });
            int v1after = v1.GetData().Length;

            Assert.AreEqual(v1before * 2, v1after);
        }
Exemplo n.º 3
0
        public void VectorTile_SimpleComposite()
        {
            Mapnik.RegisterDatasource(Path.Combine(Mapnik.Paths["InputPlugins"], "shape.input"));
            Map m = new Map(256, 256);
            m.Load(@".\data\layer.xml");
            m.ZoomAll();

            VectorTile v1 = new VectorTile(0, 0, 0, 256, 256);
            m.Render(v1);
            int v1before = v1.GetData().Length;

            VectorTile v2 = new VectorTile(0, 0, 0, 256, 256);
            m.Render(v2);

            v1.Composite(new List<VectorTile>() { v2 });
            int v1after = v1.GetData().Length;

            Assert.AreEqual(v1before * 2, v1after);
        }
Exemplo n.º 4
0
        public void VectorTile_OverzoomComposite()
        {
            Mapnik.RegisterDatasource(Path.Combine(Mapnik.Paths["InputPlugins"], "shape.input"));
            Map m = new Map(256, 256);
            m.Load(@".\data\layer.xml");

            VectorTile v1 = new VectorTile(1, 0, 0, 256, 256);
            m.ZoomToBox(-20037508.34, 0, 0, 20037508.34);
            m.Render(v1);
            int v1before = v1.GetData().Length;

            VectorTile v2 = new VectorTile(0, 0, 0, 256, 256);
            m.ZoomToBox(-20037508.34, -20037508.34, 20037508.34, 20037508.34);
            m.Render(v2);

            v1.Composite(new List<VectorTile>() { v2 });
            int v1after = v1.GetData().Length;

            //composite bytes will actually be a little bit bigger than 2* original
            //Assert.AreEqual(v1before * 2, v1after);
        }