public void VectorTile_Init() { VectorTile v = new VectorTile(0, 0, 0); Assert.AreEqual(256, v.Width()); Assert.AreEqual(256, v.Height()); Assert.IsFalse(v.Painted()); Assert.AreEqual("", v.IsSolid()); Assert.IsTrue(v.Empty()); Assert.AreEqual(0, v.GetData().Length); }
public void VectorTile_IsSolid() { Mapnik.RegisterDatasource(Path.Combine(Mapnik.Paths["InputPlugins"], "shape.input")); Map m = new Map(256, 256); m.Load(@".\data\layer.xml"); m.Extent = new double[] { -11271098.442818949, 4696291.017841229, -11192826.925854929, 4774562.534805249 }; VectorTile v = new VectorTile(9, 112, 195); m.Render(v); Assert.IsTrue(v.Painted()); Assert.AreEqual("world", v.IsSolid()); }
public void VectorTile_Clear() { VectorTile v = new VectorTile(9, 112, 195); byte[] bytes = File.ReadAllBytes(@".\data\9.112.195.pbf"); v.SetData(bytes); Assert.IsFalse(v.Empty()); Assert.IsTrue(v.Painted()); CollectionAssert.AreEquivalent(new List <string>() { "world" }, v.Names().ToList()); byte[] actual = v.GetData(); Assert.AreEqual(bytes.Length, actual.Length); v.Clear(); Assert.IsTrue(v.Empty()); Assert.IsFalse(v.Painted()); Assert.AreEqual("", v.IsSolid()); CollectionAssert.AreEquivalent(new List <string>(), v.Names().ToList()); actual = v.GetData(); Assert.AreEqual(0, actual.Length); }
public void VectorTile_Clear() { VectorTile v = new VectorTile(9,112,195); byte[] bytes = File.ReadAllBytes(@".\data\9.112.195.pbf"); v.SetData(bytes); Assert.IsFalse(v.Empty()); Assert.IsTrue(v.Painted()); CollectionAssert.AreEquivalent(new List<string>() { "world" }, v.Names().ToList()); byte[] actual = v.GetData(); Assert.AreEqual(bytes.Length, actual.Length); v.Clear(); Assert.IsTrue(v.Empty()); Assert.IsFalse(v.Painted()); Assert.AreEqual("",v.IsSolid()); CollectionAssert.AreEquivalent(new List<string>(), v.Names().ToList()); actual = v.GetData(); Assert.AreEqual(0, actual.Length); }