Commit 7a123ad6 authored by Steve Ikeoka's avatar Steve Ikeoka Committed by Andrea Aime
Browse files

[GEOS-7352] Fix for WMS GetMap error against a raster layer with a rendering...

[GEOS-7352] Fix for WMS GetMap error against a raster layer with a rendering transformation when out of the layer's bounding box.
parent d236b9e3
......@@ -1027,11 +1027,11 @@ public class RenderedImageMapOutputFormat extends AbstractMapOutputFormat {
coverage = readBestCoverage(reader, params,
ReferencedEnvelope.reference(readGG.getEnvelope()),
readGG.getGridRange2D(), interpolation, readerBgColor);
// Nothing found, we return a constant image with background value
if (coverage == null) {
// we're outside of the coverage definition area, return an empty space
image = createBkgImage(mapWidth, mapHeight, bgColor, null);
}
}
// Nothing found, we return a constant image with background value
if (coverage == null) {
// we're outside of the coverage definition area, return an empty space
image = createBkgImage(mapWidth, mapHeight, bgColor, null);
}
// If the image has not already been prepared, we render the image using the
// GridCoverageRenderer
......
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
......@@ -254,6 +254,18 @@ public class GetMapIntegrationTest extends WMSTestSupport {
assertTrue(color.getRed() + color.getGreen() + color.getBlue() > (250 * 3));
}
@Test
public void testRasterRenderingTxOutOfBbox() throws Exception {
String layer = getLayerId(MockData.USA_WORLDIMG);
String url = "wms?service=WMS&VERSION=1.1.1&request=GetMap&styles=crop_raster"
+ "&format=image/png&layers=" + layer + "&WIDTH=100&HEIGHT=100"
+ "&srs=epsg:4326&BBOX=-120,40,-115,45";
BufferedImage image = getAsImage(url, "image/png");
Color color = getPixelColor(image, 25, 25);
// the color is white, or white-ish
assertTrue(color.getRed() + color.getGreen() + color.getBlue() > (250 * 3));
}
@Test
public void testGetMapWithPropertyStyle() throws Exception {
Properties props = new Properties();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment