Package org.geotools.gce.imagemosaic
Class ImageMosaicFormat
- Object
-
- AbstractGridFormat
-
- ImageMosaicFormat
-
- All Implemented Interfaces:
Format
public final class ImageMosaicFormat extends AbstractGridFormat implements Format
AbstractGridFormat
subclass for controllingImageMosaicReader
creation. As the name says, it handles mosaic of georeferenced images, which means- tiff+tfw+prj
- jpeg+tfw+prj
- png+tfw+prj
- geotiff
- (almost) equal spatial resolution
- same number of bands
- same data type
- same projection
- --DefaultParameterDescriptor FINAL_ALPHA = new DefaultParameterDescriptor( "FinalAlpha", Boolean.class, null, Boolean.FALSE)-- It asks the plugin to add transparency on the final created mosaic. IT simply performs a threshonding looking for areas where there is no data, i.e., intensity is really low and transform them into transparent areas. It is obvious that depending on the nature of the input images it might interfere with the original values.
- ---ALPHA_THRESHOLD = new DefaultParameterDescriptor( "AlphaThreshold", Double.class, null, Double.valueOf(1));--- Controls the transparency addition by specifying the treshold to use.
- INPUT_IMAGE_THRESHOLD = new DefaultParameterDescriptor( "InputImageROI", Boolean.class, null, Boolean.FALSE)--- INPUT_IMAGE_THRESHOLD_VALUE = new DefaultParameterDescriptor( "InputImageROIThreshold", Integer.class, null, Integer.valueOf(1));--- These two can be used to control the application of ROIs on the input images based on tresholding values. Basically using the threshold you can ask the mosaic plugin to load or not certain pixels of the original images.
- Since:
- 2.3
- Author:
- Simone Giannecchini (simboss), GeoSolutions, Stefan Alfons Krueger (alfonx), Wikisquare.de : Support for jar:file:foo.jar/bar.properties URLs
-
-
Field Summary
Fields Modifier and Type Field Description static ParameterDescriptor<Boolean>
ACCURATE_RESOLUTION
Control the requested resolution calculation.static ParameterDescriptor<Boolean>
ALLOW_MULTITHREADING
Control the threading behavior for this plugin.static ParameterDescriptor<Double>
ARTIFACTS_FILTER_PTILE_THRESHOLD
Control the artifact filter ptile thresholdingstatic ParameterDescriptor<double[]>
BACKGROUND_VALUES
Control the background values for the output coveragestatic ParameterDescriptor<Integer>
DEFAULT_ARTIFACTS_FILTER_THRESHOLD
Control the default artifact filter luminance thresholding on the input coveragesstatic ParameterDescriptor<ExcessGranulePolicy>
EXCESS_GRANULE_REMOVAL
Controls the removal of excess granulesstatic ParameterDescriptor<Boolean>
FADING
Control the type of the final mosaic.static ParameterDescriptor<Filter>
FILTER
Filter tiles based on attributes from the input coveragestatic ParameterDescriptor<Geometry>
GEOMETRY_MASK
mask (as a polygon in native coordinates) to be applied to the produced mosaic.static ParameterDescriptor<Interpolation>
INTERPOLATION
Control the interpolation to be used in mosaickingstatic ParameterDescriptor<Double>
MASKING_BUFFER_PIXELS
Control the Masking buffering (in raster size)static ParameterDescriptor<Integer>
MAX_ALLOWED_TILES
Control the thresholding on the input coveragestatic ParameterDescriptor<String>
MERGE_BEHAVIOR
Merging behavior for the various granules of the mosaic we are going to produce.static ParameterDescriptor<Boolean>
OUTPUT_TO_ALTERNATIVE_CRS
When this read parameter is set to true, the reader will produce output in the requested CRS, assuming it matches one of the native CRSs, as reported by the #GridCoverage2DReader@MULTICRS_EPSGCODES metadata entry, and that the requested grid geometry is expressed in said CRS.static ParameterDescriptor<Color>
OUTPUT_TRANSPARENT_COLOR
Control the transparency of the output coverage.static ParameterDescriptor<Boolean>
SET_ROI_PROPERTY
Control whether to set the ROI property in the output mosaic (as an instance, even when background values are set which usually results into setting a null ROI after the mosaic)static ParameterDescriptor<String>
SORT_BY
Optional Sorting for the granules of the mosaic.static ParameterDescriptor<double[]>
VIRTUAL_NATIVE_RESOLUTION
Defines a virtual native resolution.-
Fields inherited from class AbstractGridFormat
BACKGROUND_COLOR, BANDS, DECIMATION_POLICY, ELEVATION, FOOTPRINT_BEHAVIOR, GEOTOOLS_WRITE_PARAMS, INPUT_TRANSPARENT_COLOR, mInfo, OVERVIEW_POLICY, PROGRESS_LISTENER, READ_GRIDGEOMETRY2D, readParameters, RESCALE_PIXELS, SUGGESTED_TILE_SIZE, TILE_SIZE_SEPARATOR, TIME, USE_JAI_IMAGEREAD, writeParameters
-
-
Constructor Summary
Constructors Constructor Description ImageMosaicFormat()
Creates an instance and sets the metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(Object source)
Tells me if thisFormat
can read the providedinput
.boolean
accepts(Object source, Hints hints)
Tells me if thisFormat
can read the providedinput
.GeoToolsWriteParams
getDefaultImageIOWriteParameters()
Throw an exception since this plugin is readonly.ImageMosaicReader
getReader(Object source)
Gets aGridCoverageReader
for this format able to create coverages out of thesource
object.ImageMosaicReader
getReader(Object source, Hints hints)
Gets aGridCoverageReader
for this format able to create coverages out of thesource
object using the providedhints
.GridCoverageWriter
getWriter(Object destination)
Retrieves aGridCoverageWriter
suitable for writing to the provideddestination
with this format.GridCoverageWriter
getWriter(Object destination, Hints hints)
Call the accepts() method before asking for a writer to determine if the current object is supported.-
Methods inherited from class AbstractGridFormat
equals, getDefaultCRS, getDescription, getDocURL, getName, getReadParameters, getVendor, getVersion, getWriteParameters
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface Format
getDescription, getDocURL, getName, getReadParameters, getVendor, getVersion, getWriteParameters
-
-
-
-
Field Detail
-
FILTER
public static final ParameterDescriptor<Filter> FILTER
Filter tiles based on attributes from the input coverage
-
FADING
public static final ParameterDescriptor<Boolean> FADING
Control the type of the final mosaic.
-
OUTPUT_TRANSPARENT_COLOR
public static final ParameterDescriptor<Color> OUTPUT_TRANSPARENT_COLOR
Control the transparency of the output coverage.
-
MAX_ALLOWED_TILES
public static final ParameterDescriptor<Integer> MAX_ALLOWED_TILES
Control the thresholding on the input coverage
-
DEFAULT_ARTIFACTS_FILTER_THRESHOLD
public static final ParameterDescriptor<Integer> DEFAULT_ARTIFACTS_FILTER_THRESHOLD
Control the default artifact filter luminance thresholding on the input coverages
-
ARTIFACTS_FILTER_PTILE_THRESHOLD
public static final ParameterDescriptor<Double> ARTIFACTS_FILTER_PTILE_THRESHOLD
Control the artifact filter ptile thresholding
-
VIRTUAL_NATIVE_RESOLUTION
public static final ParameterDescriptor<double[]> VIRTUAL_NATIVE_RESOLUTION
Defines a virtual native resolution. It virtually represents the native resolution to be used after reading a dataset before doing any other operation. It could be useful to limit somehow the data quality offered to the final user. As an instance if we have data at resolutions 0.5m, 1m, 2m, 4m, 8m and the virtual native resolution is 4m, and the request is looking for data at 2m resolution we should downsample the best nearest level to 4m and then get back at 2m. This will result in potentially pixellated output. When specified, values should be always positive.
-
ALLOW_MULTITHREADING
public static final ParameterDescriptor<Boolean> ALLOW_MULTITHREADING
Control the threading behavior for this plugin.
-
BACKGROUND_VALUES
public static final ParameterDescriptor<double[]> BACKGROUND_VALUES
Control the background values for the output coverage
-
INTERPOLATION
public static final ParameterDescriptor<Interpolation> INTERPOLATION
Control the interpolation to be used in mosaicking
-
ACCURATE_RESOLUTION
public static final ParameterDescriptor<Boolean> ACCURATE_RESOLUTION
Control the requested resolution calculation.
-
OUTPUT_TO_ALTERNATIVE_CRS
public static final ParameterDescriptor<Boolean> OUTPUT_TO_ALTERNATIVE_CRS
When this read parameter is set to true, the reader will produce output in the requested CRS, assuming it matches one of the native CRSs, as reported by the #GridCoverage2DReader@MULTICRS_EPSGCODES metadata entry, and that the requested grid geometry is expressed in said CRS. When set to false (default), then only the native CRS declared by #GridCoverage2DReader@getCoordinateReferenceSystem will be produced in output
-
SORT_BY
public static final ParameterDescriptor<String> SORT_BY
Optional Sorting for the granules of the mosaic.It does work only with DBMS as indexes
-
MERGE_BEHAVIOR
public static final ParameterDescriptor<String> MERGE_BEHAVIOR
Merging behavior for the various granules of the mosaic we are going to produce.This parameter controls whether we want to merge in a single mosaic or stack all the bands into the final mosaic.
-
EXCESS_GRANULE_REMOVAL
public static final ParameterDescriptor<ExcessGranulePolicy> EXCESS_GRANULE_REMOVAL
Controls the removal of excess granulesThis parameter controls whether the mosaic will attempt to remove excess granules, that is, granules not contributing pixels to the output, before performing the mosaicking. This is useful only if granules are overlapping, do not enable otherwise.
-
GEOMETRY_MASK
public static final ParameterDescriptor<Geometry> GEOMETRY_MASK
mask (as a polygon in native coordinates) to be applied to the produced mosaic. At the moment, it will be ignored in case of Heterogeneous CRS.
-
MASKING_BUFFER_PIXELS
public static final ParameterDescriptor<Double> MASKING_BUFFER_PIXELS
Control the Masking buffering (in raster size)
-
SET_ROI_PROPERTY
public static final ParameterDescriptor<Boolean> SET_ROI_PROPERTY
Control whether to set the ROI property in the output mosaic (as an instance, even when background values are set which usually results into setting a null ROI after the mosaic)
-
-
Method Detail
-
getReader
public ImageMosaicReader getReader(Object source)
Description copied from class:AbstractGridFormat
Gets aGridCoverageReader
for this format able to create coverages out of thesource
object.In case this
Format
cannot reader the providedsource
objectnull
is returned.- Specified by:
getReader
in classAbstractGridFormat
- Parameters:
source
- The source object to parse.- Returns:
- A reader for this
Format
or null. - See Also:
org.geotools.data.coverage.grid.AbstractGridFormat#getReader(Object)
-
getWriter
public GridCoverageWriter getWriter(Object destination)
Description copied from class:AbstractGridFormat
Retrieves aGridCoverageWriter
suitable for writing to the provideddestination
with this format.In case no writers are available
null
is returned.- Specified by:
getWriter
in classAbstractGridFormat
- Parameters:
destination
- The destinatin where to write.- Returns:
- A
GridCoverageWriter
suitable for writing to the provideddestination
with this format.
-
accepts
public boolean accepts(Object source, Hints hints)
Description copied from class:AbstractGridFormat
Tells me if thisFormat
can read the providedinput
.- Specified by:
accepts
in classAbstractGridFormat
- Parameters:
source
- The input object to test for suitability.hints
-Hints
to control the accepts internal machinery.- Returns:
- True if this format can read this object, False otherwise.
-
accepts
public boolean accepts(Object source)
Description copied from class:AbstractGridFormat
Tells me if thisFormat
can read the providedinput
.- Overrides:
accepts
in classAbstractGridFormat
- Parameters:
source
- The input object to test for suitability.- Returns:
- True if this format can read this object, False otherwise.
- See Also:
org.geotools.data.coverage.grid.AbstractGridFormat#accepts(Object input)
-
getReader
public ImageMosaicReader getReader(Object source, Hints hints)
Description copied from class:AbstractGridFormat
Gets aGridCoverageReader
for this format able to create coverages out of thesource
object using the providedhints
.In case this
Format
cannot reader the providedsource
objectnull
is returned.- Specified by:
getReader
in classAbstractGridFormat
- Parameters:
source
- The source object to parse. *hints
- TheHints
to use when trying to instantiate this reader.- Returns:
- A reader for this
Format
or null. - See Also:
AbstractGridFormat.getReader(Object, Hints)
-
getDefaultImageIOWriteParameters
public GeoToolsWriteParams getDefaultImageIOWriteParameters()
Throw an exception since this plugin is readonly.- Specified by:
getDefaultImageIOWriteParameters
in classAbstractGridFormat
- Returns:
- nothing.
-
getWriter
public GridCoverageWriter getWriter(Object destination, Hints hints)
Description copied from class:AbstractGridFormat
Call the accepts() method before asking for a writer to determine if the current object is supported.- Specified by:
getWriter
in classAbstractGridFormat
- Parameters:
destination
- the destination object to write a WorldImage tohints
-Hints
to control the internal machinery.- Returns:
- a new WorldImageWriter for the destination
-
-