Class Mosaic
- All Implemented Interfaces:
Serializable
,Operation
This operation does a mosaic of multiple
GridCoverage2D
s. The GridCoverage2D
s can have different
resolutions; the operation will resample them to the same one. The policies for choosing the output resolution are:
- resolution of the FIRST coverage (Default)
- FINE resolution
- COARSE resolution
- resolution of an EXTERNAL GridGeometry
GridCoverage2D
s are in the same CRS, else an exception is
thrown.
The input parameters of the operation are:
- a Collection of the
GridCoverage2D
to mosaic - an optional
GridGeometry
object for setting the final resolution and BoundingBox - an optional
String
indicating the policy to use for choosing the resolution - an optional
double[]
indicating the nodata values to set for the background. Note that the only the first value will be used
- Author:
- Nicola Lagomarsini GesoSolutions S.A.S.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum used for choosing the outputGridGeometry2D
to use and then resampling all theGridCoverage2D
to its resolution.protected static final class
A block of parameters for aGridCoverage2D
processed by theMosaic
operation.Nested classes/interfaces inherited from class OperationJAI
OperationJAI.Parameters
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterDescriptor<Collection>
The parameter descriptor for the Alpha band.static final String
Name for the input Alpha bandsstatic final String
Name for the GG2D parameterstatic final ParameterDescriptor<String>
The parameter descriptor for the GridGeometry choosing policy.static final ParameterDescriptor<GridGeometry>
The parameter descriptor for the GridGeometry to use.static final String
Name for the Output No Data parameterstatic final ParameterDescriptor<double[]>
The parameter descriptor for the Transformation Choice.static final String
Name for the COVERAGE_INDEX parameterstatic final ParameterDescriptor<Collection>
The parameter descriptor for the Sources.static final String
Name for the Sources parameterFields inherited from class OperationJAI
operation, RENDERED_MODE
Fields inherited from class Operation2D
PRIMARY_SOURCE_INDEX, SOURCE_0
Fields inherited from class AbstractOperation
descriptor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RenderedImage
createRenderedImage
(ParameterBlockJAI parameters, RenderingHints hints) We override this one to get some extra behavior that ImageWorker has (ROI, paletted images management)doOperation
(ParameterValueGroup parameters, Hints hints) Applies a process operation to a grid coverage.protected void
extractSources
(ParameterValueGroup parameters, Collection<GridCoverage2D> sources, String[] sourceNames) Extraction of the sources from the parameter called SOURCES.getProperties
(RenderedImage data, CoordinateReferenceSystem crs, InternationalString name, MathTransform gridToCRS, GridCoverage2D[] sources, Mosaic.Params parameters) Methods inherited from class OperationJAI
deriveCategory, deriveGridCoverage, deriveName, deriveRange, deriveSampleDimension, deriveUnit, equals, getJAI, getOperationDescriptor, getProperties, getQuantitative, handleJAIEXTParams, handleROINoDataInternal, handleROINoDataProperties, hashCode, prepareParameters, resampleToCommonGeometry
Methods inherited from class Operation2D
extractSources, getFactory
Methods inherited from class AbstractOperation
getDescription, getDocURL, getName, getNumSources, getParameters, getVendor, getVersion, toString
-
Field Details
-
POLICY
Name for the COVERAGE_INDEX parameter- See Also:
-
GEOMETRY
Name for the GG2D parameter- See Also:
-
SOURCES_NAME
Name for the Sources parameter- See Also:
-
OUTNODATA_NAME
Name for the Output No Data parameter- See Also:
-
ALPHA_NAME
Name for the input Alpha bands- See Also:
-
SOURCES
The parameter descriptor for the Sources. -
GG
The parameter descriptor for the GridGeometry to use. -
GEOMETRY_POLICY
The parameter descriptor for the GridGeometry choosing policy. -
OUTPUT_NODATA
The parameter descriptor for the Transformation Choice. -
ALPHA
The parameter descriptor for the Alpha band.
-
-
Constructor Details
-
Mosaic
public Mosaic()
-
-
Method Details
-
doOperation
public Coverage doOperation(ParameterValueGroup parameters, Hints hints) throws CoverageProcessingException Description copied from class:OperationJAI
Applies a process operation to a grid coverage. The default implementation performs the following steps:- Ensures that every sources
GridCoverage2D
s use the same coordinate reference system (at least for the two-dimensional part) with the samegridToCRS
relationship. - Invokes
OperationJAI.deriveGridCoverage(org.geotools.coverage.grid.GridCoverage2D[], org.geotools.coverage.processing.OperationJAI.Parameters)
. The sources in theParameterBlock
areRenderedImage
objects obtained fromGridCoverage2D.getRenderedImage()
. - If a changes from non-geophysics to geophysics view were performed at step 1, converts the result back to
the original view using
GridCoverage2D.geophysics(false)
.
- Overrides:
doOperation
in classOperationJAI
- Parameters:
parameters
- List of name value pairs for the parameters required for the operation.hints
- A set of rendering hints, ornull
if none.- Returns:
- The result as a grid coverage.
- Throws:
CoverageProcessingException
- if the operation can't be applied.- See Also:
- Ensures that every sources
-
createRenderedImage
We override this one to get some extra behavior that ImageWorker has (ROI, paletted images management)- Overrides:
createRenderedImage
in classOperationJAI
- Parameters:
parameters
- The parameters to be given to JAI.hints
- The rendering hints to be given to JAI.- Returns:
- The result of JAI operation using the given parameters and hints.
-
getProperties
protected Map<String,?> getProperties(RenderedImage data, CoordinateReferenceSystem crs, InternationalString name, MathTransform gridToCRS, GridCoverage2D[] sources, Mosaic.Params parameters) -
extractSources
protected void extractSources(ParameterValueGroup parameters, Collection<GridCoverage2D> sources, String[] sourceNames) throws ParameterNotFoundException, InvalidParameterValueException Description copied from class:OperationJAI
Extraction of the sources from the parameter called SOURCES. The sources are stored inside a List.- Overrides:
extractSources
in classOperationJAI
- Throws:
ParameterNotFoundException
InvalidParameterValueException
-