public final class GridCoverageRenderer extends Object
GridCoverage
objects.Modifier and Type | Field and Description |
---|---|
static String |
KEY_COMPOSITING |
static Hints.Key |
PADDING
Hint's KEY specifying a custom padding
|
static String |
PARENT_COVERAGE_PROPERTY |
Constructor and Description |
---|
GridCoverageRenderer(CoordinateReferenceSystem destinationCRS,
Envelope envelope,
Rectangle screenSize,
AffineTransform worldToScreen)
Creates a new
GridCoverageRenderer object. |
GridCoverageRenderer(CoordinateReferenceSystem destinationCRS,
Envelope envelope,
Rectangle screenSize,
AffineTransform worldToScreen,
RenderingHints newHints)
Creates a new
GridCoverageRenderer object. |
Modifier and Type | Method and Description |
---|---|
boolean |
isAdvancedProjectionHandlingEnabled()
Tests if advanced projection handling is enabled (read all areas needed to make up the
requested map, cut them to areas where reprojection makes sense, and so on).
|
static boolean |
isBandsSelectionApplicable(GridCoverageReader reader,
RasterSymbolizer symbolizer)
Checks if band selection is present, and can be delegated down to the reader
|
boolean |
isWrapEnabled()
Returns true if map wrapping is enabled (active only when rendering off a
GridCoverage2DReader and when advanced projection handling has been enabled too) |
void |
paint(Graphics2D graphics,
GridCoverage2D gridCoverage,
RasterSymbolizer symbolizer)
Paint this grid coverage.
|
void |
paint(Graphics2D graphics,
GridCoverage2D gridCoverage,
RasterSymbolizer symbolizer,
double[] bkgValues)
Paint this grid coverage.
|
void |
paint(Graphics2D graphics,
GridCoverage2DReader gridCoverageReader,
GeneralParameterValue[] readParams,
RasterSymbolizer symbolizer,
Interpolation interpolation,
Color background)
Paint the coverage read from the reader (using advanced projection handling).
|
RenderedImage |
renderImage(GridCoverage2D gridCoverage,
RasterSymbolizer symbolizer,
double[] bkgValues)
Turns the coverage into a rendered image applying the necessary transformations and the
symbolizer
Builds a (RenderedImage, AffineTransform) pair that can be used for rendering onto a
Graphics2D or as the basis to build a final image. |
RenderedImage |
renderImage(GridCoverage2D gridCoverage,
RasterSymbolizer symbolizer,
Interpolation interpolation,
Color background,
int tileSizeX,
int tileSizeY)
Turns the coverage into a rendered image applying the necessary transformations and the
symbolizer
|
RenderedImage |
renderImage(GridCoverage2DReader reader,
GeneralParameterValue[] readParams,
RasterSymbolizer symbolizer,
Interpolation interpolation,
Color background,
int tileSizeX,
int tileSizeY) |
void |
setAdvancedProjectionHandlingEnabled(boolean enabled)
Enables/disables advanced projection handling (read all areas needed to make up the requested
map, cut them to areas where reprojection makes sense, and so on).
|
static RasterSymbolizer |
setupSymbolizerForBandsSelection(RasterSymbolizer symbolizer)
Takes into account that the band selection has been delegated down to the reader by producing
a new channel selection
|
void |
setWrapEnabled(boolean wrapEnabled)
Enables/disable map wrapping (active only when rendering off a
GridCoverage2DReader
and when advanced projection handling has been enabled too) |
public static final String PARENT_COVERAGE_PROPERTY
public static final Hints.Key PADDING
public static final String KEY_COMPOSITING
public GridCoverageRenderer(CoordinateReferenceSystem destinationCRS, Envelope envelope, Rectangle screenSize, AffineTransform worldToScreen) throws TransformException, NoninvertibleTransformException
GridCoverageRenderer
object.destinationCRS
- the CRS of the GridCoverage2D
to render.envelope
- delineating the area to be rendered.screenSize
- at which we want to render the source GridCoverage2D
.worldToScreen
- if not null
and if it contains a rotation, this Affine
Transform is used directly to convert from world coordinates to screen coordinates.
Otherwise, a standard GridToEnvelopeMapper
is used to calculate the affine
transform.TransformException
NoninvertibleTransformException
public GridCoverageRenderer(CoordinateReferenceSystem destinationCRS, Envelope envelope, Rectangle screenSize, AffineTransform worldToScreen, RenderingHints newHints) throws TransformException, NoninvertibleTransformException
GridCoverageRenderer
object.destinationCRS
- the CRS of the GridCoverage2D
to render.envelope
- delineating the area to be rendered.screenSize
- at which we want to render the source GridCoverage2D
.worldToScreen
- if not null
and if it contains a rotation, this Affine
Transform is used directly to convert from world coordinates to screen coordinates.
Otherwise, a standard GridToEnvelopeMapper
is used to calculate the affine
transform.newHints
- RenderingHints
to control this rendering process.TransformException
NoninvertibleTransformException
public void setWrapEnabled(boolean wrapEnabled)
GridCoverage2DReader
and when advanced projection handling has been enabled too)public boolean isWrapEnabled()
GridCoverage2DReader
and when advanced projection handling has been enabled too)public void setAdvancedProjectionHandlingEnabled(boolean enabled)
GridCoverage2DReader
.public boolean isAdvancedProjectionHandlingEnabled()
GridCoverage2DReader
.public RenderedImage renderImage(GridCoverage2D gridCoverage, RasterSymbolizer symbolizer, double[] bkgValues) throws Exception
Builds a (RenderedImage, AffineTransform) pair that can be used for rendering onto a
Graphics2D
or as the basis to build a final image. Will return null if there is
nothing to render.
Exception
public RenderedImage renderImage(GridCoverage2D gridCoverage, RasterSymbolizer symbolizer, Interpolation interpolation, Color background, int tileSizeX, int tileSizeY) throws FactoryException, TransformException, NoninvertibleTransformException
FactoryException
TransformException
NoninvertibleTransformException
public RenderedImage renderImage(GridCoverage2DReader reader, GeneralParameterValue[] readParams, RasterSymbolizer symbolizer, Interpolation interpolation, Color background, int tileSizeX, int tileSizeY) throws FactoryException, TransformException, NoninvertibleTransformException, IOException
public void paint(Graphics2D graphics, GridCoverage2D gridCoverage, RasterSymbolizer symbolizer) throws Exception
graphics
has an affine
transform mapping "real world" coordinates in the coordinate system given by #getCoordinateSystem
.graphics
- the Graphics2D
context in which to paint.UnsupportedOperationException
- if the transformation from grid to coordinate system in
the GridCoverage is not an AffineTransformException
public void paint(Graphics2D graphics, GridCoverage2D gridCoverage, RasterSymbolizer symbolizer, double[] bkgValues) throws Exception
graphics
has an affine
transform mapping "real world" coordinates in the coordinate system given by #getCoordinateSystem
.graphics
- the Graphics2D
context in which to paint.UnsupportedOperationException
- if the transformation from grid to coordinate system in
the GridCoverage is not an AffineTransformException
public void paint(Graphics2D graphics, GridCoverage2DReader gridCoverageReader, GeneralParameterValue[] readParams, RasterSymbolizer symbolizer, Interpolation interpolation, Color background) throws Exception
graphics
has an affine transform mapping "real world" coordinates in
the coordinate system given by #getCoordinateSystem
.graphics
- the Graphics2D
context in which to paint.UnsupportedOperationException
- if the transformation from grid to coordinate system in
the GridCoverage is not an AffineTransformException
public static RasterSymbolizer setupSymbolizerForBandsSelection(RasterSymbolizer symbolizer)
public static boolean isBandsSelectionApplicable(GridCoverageReader reader, RasterSymbolizer symbolizer)
Copyright © 1996–2023 Geotools. All rights reserved.