org.geotools.renderer.lite.gridcoverage2d
Class GridCoverageRenderer

Object
  extended by GridCoverageRenderer

public final class GridCoverageRenderer
extends Object

A helper class for rendering GridCoverage objects.

Author:
Simone Giannecchini, GeoSolutions SAS, Andrea Aime, GeoSolutions SAS, Alessio Fabiani, GeoSolutions SAS

Constructor Summary
GridCoverageRenderer(CoordinateReferenceSystem destinationCRS, Envelope envelope, Rectangle screenSize, AffineTransform worldToScreen)
          Creates a new GridCoverageRenderer object.
GridCoverageRenderer(CoordinateReferenceSystem destinationCRS, Envelope envelope, Rectangle screenSize, AffineTransform worldToScreen, RenderingHints hints)
          Creates a new GridCoverageRenderer object.
 
Method Summary
 void paint(Graphics2D graphics, GridCoverage2D gridCoverage, RasterSymbolizer symbolizer)
          Paint this grid coverage.
 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
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridCoverageRenderer

public GridCoverageRenderer(CoordinateReferenceSystem destinationCRS,
                            Envelope envelope,
                            Rectangle screenSize,
                            AffineTransform worldToScreen)
                     throws TransformException,
                            NoninvertibleTransformException
Creates a new GridCoverageRenderer object.

Parameters:
destinationCRS - the CRS of the GridCoverage2D to render.
envelope - delineating the area to be rendered.
screenSize - at which we want to rendere the source GridCoverage2D.
worldToScreen - if not null and if it contains a rotation, this Affine Tranform is used directly to convert from world coordinates to screen coordinates. Otherwise, a standard GridToEnvelopeMapper is used to calculate the affine transform.
Throws:
TransformException
NoninvertibleTransformException

GridCoverageRenderer

public GridCoverageRenderer(CoordinateReferenceSystem destinationCRS,
                            Envelope envelope,
                            Rectangle screenSize,
                            AffineTransform worldToScreen,
                            RenderingHints hints)
                     throws TransformException,
                            NoninvertibleTransformException
Creates a new GridCoverageRenderer object.

Parameters:
destinationCRS - the CRS of the GridCoverage2D to render.
envelope - delineating the area to be rendered.
screenSize - at which we want to rendere the source GridCoverage2D.
worldToScreen - if not null and if it contains a rotation, this Affine Tranform is used directly to convert from world coordinates to screen coordinates. Otherwise, a standard GridToEnvelopeMapper is used to calculate the affine transform.
hints - RenderingHints to control this rendering process.
Throws:
TransformException
NoninvertibleTransformException
Method Detail

renderImage

public RenderedImage renderImage(GridCoverage2D gridCoverage,
                                 RasterSymbolizer symbolizer,
                                 Interpolation interpolation,
                                 Color background,
                                 int tileSizeX,
                                 int tileSizeY)
                          throws FactoryException,
                                 TransformException,
                                 NoninvertibleTransformException
Turns the coverage into a rendered image applying the necessary transformations and the symbolizer

Parameters:
gridCoverage -
symbolizer -
Returns:
The transformed image, or null if the coverage does not lie within the rendering bounds
Throws:
FactoryException
TransformException
NoninvertibleTransformException

paint

public void paint(Graphics2D graphics,
                  GridCoverage2D gridCoverage,
                  RasterSymbolizer symbolizer)
           throws FactoryException,
                  TransformException,
                  NoninvertibleTransformException
Paint this grid coverage. The caller must ensure that graphics has an affine transform mapping "real world" coordinates in the coordinate system given by #getCoordinateSystem.

Parameters:
graphics - the Graphics2D context in which to paint.
metaBufferedEnvelope -
Throws:
FactoryException
TransformException
NoninvertibleTransformException
Exception
UnsupportedOperationException - if the transformation from grid to coordinate system in the GridCoverage is not an AffineTransform


Copyright © 1996-2014 Geotools. All Rights Reserved.