Class Mosaic
- All Implemented Interfaces:
Serializable,Operation
This operation does a mosaic of multiple
GridCoverage2Ds. The GridCoverage2Ds 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
GridCoverage2Ds are in the same CRS, else an exception is
thrown.
The input parameters of the operation are:
- a Collection of the
GridCoverage2Dto mosaic - an optional
GridGeometryobject for setting the final resolution and BoundingBox - an optional
Stringindicating 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 enumEnum used for choosing the outputGridGeometry2Dto use and then resampling all theGridCoverage2Dto its resolution.protected static final classA block of parameters for aGridCoverage2Dprocessed by theMosaicoperation.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 StringName for the input Alpha bandsstatic final StringName 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 StringName for the Output No Data parameterstatic final ParameterDescriptor<double[]>The parameter descriptor for the Transformation Choice.static final StringName for the COVERAGE_INDEX parameterstatic final ParameterDescriptor<Collection>The parameter descriptor for the Sources.static final StringName for the Sources parameterFields inherited from class OperationJAI
operation, RENDERED_MODEFields inherited from class Operation2D
PRIMARY_SOURCE_INDEX, SOURCE_0Fields inherited from class AbstractOperation
descriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RenderedImagecreateRenderedImage(ParameterBlockImageN 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 voidextractSources(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, resampleToCommonGeometryMethods inherited from class Operation2D
extractSources, getFactoryMethods 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:OperationJAIApplies a process operation to a grid coverage. The default implementation performs the following steps:- Ensures that every sources
GridCoverage2Ds use the same coordinate reference system (at least for the two-dimensional part) with the samegridToCRSrelationship. - Invokes
OperationJAI.deriveGridCoverage(org.geotools.coverage.grid.GridCoverage2D[], org.geotools.coverage.processing.OperationJAI.Parameters). The sources in theParameterBlockareRenderedImageobjects 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:
doOperationin classOperationJAI- Parameters:
parameters- List of name value pairs for the parameters required for the operation.hints- A set of rendering hints, ornullif 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:
createRenderedImagein classOperationJAI- Parameters:
parameters- The parameters to be given to ImageN.hints- The rendering hints to be given to ImageN.- Returns:
- The result of ImageN 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:OperationJAIExtraction of the sources from the parameter called SOURCES. The sources are stored inside a List.- Overrides:
extractSourcesin classOperationJAI- Throws:
ParameterNotFoundExceptionInvalidParameterValueException
-