public void BoudingBoxConservationTest(string datasetName) { var dataset = DEMDataSet.RegisteredDatasets.First(d => d.Name == datasetName); string bboxWKT = "POLYGON((5.54888 43.519525, 5.61209 43.519525, 5.61209 43.565225, 5.54888 43.565225, 5.54888 43.519525))"; BoundingBox bbox = GeometryService.GetBoundingBox(bboxWKT); Assert.NotNull(bbox); Assert.Equal(bboxWKT, bbox.WKT); HeightMap heightMap = _elevationService.GetHeightMap(ref bbox, dataset); heightMap = heightMap.ReprojectGeodeticToCartesian().BakeCoordinates(); Assert.True(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); heightMap = heightMap.ZScale(2.5f).BakeCoordinates(); Assert.True(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); heightMap = heightMap.CenterOnOrigin().BakeCoordinates(); Assert.True(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); heightMap = heightMap.FitInto(30f).BakeCoordinates(); Assert.True(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); }
public void BoudingBoxConservationTest() { string bboxWKT = "POLYGON((5.54888 43.519525, 5.61209 43.519525, 5.61209 43.565225, 5.54888 43.565225, 5.54888 43.519525))"; BoundingBox bbox = GeometryService.GetBoundingBox(bboxWKT); Assert.NotNull(bbox); Assert.Equal(bboxWKT, bbox.WKT); HeightMap heightMap = _elevationService.GetHeightMap(bbox, DEMDataSet.SRTM_GL1); heightMap = heightMap.ReprojectGeodeticToCartesian().BakeCoordinates(); Assert.True(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); heightMap = heightMap.ZScale(2.5f).BakeCoordinates(); Assert.True(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); heightMap = heightMap.CenterOnOrigin().BakeCoordinates(); Assert.True(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); heightMap = heightMap.FitInto(30f).BakeCoordinates(); Assert.True(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); }