public class ImageMosaicReader extends AbstractGridCoverage2DReader implements StructuredGridCoverage2DReader
The "Mosaic" operation creates a mosaic of two or more source images. This operation could be used for example to assemble a set of overlapping geospatially rectified images into a contiguous image. It could also be used to create a montage of photographs such as a panorama.
All source images are assumed to have been geometrically mapped into a common coordinate space. The origin (minX, minY) of each image is therefore taken to represent the location of the respective image in the common coordinate system of the source images. This coordinate space will also be that of the destination image.
All source images must have the same data type and sample size for all bands and have the same number of bands as color components. The destination will have the same data type, sample size, and number of bands and color components as the sources.
Modifier and Type | Class and Description |
---|---|
static class |
ImageMosaicReader.HarvestedResource
Enumeration object used for defining 3 different behaviours for the Harvesting, each of them
associated to one of these 3 objects:
File
Directory
List of Files
|
Modifier and Type | Field and Description |
---|---|
static String |
UNSPECIFIED |
closeMe, coverageFactory, coverageName, crs, dtLayout, EPS, gzipped, highestRes, hints, inStream, inStreamSPI, numOverviews, originalEnvelope, originalGridRange, overViewResolutions, raster2Model, source
ELEVATION_DOMAIN, ELEVATION_DOMAIN_MAXIMUM, ELEVATION_DOMAIN_MINIMUM, ELEVATION_DOMAIN_RESOLUTION, FILE_SOURCE_PROPERTY, HAS_ELEVATION_DOMAIN, HAS_TIME_DOMAIN, MULTICRS_READER, REPROJECTING_READER, SOURCE_URL_PROPERTY, TIME_DOMAIN, TIME_DOMAIN_MAXIMUM, TIME_DOMAIN_MINIMUM, TIME_DOMAIN_RESOLUTION
Constructor and Description |
---|
ImageMosaicReader(Object source)
Constructor.
|
ImageMosaicReader(Object source,
Hints uHints)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected RasterManager |
addRasterManager(MosaicConfigurationBean configuration,
boolean init)
Create a RasterManager on top of this
MosaicConfigurationBean |
void |
createCoverage(String coverageName,
SimpleFeatureType indexSchema)
Creates a granule store for a new coverage with the given feature type
|
void |
delete(boolean deleteData)
delete all stuff (database content, indexer files, property files, associated auxiliary files
and so on).
|
void |
dispose()
Releases resources held by this reader.
|
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Retrieves the
GeneralEnvelope for this AbstractGridCoverage2DReader . |
CoordinateReferenceSystem |
getCoordinateReferenceSystem(String coverageName)
Retrieves the
GeneralEnvelope for this AbstractGridCoverage2DReader . |
List<DimensionDescriptor> |
getDimensionDescriptors(String coverageName)
Describes the dimensions supported by the specified coverage, if any.
|
Set<ParameterDescriptor<List>> |
getDynamicParameters()
Return the set of dynamic parameterDescriptors (the ones related to domains) for this reader.
|
Set<ParameterDescriptor<List>> |
getDynamicParameters(String coverageName)
Return the set of dynamic parameterDescriptors (the ones related to domains) for this reader.
|
Format |
getFormat()
Returns the format handled by this
GridCoverageReader . |
GranuleSource |
getGranules(String coverageName,
boolean readOnly)
Returns the granule source for the specified coverage (might be null, if there is only one
supported coverage)
|
int |
getGridCoverageCount()
Number of coverages for this reader is 1
|
String[] |
getGridCoverageNames()
Retrieve the list of coverages contained within the input source.
|
ImageLayout |
getImageLayout()
Retrieve the
ImageLayout for the default coverage. |
ImageLayout |
getImageLayout(String coverageName)
Retrieve the
ImageLayout for the specified coverage. |
ServiceInfo |
getInfo()
Information about this source.
|
ResourceInfo |
getInfo(String coverageName)
Default implementation returns a FileResourceInfo containing same fileGroup list contained in
the ServiceInfo object.
|
String[] |
getMetadataNames()
Returns the list of metadata keywords associated with the input
source as a whole (not associated with any particular grid coverage).
|
String[] |
getMetadataNames(String coverageName)
Populate the metadata names array for the specified coverageName
|
String |
getMetadataValue(String name)
Retrieve the metadata value for a given metadata name.
|
String |
getMetadataValue(String coverageName,
String name)
Retrieve the metadata value for a given metadata name for a specified coverage.
|
ExecutorService |
getMultiThreadedLoader() |
int |
getNumOverviews()
Number of predetermined overviews for the default coverage.
|
int |
getNumOverviews(String coverageName)
Number of predetermined overviews for the specified coverage.
|
GeneralEnvelope |
getOriginalEnvelope()
Retrieves the
GeneralEnvelope for this AbstractGridCoverage2DReader . |
GeneralEnvelope |
getOriginalEnvelope(String coverageName)
Retrieves the
GeneralEnvelope for this AbstractGridCoverage2DReader . |
GridEnvelope |
getOriginalGridRange()
Retrieves the
GeneralGridEnvelope that represents the raster grid dimensions of the
highest resolution level in this dataset. |
GridEnvelope |
getOriginalGridRange(String coverageName)
Retrieves the
GeneralGridEnvelope that represents the raster grid dimensions of the
highest resolution level in this dataset. |
MathTransform |
getOriginalGridToWorld(PixelInCell pixInCell)
Retrieves the original grid to world transformation for this
AbstractGridCoverage2DReader . |
MathTransform |
getOriginalGridToWorld(String coverageName,
PixelInCell pixInCell)
Retrieves the original grid to world transformation for this
AbstractGridCoverage2DReader . |
RasterManager |
getRasterManager(String name) |
double[] |
getReadingResolutions(OverviewPolicy policy,
double[] requestedResolution)
Returns the actual resolution used to read the data given the specified target resolution and
the specified overview policy
|
double[] |
getReadingResolutions(String coverageName,
OverviewPolicy policy,
double[] requestedResolution)
Returns the actual resolution used to read the data given the specified target resolution and
the specified overview policy
|
double[][] |
getResolutionLevels()
Retrieve the resolution levels for the default coverage.
|
double[][] |
getResolutionLevels(String coverageName)
Retrieve the resolution levels for the specified coverage.
|
List<HarvestedSource> |
harvest(String defaultCoverage,
Object source,
Hints hints)
Harvests the specified source into the reader.
|
boolean |
isParameterSupported(Identifier name) |
boolean |
isParameterSupported(String coverageName,
Identifier parameterName)
Check whether the specified parameter is supported for the specified coverage.
|
boolean |
isReadOnly()
Return whether this reader can modify the granule source
|
GridCoverage2D |
read(GeneralParameterValue[] params)
Read the current grid coverage from the stream.
|
GridCoverage2D |
read(String coverageName,
GeneralParameterValue[] params)
Retrieves the
GridEnvelope associated to the specified coverageName for this GridCoverage2DReader . |
boolean |
removeCoverage(String coverageName) |
boolean |
removeCoverage(String coverageName,
boolean delete)
removes a granule store for the specified coverageName
|
addAllSiblings, addSiblings, checkName, createImageCoverage, createImageCoverage, createImageCoverage, createImageCoverage, decimationOnReadingControl, finalize, getCrs, getCurrentSubname, getDatasetLayout, getDatasetLayout, getFiles, getGroundControlPoints, getGroundControlPoints, getHighestRes, getMultiLevelROIProvider, getOverviewGridEnvelope, getOverviewGridEnvelope, getRescaledRasterToModel, getResolution, getSibling, getSource, getSourceAsFile, hasMoreGridCoverages, listSubNames, setlayout, setLayout, setReadParams, setReadParams, skip
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDatasetLayout, getDatasetLayout
getCurrentSubname, getSource, hasMoreGridCoverages, listSubNames, skip
public static final String UNSPECIFIED
public ImageMosaicReader(Object source, Hints uHints) throws IOException
source
- The source object.IOException
UnsupportedEncodingException
public ImageMosaicReader(Object source) throws IOException
source
- The source object.IOException
UnsupportedEncodingException
public RasterManager getRasterManager(String name)
public String[] getGridCoverageNames()
GridCoverageReader
getGridCoverageNames
in interface GridCoverageReader
getGridCoverageNames
in class AbstractGridCoverage2DReader
public Format getFormat()
GridCoverageReader
GridCoverageReader
.getFormat
in interface GridCoverageReader
GridCoverageReader.getFormat()
public GridCoverage2D read(GeneralParameterValue[] params) throws IOException
AbstractGridCoverage2DReader
Example:
The method AbstractGridCoverage2DReader.hasMoreGridCoverages()
should be invoked first in order to verify that a
coverage is available.read
in interface GridCoverage2DReader
read
in interface GridCoverageReader
read
in class AbstractGridCoverage2DReader
params
- Optional parameters matching Format.getReadParameters()
.IOException
- if a read operation failed for some other input/output reason, including
FileNotFoundException
if no file with the given name
can be found, or
IIOException
if an error was thrown by the underlying image
library.public GridCoverage2D read(String coverageName, GeneralParameterValue[] params) throws IOException
GridCoverage2DReader
GridEnvelope
associated to the specified coverageName for this GridCoverage2DReader
.read
in interface GridCoverage2DReader
read
in interface GridCoverageReader
read
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work withparams
- an array of GeneralParameterValue
that uses a subset of the
available read params for this GridCoverage2DReader
as specified by the Format
GridCoverage2D
for the underlying default coverage for this GridCoverage2DReader
or null
in case no GridCoverage2D
can be read
for the provided parameters.IOException
- if a read operation failed for some other input/output reason, including
FileNotFoundException
if no file with the given name
can be found, or
IIOException
if an error was thrown by the underlying image
library.@Override
public int getGridCoverageCount()
getGridCoverageCount
in interface GridCoverageReader
getGridCoverageCount
in class AbstractGridCoverage2DReader
GridCoverageReader.getGridCoverageCount()
public void dispose()
dispose
in interface GridCoverageReader
dispose
in class AbstractGridCoverage2DReader
public String[] getMetadataNames()
GridCoverageReader
getMetadataNames
in interface GridCoverageReader
getMetadataNames
in class AbstractGridCoverage2DReader
GridCoverageReader.getMetadataNames()
public String[] getMetadataNames(String coverageName)
getMetadataNames
in interface GridCoverageReader
getMetadataNames
in class AbstractGridCoverage2DReader
coverageName
- public String getMetadataValue(String name)
GridCoverageReader
getMetadataValue
in interface GridCoverageReader
getMetadataValue
in class AbstractGridCoverage2DReader
name
- Metadata keyword for which to retrieve metadata.GridCoverageReader.getMetadataNames()
.GridCoverageReader.getMetadataValue(java.lang.String)
public String getMetadataValue(String coverageName, String name)
GridCoverageReader
getMetadataValue
in interface GridCoverageReader
getMetadataValue
in class AbstractGridCoverage2DReader
name
- Metadata keyword for which to retrieve metadata.GridCoverageReader.getMetadataNames()
.public Set<ParameterDescriptor<List>> getDynamicParameters()
AbstractGridCoverage2DReader
getDynamicParameters
in interface GridCoverage2DReader
getDynamicParameters
in class AbstractGridCoverage2DReader
Set
of dynamic read parameters supported by this GridCoverage2DReader
.public Set<ParameterDescriptor<List>> getDynamicParameters(String coverageName)
AbstractGridCoverage2DReader
getDynamicParameters
in interface GridCoverage2DReader
getDynamicParameters
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work withSet
of dynamic read parameters supported by this GridCoverage2DReader
.public boolean isParameterSupported(Identifier name)
public int getNumOverviews(String coverageName)
GridCoverage2DReader
getNumOverviews
in interface GridCoverage2DReader
getNumOverviews
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage for which we do want to get the number of
overviews.public int getNumOverviews()
GridCoverage2DReader
getNumOverviews
in interface GridCoverage2DReader
getNumOverviews
in class AbstractGridCoverage2DReader
public double[] getReadingResolutions(OverviewPolicy policy, double[] requestedResolution)
AbstractGridCoverage2DReader
getReadingResolutions
in interface GridCoverage2DReader
getReadingResolutions
in class AbstractGridCoverage2DReader
policy
- the OverviewPolicy
to use during evaluation.requestedResolution
- the requested resolutionpublic double[] getReadingResolutions(String coverageName, OverviewPolicy policy, double[] requestedResolution)
AbstractGridCoverage2DReader
getReadingResolutions
in interface GridCoverage2DReader
getReadingResolutions
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work on.policy
- the OverviewPolicy
to use during evaluation.requestedResolution
- the requested resolutionpublic boolean isParameterSupported(String coverageName, Identifier parameterName)
coverageName
- parameterName
- protected RasterManager addRasterManager(MosaicConfigurationBean configuration, boolean init) throws IOException
MosaicConfigurationBean
configuration
- the MosaicConfigurationBean
to be used to create the RasterManager
init
- true
if the Manager should be initialized.IOException
public GranuleSource getGranules(String coverageName, boolean readOnly) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReader
getGranules
in interface StructuredGridCoverage2DReader
coverageName
- the name of the specified coveragereadOnly
- a boolean indicating whether we may want modify the GranuleSourceGranuleSource
IOException
UnsupportedOperationException
public boolean isReadOnly()
StructuredGridCoverage2DReader
isReadOnly
in interface StructuredGridCoverage2DReader
public void createCoverage(String coverageName, SimpleFeatureType indexSchema) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReader
createCoverage
in interface StructuredGridCoverage2DReader
IOException
UnsupportedOperationException
public boolean removeCoverage(String coverageName, boolean delete) throws IOException
StructuredGridCoverage2DReader
removeCoverage
in interface StructuredGridCoverage2DReader
IOException
public GeneralEnvelope getOriginalEnvelope()
AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.getOriginalEnvelope
in interface GridCoverage2DReader
getOriginalEnvelope
in class AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.public GeneralEnvelope getOriginalEnvelope(String coverageName)
AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.getOriginalEnvelope
in interface GridCoverage2DReader
getOriginalEnvelope
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work on.GeneralEnvelope
for this AbstractGridCoverage2DReader
.public GridEnvelope getOriginalGridRange()
AbstractGridCoverage2DReader
GeneralGridEnvelope
that represents the raster grid dimensions of the
highest resolution level in this dataset.getOriginalGridRange
in interface GridCoverage2DReader
getOriginalGridRange
in class AbstractGridCoverage2DReader
GeneralGridEnvelope
that represents the raster grid dimensions of the
highest resolution level in this dataset.public GridEnvelope getOriginalGridRange(String coverageName)
AbstractGridCoverage2DReader
GeneralGridEnvelope
that represents the raster grid dimensions of the
highest resolution level in this dataset.getOriginalGridRange
in interface GridCoverage2DReader
getOriginalGridRange
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work withGeneralGridEnvelope
that represents the raster grid dimensions of the
highest resolution level in this dataset.public MathTransform getOriginalGridToWorld(PixelInCell pixInCell)
AbstractGridCoverage2DReader
AbstractGridCoverage2DReader
.getOriginalGridToWorld
in interface GridCoverage2DReader
getOriginalGridToWorld
in class AbstractGridCoverage2DReader
pixInCell
- specifies the datum of the transformation we want.AbstractGridCoverage2DReader
.public MathTransform getOriginalGridToWorld(String coverageName, PixelInCell pixInCell)
AbstractGridCoverage2DReader
AbstractGridCoverage2DReader
.getOriginalGridToWorld
in interface GridCoverage2DReader
getOriginalGridToWorld
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work withpixInCell
- specifies the datum of the transformation we want.AbstractGridCoverage2DReader
.public CoordinateReferenceSystem getCoordinateReferenceSystem()
AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.getCoordinateReferenceSystem
in interface GridCoverage2DReader
getCoordinateReferenceSystem
in class AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.public CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName)
AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.getCoordinateReferenceSystem
in interface GridCoverage2DReader
getCoordinateReferenceSystem
in class AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.public ImageLayout getImageLayout() throws IOException
GridCoverage2DReader
ImageLayout
for the default coverage.
Throw an IllegalArgumentException
in case the name is wrong and/or no such a
coverage exists.
getImageLayout
in interface GridCoverage2DReader
getImageLayout
in class AbstractGridCoverage2DReader
ImageLayout
that is useful for actually knowing the ColorModel
,
the SampleModel
as well as the tile grid for the default coverage.IOException
public ImageLayout getImageLayout(String coverageName) throws IOException
GridCoverage2DReader
ImageLayout
for the specified coverage.
Throw an IllegalArgumentException
in case the name is wrong and/or no such a
coverage exists.
getImageLayout
in interface GridCoverage2DReader
getImageLayout
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage for which we want to know the GridEnvelope
.ImageLayout
that is useful for actually knowing the ColorModel
,
the SampleModel
as well as the tile grid for a certain coverage.IOException
public double[][] getResolutionLevels() throws IOException
GridCoverage2DReader
Throw an IllegalArgumentException
in case the name is wrong and/or no such a
coverage exists.
getResolutionLevels
in interface GridCoverage2DReader
getResolutionLevels
in class AbstractGridCoverage2DReader
IOException
public double[][] getResolutionLevels(String coverageName) throws IOException
GridCoverage2DReader
Throw an IllegalArgumentException
in case the name is wrong and/or no such a
coverage exists.
getResolutionLevels
in interface GridCoverage2DReader
getResolutionLevels
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage for which we want to know the resolution levels.IOException
public List<HarvestedSource> harvest(String defaultCoverage, Object source, Hints hints) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReader
harvest
in interface StructuredGridCoverage2DReader
source
- The source can be any kind of object, it's up to the reader implementation to
understand and use it. Commons source types could be a single file, or a folder.hints
- Used to provide implementation specific hints on how to harvest the sourcesIOException
UnsupportedOperationException
public List<DimensionDescriptor> getDimensionDescriptors(String coverageName) throws IOException
StructuredGridCoverage2DReader
getDimensionDescriptors
in interface StructuredGridCoverage2DReader
IOException
public void delete(boolean deleteData) throws IOException
StructuredGridCoverage2DReader
delete
in interface StructuredGridCoverage2DReader
deleteData
- specifies whether data (granules) should be deleted too.IOException
public boolean removeCoverage(String coverageName) throws IOException, UnsupportedOperationException
removeCoverage
in interface StructuredGridCoverage2DReader
IOException
UnsupportedOperationException
public ResourceInfo getInfo(String coverageName)
AbstractGridCoverage2DReader
getInfo
in interface GridCoverage2DReader
getInfo
in class AbstractGridCoverage2DReader
public ServiceInfo getInfo()
AbstractGridCoverage2DReader
Subclasses should provide additional format specific information.
getInfo
in interface GridCoverage2DReader
getInfo
in class AbstractGridCoverage2DReader
public ExecutorService getMultiThreadedLoader()
Copyright © 1996–2019 Geotools. All rights reserved.