Beispiel #1
0
        public void TileSchemaWithExtentThatDoesNotStartInOriginShouldReturnNoTiles()
        {
            // arrange
            var schema = new WkstNederlandSchema {
                Extent = new Extent(187036, 331205, 187202, 331291)
            };
            var mapExtent = new Extent(187256.999043765, 331197.712996388, 187437.576002535, 331303.350517269);

            // act
            var tileInfos = schema.GetTileInfos(mapExtent, "14");

            // assert
            Assert.AreEqual(tileInfos.Count(), 0);
        }
Beispiel #2
0
        public static ITileSource CreateTileSource()
        {
            const string url = "http://geodata.nationaalgeoregister.nl/omgevingswarmte/wms?SERVICE=WMS&VERSION=1.1.1";
            // You need to know the schema. This can be a problem. Usally it is GlobalSphericalMercator
            var schema = new WkstNederlandSchema {
                Format = "image/png", Srs = "EPSG:28992"
            };
            var request  = new WmscRequest(new Uri(url), schema, new[] { "koudegeslotenwkobuurt" }.ToList(), Array.Empty <string>().ToList());
            var provider = new HttpTileProvider(request);

            return(new TileSource(provider, schema)
            {
                Name = "Omgevingswarmte (PDOK)"
            });
        }
Beispiel #3
0
        public void TileSchemaWithExtentThatDoesOriginateInOriginAndWithInverteYShouldReturnCorrectNumberOfTiles()
        {
            // arrange
            var schemaExtent = new Extent(187009, 331184, 187189, 331290);
            var schema       = new WkstNederlandSchema {
                Extent = schemaExtent, OriginY = -22598.080, YAxis = YAxis.OSM
            };
            var requestExtent = GrowExtent(schemaExtent, schemaExtent.Width);

            // act
            var tileInfos = schema.GetTileInfos(requestExtent, 14);

            // assert
            Assert.True(TilesWithinEnvelope(tileInfos, schemaExtent));
            Assert.True(Math.Abs(TileAreaWithinEnvelope(tileInfos, schemaExtent) - schemaExtent.Area) < Epsilon);
        }