Class ImageMosaicFormat

  • All Implemented Interfaces:

    public final class ImageMosaicFormat
    extends AbstractGridFormat
    implements Format
    AbstractGridFormat subclass for controlling ImageMosaicReader creation. As the name says, it handles mosaic of georeferenced images, which means
    1. tiff+tfw+prj
    2. jpeg+tfw+prj
    3. png+tfw+prj
    4. geotiff
    This does not mean that you throw there a couple of images and it will do the trick no matter how these images are. Requirements are:
    • (almost) equal spatial resolution
    • same number of bands
    • same data type
    • same projection
    The first requirement can be relaxed a little but if they have the same spatial resolution the performances are much better. There are parameters that you can use to control the behaviour of the mosaic in terms of thresholding and transparency. They are as follows:
    • --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.
    Simone Giannecchini (simboss), GeoSolutions, Stefan Alfons Krueger (alfonx), : Support for jar:file:foo.jar/ URLs
    • Field Detail

      • FADING

        public static final ParameterDescriptor<Boolean> FADING
        Control the type of the final mosaic.

        public static final ParameterDescriptor<Color> OUTPUT_TRANSPARENT_COLOR
        Control the transparency of the output coverage.

        public static final ParameterDescriptor<Integer> MAX_ALLOWED_TILES
        Control the thresholding on the input coverage

        public static final ParameterDescriptor<Integer> DEFAULT_ARTIFACTS_FILTER_THRESHOLD
        Control the default artifact filter luminance thresholding on the input coverages

        public static final ParameterDescriptor<Double> ARTIFACTS_FILTER_PTILE_THRESHOLD
        Control the artifact filter ptile thresholding

        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.

        public static final ParameterDescriptor<Boolean> ALLOW_MULTITHREADING
        Control the threading behavior for this plugin.

        public static final ParameterDescriptor<double[]> BACKGROUND_VALUES
        Control the background values for the output coverage

        public static final ParameterDescriptor<Interpolation> INTERPOLATION
        Control the interpolation to be used in mosaicking

        public static final ParameterDescriptor<Boolean> ACCURATE_RESOLUTION
        Control the requested resolution calculation.

        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


        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.


        public static final ParameterDescriptor<ExcessGranulePolicy> EXCESS_GRANULE_REMOVAL
        Controls the removal of excess granules

        This 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.


        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.

        public static final ParameterDescriptor<Double> MASKING_BUFFER_PIXELS
        Control the Masking buffering (in raster size)

        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)
    • Constructor Detail

      • ImageMosaicFormat

        public ImageMosaicFormat()
        Creates an instance and sets the metadata.
    • Method Detail

      • getReader

        public ImageMosaicReader getReader​(Object source)
        Description copied from class: AbstractGridFormat
        Gets a GridCoverageReader for this format able to create coverages out of the source object.

        In case this Format cannot reader the provided source object null is returned.

        Specified by:
        getReader in class AbstractGridFormat
        source - The source object to parse.
        A reader for this Format or null.
        See Also:
      • accepts

        public boolean accepts​(Object source,
                               Hints hints)
        Description copied from class: AbstractGridFormat
        Tells me if this Format can read the provided input.
        Specified by:
        accepts in class AbstractGridFormat
        source - The input object to test for suitability.
        hints - Hints to control the accepts internal machinery.
        True if this format can read this object, False otherwise.
      • accepts

        public boolean accepts​(Object source)
        Description copied from class: AbstractGridFormat
        Tells me if this Format can read the provided input.
        accepts in class AbstractGridFormat
        source - The input object to test for suitability.
        True if this format can read this object, False otherwise.
        See Also: input)
      • 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 class AbstractGridFormat
        destination - the destination object to write a WorldImage to
        hints - Hints to control the internal machinery.
        a new WorldImageWriter for the destination