Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for 4-band raster data with GdalLayer #1414

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import static java.awt.color.ColorSpace.CS_sRGB;
import static java.awt.image.DataBuffer.TYPE_BYTE;
import static org.deegree.commons.utils.TunableParameter.get;
import static org.deegree.cs.components.Axis.AO_EAST;
import static org.deegree.cs.components.Axis.AO_WEST;
import static org.gdal.gdalconst.gdalconstConstants.CE_None;
Expand Down Expand Up @@ -81,6 +82,8 @@ class GdalLayerData implements LayerData {

private static final Logger LOG = getLogger( GdalLayerData.class );

private static final boolean DEFAULT_LIMIT_BANDS = get( "deegree.gdal.layer.limit_bands", false );

private final List<File> datasets;

private final Envelope bbox;
Expand Down Expand Up @@ -119,7 +122,7 @@ private BufferedImage extractRegionFromGdalFiles( Envelope bbox ) {
return null;
}
byte[][] bytes = compose( regions );
return toImage( bytes, width, height, true );
return toImage( bytes, width, height, DEFAULT_LIMIT_BANDS );
}

private BufferedImage extractAndReprojectRegion( ICRS nativeCrs ) {
Expand All @@ -135,7 +138,7 @@ private BufferedImage extractAndReprojectRegion( ICRS nativeCrs ) {
byte[][] rawImage = readBands( reprojectedRegion );
nativeRegion.delete();
reprojectedRegion.delete();
return toImage( rawImage, width, height, true );
return toImage( rawImage, width, height, DEFAULT_LIMIT_BANDS );
}

private Dataset reproject( Dataset src, String dstCrsWkt ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ f

|deegree.sqldialect.oracle.optimized_point_storage |java.lang.Boolean |true |Use optimized point storage for 2D points in oracle database.

|deegree.gdal.layer.limit_bands |java.lang.Boolean |false |If problems occur with data using four bands (e.g. including transparency or infrared), this option can be used to limit data access to the first three bands.

|deegree.cache.svgrenderer |java.lang.Integer |256 |Maximum number of rendered SVG images to be cached for speed

|deegree.rendering.svg-to-shape.previous |java.lang.Boolean |false |Enables the behavior of previously used versions when scaling SVG graphics for the rendering of strokes
Expand Down