|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectBuilder<GridCoverage>
GridCoverageBuilder
public class GridCoverageBuilder
Helper class for the creation of GridCoverage2D instances. This builder can creates the
parameters to be given to grid coverage constructor
from simpler parameters given to this builder.
The builder supports the following properties:
| Properties | Can be set from | Default value |
|---|---|---|
crs |
CRS instance or authority code | From hints |
envelope |
Envelope instance or ordinate values | |
extent |
Grid envelope instance or spans | Image width and height |
pixelAnchor |
Code list value | Pixel center |
gridToCRS |
Transform instance or affine transform coefficients | Computed from the above |
gridGeometry |
Grid geometry instance | Computed from the above |
numBands |
Positive integer | 1 |
Variable.name |
Character sequence | |
Variable.unit |
Unit instance or unit symbol | |
Variable.sampleRange |
Range instance or lower and upper values | |
Variable.sampleToUnit |
Transform instance or coefficients | Identity |
Variable.colors |
Colors array or palette name | |
Variable.sampleDimension |
Sample dimension instance or array | Computed from the above |
| Tile layout | Tile size and/or tile grid offset | |
image |
Image, raster, matrix or function | Empty image |
sources |
Array of grid coverages | |
properties |
Map of properties |
Envelope vs grid to CRS transform
The preferred way to define the geographic location of a grid coverage is to
specify the grid to CRS transform or the
grid geometry. However as a convenience,
this builder also accepts envelopes. In such case,
this builder assumes that axis order in the supplied image matches exactly axis order in
the supplied envelope. In other words, in the usual case where axis order in the image is
(column, row), then the envelope should probably have a
(longitude, latitude) or (easting, northing)
axis order.
An exception to the above rule applies for CRS using exactly the following axis order:
(NORTH|SOUTH,
EAST|WEST).
An example of such CRS is EPSG:4326. This builder will interchange automatically the
(y,x) axes for those CRS.
See GridToEnvelopeMapper for more information
about the heuristic rules. If more control on axis order and direction reversal is wanted, specify
explicitely the grid to CRS transform or the grid geometry instead than
an envelope.
Examples
Creates a grid coverage from the specified image and
envelope. An affine transform will
be computed automatically from the specified envelope using heuristic rules described
in the above javadoc.
GridCoverageBuilder builder = new GridCoverageBuilder();
builder.setName("My coverage"); // Optional
builder.setEnvelope(envelope);
builder.setRenderedImage(image);
GridCoverage2D coverage = builder.getGridCoverage2D();
Creates a grid coverage from the specified image and
grid to CRS transform. In this example,
the pixels size is 1000×1000 metres and the CRS is Mercator ("EPSG:3395").
The envelope will be inferred from the grid geometry.
GridCoverageBuilder builder = new GridCoverageBuilder();
builder.setName("My coverage"); // Optional
builder.setCoordinateReferenceSystem("EPSG:3395");
builder.setGridToCRS(AffineTransform.getScaleInstance(1000, -1000));
builder.setSampleDimensions(myFirstBand, mySecondBand); // Optional
builder.setRenderedImage(image);
GridCoverage2D coverage = builder.getGridCoverage2D();
Creates a 600×400 pixels image from -40°S to 40°N and -60°W to 60°E.
Uses the 0 pixel value for "no data", and pixel values in the
[1…255] range for elevation values in metres. Then draw something on
the image using Java2D API:
GridCoverageBuilder builder = new GridCoverageBuilder();
builder.setCoordinateReferenceSystem("CRS:84");
builder.setEnvelope(-60, -40, 60, 40);
builder.setExtent(600, 400);
// Use sample values in the range 1 inclusive to 255 exclusive
// and define elevation in metres as (sample value) / 10.
builder.variable(0).setName("Elevation");
builder.variable(0).setUnit(SI.METRE);
builder.variable(0).setSampleRange(1, 256);
builder.variable(0).setLinearTransform(0.1, 0);
builder.variable(0).addNodataValue("No data", 0, Color.GRAY);
// Gets a 600×400 pixels (the extent) image, then draw something on it.
Graphics2D gr = (Graphics2D) builder.createGraphics();
gr.draw(...);
gr.dispose();
// Gets the coverage.
GridCoverage2D coverage = builder.getGridCoverage2D();
| coverage/geotk-coverage (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
class |
GridCoverageBuilder.Variable
Helper class for the creation of SampleDimension instances. |
| Field Summary | |
|---|---|
protected CoordinateReferenceSystem |
crs
The coordinate reference system, or null if unspecified. |
protected Envelope |
envelope
The envelope, including coordinate reference system, or null if unspecified. |
protected GridEnvelope |
extent
The grid extent, or null if unspecified. |
protected GridGeometry |
gridGeometry
The grid geometry, or null if unspecified. |
protected MathTransform |
gridToCRS
The grid to CRS transform, or null if unspecified. |
protected Hints |
hints
Optional hints for fetching factories, or null if none. |
protected RenderedImage |
image
The rendered image, or null if not yet computed. |
protected CharSequence |
name
The coverage name, or null if unspecified. |
protected int |
numBands
Number of bands (sample dimensions), or 0 if unspecified. |
protected PixelInCell |
pixelAnchor
Whatever the gridToCRS transform maps pixel center or pixel corner. |
protected Map<?,?> |
properties
An optional map of properties to be associated with the grid coverage, or null if none. |
protected GridCoverage[] |
sources
An optional array of sources to be associated with the grid coverage, or null if none. |
| Constructor Summary | |
|---|---|
GridCoverageBuilder()
Creates a uninitialized builder. |
|
GridCoverageBuilder(Hints hints)
Creates a uninitialized builder using the given hints. |
|
| Method Summary | |
|---|---|
GridCoverage |
build()
Creates the grid coverage. |
Graphics |
createGraphics(boolean crsUnit)
Creates a graphics which can be used to draw into the rendered image. |
AffineTransform |
getAffineGridToCRS()
Returns two-dimensional part of the current grid to CRS affine transform. |
ColorModel |
getColorModel()
Returns or computes the image color model. |
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the current coordinate reference system. |
Envelope |
getEnvelope()
Returns the current envelope. |
GridEnvelope |
getExtent()
Returns the current grid extent. |
GridCoverage2D |
getGridCoverage2D()
Returns the grid coverage. |
GridGeometry |
getGridGeometry()
Returns the current grid geometry. |
MathTransform |
getGridToCRS()
Returns the current grid to CRS transform. |
Rectangle |
getImageBounds()
Returns the image bounds. |
CharSequence |
getName()
Returns the coverage name. |
int |
getNumBands()
Returns the number of sample dimensions (bands). |
PixelInCell |
getPixelAnchor()
Returns whatever the grid to CRS transform maps pixel center or pixel corner. |
Map<?,?> |
getProperties()
Returns optional properties to be given to the coverage, or null if none. |
RenderedImage |
getRenderedImage()
Returns the rendered image to be wrapped by GridCoverage2D. |
SampleDimension[] |
getSampleDimensions()
Returns the sample dimensions, or null if none. |
GridCoverage[] |
getSources()
Returns the optional sources to be associated with the coverage. |
Point |
getTileGridOffset()
Returns the tile grid offset, or null if the image is untiled. |
Dimension |
getTileSize()
Returns the tile size, or null if the image is untiled. |
protected GridCoverageBuilder.Variable |
newVariable(int band)
Invoked by the variable(int) method when a new variable need to be created. |
void |
reset()
Resets this builder to its initial state. |
void |
setCoordinateReferenceSystem(CoordinateReferenceSystem crs)
Sets the coordinate reference system to the specified value. |
void |
setCoordinateReferenceSystem(String code)
Sets the coordinate reference system to the specified authority code. |
void |
setEnvelope(double... ordinates)
Sets the envelope to the specified values, which must be the lower corner coordinates followed by upper corner coordinates. |
void |
setEnvelope(Envelope envelope)
Sets the envelope to the specified value. |
void |
setExtent(GridEnvelope extent)
Sets the grid extent to the specified value. |
void |
setExtent(int... span)
Sets the grid extent to a grid envelope having the given span. |
void |
setGridCoverage(GridCoverage coverage)
Configure this builder to the same values than the given coverage. |
void |
setGridGeometry(GridGeometry geom)
Sets the grid geometry to the given value. |
void |
setGridToCRS(AffineTransform gridToCRS)
Sets the grid to CRS transform from a Java2D transform. |
void |
setGridToCRS(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
Sets the grid to CRS transform from the given affine transform coefficients. |
void |
setGridToCRS(MathTransform gridToCRS)
Sets the grid to CRS transform. |
void |
setGridToCRS(Matrix gridToCRS)
Sets the grid to CRS transform from a matrix. |
void |
setName(CharSequence name)
Sets the coverage name. |
void |
setNumBands(int n)
Sets the number of sample dimensions (bands). |
void |
setPixelAnchor(PixelInCell anchor)
Sets the whatever the grid to CRS transform maps pixel center or pixel corner. |
void |
setProperties(Map<?,?> properties)
Sets the optional properties to be given to the coverage. |
void |
setProperties(PropertySource source)
Inherits all the properties from the given source. |
void |
setRenderedImage(float[][] matrix)
Creates a rendered image from the given matrix. |
void |
setRenderedImage(ImageFunction function)
Creates a rendered image from the given image function. |
void |
setRenderedImage(RenderedImage image)
Sets the rendered image. |
void |
setRenderedImage(WritableRaster raster)
Creates a rendered image from the given raster. |
void |
setSampleDimensions(double[] minValues,
double[] maxValues,
Unit<?> units,
Color[]... colors)
Sets all variables information to the given ranges, units and colors. |
void |
setSampleDimensions(SampleDimension... bands)
Sets all sample dimensions. |
void |
setSources(GridCoverage... sources)
Sets the optional sources to be associated with the coverage. |
void |
setTileGridOffset(Point offset)
Sets the tile offset. |
void |
setTileSize(Dimension size)
Sets the tile size. |
GridCoverageBuilder.Variable |
variable(int band)
Returns the sample dimension builder for the given band index. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CharSequence name
null if unspecified. This field is non-null only if the name
has been explicitely specified by the user. The values
inferred from other attributes are not stored in this field.
getName(),
setName(CharSequence)protected CoordinateReferenceSystem crs
null if unspecified. This field is non-null only
if the CRS has been explicitely specified by the user. The values inferred from other attributes are not stored
in this field.
getCoordinateReferenceSystem(),
setCoordinateReferenceSystem(CoordinateReferenceSystem),
setCoordinateReferenceSystem(String)protected Envelope envelope
null if unspecified. This
field is non-null only if the envelope has been explicitely
specified by the user. The values inferred from other attributes are not stored in this field.
getEnvelope(),
setEnvelope(Envelope),
setEnvelope(double[])protected GridEnvelope extent
null if unspecified. This field is non-null only if the extent
has been explicitely specified by the user. The values
inferred from other attributes are not stored in this field.
getExtent(),
setExtent(GridEnvelope),
setExtent(int[])protected MathTransform gridToCRS
null if unspecified. This field is non-null
only if the transform has been explicitely specified
by the user. The values inferred from other attributes are not stored in this field.
getGridToCRS(),
setGridToCRS(MathTransform),
setGridToCRS(double, double, double, double, double, double)protected PixelInCell pixelAnchor
gridToCRS transform maps pixel center or pixel corner. This field is
non-null only if it has been explicitely specified
by the user. The values inferred from other attributes are not stored in this field.
getPixelAnchor(),
setPixelAnchor(PixelInCell)protected GridGeometry gridGeometry
null if unspecified. This field is non-null only if the grid
geometry has been explicitely specified by the
user. The values inferred from other attributes are not stored in this field.
getGridGeometry(),
setGridGeometry(GridGeometry)protected int numBands
getNumBands(),
setNumBands(int)protected RenderedImage image
null if not yet computed. This image can either be
specified explicitely by the user or
created from other properties.
The preferred implementation class is BufferedImage. However in some cases this
builder may instantiate other kind of images, like TiledImage.
getRenderedImage(),
setRenderedImage(RenderedImage)protected GridCoverage[] sources
null if none. Those sources will be given to the
grid coverage constructor without
any processing by this class.
getSources(),
setSources(GridCoverage[])protected Map<?,?> properties
null if none. Those properties will be given to the
grid coverage constructor without
any processing by this builder class.
getProperties(),
setProperties(Map)protected final Hints hints
null if none. Those hints can be
specified at builder construction time.
| Constructor Detail |
|---|
public GridCoverageBuilder()
null.
public GridCoverageBuilder(Hints hints)
Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM - The CRS to use when none is
explicitely set.Hints.SAMPLE_DIMENSION_TYPE - specifies the SampleDimensionType to be
used at rendering time, which can be one of UNSIGNED_8BITS or UNSIGNED_16BITS.Hints.TILE_ENCODING - controls the compression to use for the serialization
of GridCoverage2D instances.
hints - Optional hints for fetching factories, or null if none.| Method Detail |
|---|
public CharSequence getName()
setName(CharSequence).Variable.getName().As a consequence of the above, the coverage name will be the name of the first sample dimension, unless a coverage name is explicitely given.
null.AbstractCoverage.getName()public void setName(CharSequence name)
String or InternationalString instance.
name - The new name, or null.public CoordinateReferenceSystem getCoordinateReferenceSystem()
setCoordinateReferenceSystem(CoordinateReferenceSystem).Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM.
null if unspecified and can not be inferred.crs,
Envelope.getCoordinateReferenceSystem(),
GeneralGridGeometry.getCoordinateReferenceSystem(),
AbstractCoverage.getCoordinateReferenceSystem()
public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs)
throws IllegalArgumentException
Precedence
If a grid geometry has been explicitely set
and contains a CRS, then
that later CRS will have precedence for the creation of GridCoverage2D instances.
crs - The new CRS to use, or null.
IllegalArgumentException - if the given CRS is illegal for the
current envelope.crs,
Envelopes.transform(Envelope, CoordinateReferenceSystem)
public void setCoordinateReferenceSystem(String code)
throws IllegalArgumentException
SeesetCoordinateReferenceSystem(CRS.decode(code, true));
setCoordinateReferenceSystem(CoordinateReferenceSystem) for information about
precedence.
code - The authority code of the CRS to use, or null.
IllegalArgumentException - if the given authority code is illegal.crs,
CRS.decode(String, boolean)public Envelope getEnvelope()
setEnvelope(Envelope).
null if unspecified and can not be inferred.envelope,
GeneralGridGeometry.getEnvelope(),
GridCoverage2D.getEnvelope()
public void setEnvelope(Envelope envelope)
throws IllegalArgumentException
This method is not recommended, since the creation of a grid coverage from an envelope implies some arbitrary choices. Those arbitrary choices are implemented as heuristic rules documented in this class javadoc. The recommended usage is to specify the grid to CRS transform or the grid geometry instead, and specify an envelope only when the other information are not available.
Precedence
If a grid geometry has been explicitely set
and contains an envelope, then that later
envelope will have precedence for the creation of GridCoverage2D instances.
envelope - The new envelope to use, or null.
IllegalArgumentException - if the envelope is illegal for the CRS.envelope,
Envelopes.transform(Envelope, CoordinateReferenceSystem)
public void setEnvelope(double... ordinates)
throws IllegalArgumentException
Example: (xmin, ymin, zmin, xmax, ymax, zmax)See
setEnvelope(Envelope) for information about recommended practices and
precedence.
ordinates - The ordinates of the new envelope to use, or null.
IllegalArgumentException - if the envelope is illegal.public GridEnvelope getExtent()
setExtent(GridEnvelope).
null if unspecified and can not be inferred.extent,
GeneralGridGeometry.getExtent(),
Grid.getExtent()
public void setExtent(GridEnvelope extent)
throws MismatchedDimensionException
Precedence
If a grid geometry has been explicitely set
and contains an extent, then that later extent
will have precedence for the creation of GridCoverage2D instances.
extent - The new grid extent to use, or null.
MismatchedDimensionException - If the extent dimension is not equal to the
grid to CRS source dimensions.
public void setExtent(int... span)
throws MismatchedDimensionException
This method is typically invoked for defining image dimension as below:
SeesetExtent(width, height);
setExtent(GridEnvelope) for information about precedence.
span - The span values for all dimensions, or null.
MismatchedDimensionException - If the arguments contain negative span values, or the
number of values is not equal to the grid to CRS source dimensions.
public AffineTransform getAffineGridToCRS()
throws IllegalStateException
getGridToCRS() method,
except that it tries to extract only the two-dimensional component of that transform.
Whatever the returned transform maps pixel centers or pixel corners depends on the
pixelAnchor value.
null if unspecified and can not
be inferred.
IllegalStateException - If a transform exists but that transform is not affine.public MathTransform getGridToCRS()
setGridToCRS(MathTransform).
Whatever the returned transform maps pixel centers or pixel corners depends on the
pixelAnchor value.
null if unspecified and can not
be inferred.gridToCRS,
GeneralGridGeometry.getGridToCRS()
public void setGridToCRS(MathTransform gridToCRS)
throws MismatchedDimensionException
pixelAnchor value.
Restrictions
Precedence
If a grid geometry has been explicitely set
and contains a transform, then that later
transform will have precedence for the creation of GridCoverage2D instances.
gridToCRS - The new grid to CRS transform, or null.
MismatchedDimensionException - If the given transform is invalid, for example if the
dimensions don't match.
public void setGridToCRS(Matrix gridToCRS)
throws MismatchedDimensionException
pixelAnchor value.
See setGridToCRS(MathTransform) for information about restrictions and precedence.
gridToCRS - The new grid to CRS transform, or null.
MismatchedDimensionException - If the current extent and
envelope (if any) are not two-dimensional.
public void setGridToCRS(AffineTransform gridToCRS)
throws MismatchedDimensionException
pixelAnchor value.
See setGridToCRS(MathTransform) for information about restrictions and precedence.
gridToCRS - The new grid to CRS transform, or null.
MismatchedDimensionException - If the current extent and
envelope (if any) are not two-dimensional.
public void setGridToCRS(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
throws MismatchedDimensionException
pixelAnchor
value.
See setGridToCRS(MathTransform) for information about restrictions and precedence.
m00 - the X coordinate scaling.m10 - the Y coordinate shearing.m01 - the X coordinate shearing.m11 - the Y coordinate scaling.m02 - the X coordinate translation.m12 - the Y coordinate translation.
MismatchedDimensionException - If the current extent and
envelope (if any) are not two-dimensional.AffineTransform2Dpublic PixelInCell getPixelAnchor()
PixelInCell.CELL_CENTER.pixelAnchor,
GeneralGridGeometry.GeneralGridGeometry(GridEnvelope, PixelInCell, MathTransform, CoordinateReferenceSystem)public void setPixelAnchor(PixelInCell anchor)
gridToCRS attribute
is not used (for example because the gridGeometry attribute has precedence).
anchor - The new "pixel in cell" policy, or null.public GridGeometry getGridGeometry()
| Recommended | Alternative | |
|---|---|---|
| or |
Note that creation of grid geometries from the parameters listed in the right column use heuristic rules documented here. In order to keep grid geometry creations more determinist, we recommend to specify the parameters listed in the left column instead.
null if unspecified and can not be inferred.gridGeometry,
GridCoverage2D.getGridGeometry()public void setGridGeometry(GridGeometry geom)
Note: If this property is set tonullin the intend to force computation of a new grid geometry from theenvelopevalue, then the caller will also needs to ensure that thegridToCRSproperty isnull.
geom - The new grid geometry, or null.public int getNumBands()
setNumBands(int).variable(int).
numBands,
SampleModel.getNumBands()
public void setNumBands(int n)
throws IllegalArgumentException
n - Number of sample dimensions, or 0 to unspecify.
IllegalArgumentException - If the given value is negative.
public GridCoverageBuilder.Variable variable(int band)
throws IllegalArgumentException
Variable instance exists at the given index, it will be
returned. Otherwise a new instance will be created.
If the given band index is equals or greater than the number of sample dimensions, then the later will be increased as needed.
band - The index of the sample dimension for which to get the variable.
IllegalArgumentException - If the given band index is negative.protected GridCoverageBuilder.Variable newVariable(int band)
variable(int) method when a new variable need to be created.
This method is a hook for subclasses that wish to instantiate their own
Variable subclasses. The default implementation is:
return new Variable(band);
band - The index of the sample dimension for which to get the new variable.
public SampleDimension[] getSampleDimensions()
null if none. If all sample dimensions
are actually instances of GridSampleDimension, then the array type is
GridSampleDimension[].
null if none.public void setSampleDimensions(SampleDimension... bands)
setSampleDimension(...)
for each element.
bands - The new sample dimensions, or null.
public void setSampleDimensions(double[] minValues,
double[] maxValues,
Unit<?> units,
Color[]... colors)
setSampleRange(NumberRange),
setUnit(Unit) and setColors(Color[]) methods for each variable.
minValues - The minimal value for each band in the raster, or null.maxValues - The maximal value for each band in the raster, or null.units - The units, or null if unknown.colors - The colors to use for values from minValues to maxValues
for each bands, or null. Can contains null elements.public ColorModel getColorModel()
getColorModel(...) methods invoked on the first GridSampleDimension instance
returned by getSampleDimensions().
null if none.
public Graphics createGraphics(boolean crsUnit)
throws UnsupportedOperationException
Graphics.dispose() after
the drawing has been completed.
The returned value can usually be casted to Graphics2D.
crsUnit - true for drawing using the coverage units (typically metres or
degrees of longitude/latitude), or false for drawing using pixel units.
The value of true is supported only for Graphics2D instances.
Graphics2D) for drawing into the image.
UnsupportedOperationException - If the rendered image does not support drawing,
or if crsUnit is true and the graphics is not an instance of
Graphics2D.
public Rectangle getImageBounds()
throws InvalidGridGeometryException
Note that the (x,y) origin must be
(0,0) for building a BufferedImage, but can be different for other kinds of
RenderedImage.
null since no image can be built
without this information.
InvalidGridGeometryException - if there is no grid geometry or no extent associated to that grid geometry.GridGeometry2D.getExtent2D()public Dimension getTileSize()
null if the image is untiled.
This method returns the first non-null value in the above choices, in preference order:
setTileSize(Dimension).
null if the image is untiled.RenderedImage.getTileWidth(),
RenderedImage.getTileHeight()public void setTileSize(Dimension size)
Precedence
If an image has been explicitely set,
then its tile setting will have precedence over this attribute for the creation of
GridCoverage2D instances (i.e. this method does not retile existing images).
size - The new tile size, or null for untiled image.public Point getTileGridOffset()
null if the image is untiled.
This method returns the first non-null value in the above choices, in preference order:
setTileGridOffset(Point).
null if the image is untiled.RenderedImage.getTileGridXOffset(),
RenderedImage.getTileGridYOffset()public void setTileGridOffset(Point offset)
Precedence
If an image has been explicitely set,
then its tile setting will have precedence over this attribute for the creation of
GridCoverage2D instances (i.e. this method does not retile existing images).
offset - The new tile offset, or null if none.public RenderedImage getRenderedImage()
GridCoverage2D. If no image has been
explicitly defined, a new one is created the
first time this method is invoked. Users can modify the pixel values in this image before
to create the grid coverage.
In the common case of untiled image having a lower corner
located at (0,0), this method returns an instance of BufferedImage. If the builder
settings do not allow the creation of a BufferedImage instance, then the default
implementation fallbacks on a TiledImage instance.
GridCoverage2D.public void setRenderedImage(RenderedImage image)
image - The rendered image to be wrapped by GridCoverage2D, or null.public void setRenderedImage(WritableRaster raster)
BufferedImage using that color model
and the raster, and finally invokes setRenderedImage(RenderedImage) with
the result in argument.
raster - The raster to be wrapped by GridCoverage2D, or null.public void setRenderedImage(float[][] matrix)
setRenderedImage(WritableRaster).
NaN values are mapped to a transparent color by default.
The image height will be the length of the
matrix argument. The image width will
be the length of the largest row. If some rows or missing (null) or shorter
than the image width, then the missing values will be padded with NaN.
matrix - The matrix data in a [row][column] layout.
Can contains null elements (missing rows).public void setRenderedImage(ImageFunction function)
getGridGeometry() method must return a fully defined value before
this method can be invoked.
function - The image function, or null.ImageFunctionDescriptorpublic GridCoverage2D getGridCoverage2D()
return new GridCoverage2D(
getName(),
getRenderedImage(),
getGridGeometry(),
getSampleDimensions(),
getSources(),
getProperties(),
hints)
public void setGridCoverage(GridCoverage coverage)
setName(CharSequence) (for instances of GridCoverage2D only)setRenderedImage(RenderedImage)setGridGeometry(GridGeometry)setGridToCRS(MathTransform)setExtent(GridEnvelope)setCoordinateReferenceSystem(CoordinateReferenceSystem)setSampleDimensions(SampleDimension[])setSources(GridCoverage[])setProperties(PropertySource) (for instances of PropertySource only)
coverage - The coverage to set.public GridCoverage[] getSources()
null.
Implementation note
This method returns a direct reference to the sources field.
The array is not cloned because it is not used for any calculation in this
class. GridCoverageBuilder users are responsible for the content of
this array.
null if none.sources,
AbstractGridCoverage.getSources()public void setSources(GridCoverage... sources)
Implementation note
The given array is not cloned at this method invocation time. The array will be cloned by
the grid coverage constructor. This builder
does nothing but passing the array to that constructor.
sources - Optional grid coverage sources, or null or an empty array if none.public Map<?,?> getProperties()
null if none.
Implementation note
This method returns a direct reference to the properties field.
The map is not cloned because it is not used for any calculation in this class.
GridCoverageBuilder users are responsible for the content of this map.
null.properties,
PropertySourceImpl.getProperties(),
PropertySourceImpl.getPropertyNames()public void setProperties(Map<?,?> properties)
Reference to the given map
The given map is not cloned at this method invocation time. The map will be cloned by
the grid coverage constructor. This builder
does nothing but passing the map to that constructor.
properties - Optional map of coverage properties, or null.public void setProperties(PropertySource source)
Map object, then invokes setProperties(Map).
source - The source from which to get the properties, null.public GridCoverage build()
getGridCoverage2D(),
but future implementations may instantiate different coverage types.
build in class Builder<GridCoverage>public void reset()
GridCoverage2D instances.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||