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, sourceELEVATION_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, skipclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDatasetLayout, getDatasetLayoutgetCurrentSubname, getSource, hasMoreGridCoverages, listSubNames, skippublic static final String UNSPECIFIED
public ImageMosaicReader(Object source, Hints uHints) throws IOException
source - The source object.IOExceptionUnsupportedEncodingExceptionpublic ImageMosaicReader(Object source) throws IOException
source - The source object.IOExceptionUnsupportedEncodingExceptionpublic RasterManager getRasterManager(String name)
public String[] getGridCoverageNames()
GridCoverageReadergetGridCoverageNames in interface GridCoverageReadergetGridCoverageNames in class AbstractGridCoverage2DReaderpublic Format getFormat()
GridCoverageReaderGridCoverageReader.getFormat in interface GridCoverageReaderGridCoverageReader.getFormat()public GridCoverage2D read(GeneralParameterValue[] params) throws IOException
AbstractGridCoverage2DReaderExample:
The method AbstractGridCoverage2DReader.hasMoreGridCoverages() should be invoked first in order to verify that a
coverage is available.read in interface GridCoverage2DReaderread in interface GridCoverageReaderread in class AbstractGridCoverage2DReaderparams - 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
GridCoverage2DReaderGridEnvelope associated to the specified coverageName for this GridCoverage2DReader.read in interface GridCoverage2DReaderread in interface GridCoverageReaderread in class AbstractGridCoverage2DReadercoverageName - 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 FormatGridCoverage2D 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.@Overridepublic int getGridCoverageCount()
getGridCoverageCount in interface GridCoverageReadergetGridCoverageCount in class AbstractGridCoverage2DReaderGridCoverageReader.getGridCoverageCount()public void dispose()
dispose in interface GridCoverageReaderdispose in class AbstractGridCoverage2DReaderpublic String[] getMetadataNames()
GridCoverageReadergetMetadataNames in interface GridCoverageReadergetMetadataNames in class AbstractGridCoverage2DReaderGridCoverageReader.getMetadataNames()public String[] getMetadataNames(String coverageName)
getMetadataNames in interface GridCoverageReadergetMetadataNames in class AbstractGridCoverage2DReadercoverageName - public String getMetadataValue(String name)
GridCoverageReadergetMetadataValue in interface GridCoverageReadergetMetadataValue in class AbstractGridCoverage2DReadername - Metadata keyword for which to retrieve metadata.GridCoverageReader.getMetadataNames().GridCoverageReader.getMetadataValue(java.lang.String)public String getMetadataValue(String coverageName, String name)
GridCoverageReadergetMetadataValue in interface GridCoverageReadergetMetadataValue in class AbstractGridCoverage2DReadername - Metadata keyword for which to retrieve metadata.GridCoverageReader.getMetadataNames().public Set<ParameterDescriptor<List>> getDynamicParameters()
AbstractGridCoverage2DReadergetDynamicParameters in interface GridCoverage2DReadergetDynamicParameters in class AbstractGridCoverage2DReaderSet of dynamic read parameters supported by this GridCoverage2DReader.public Set<ParameterDescriptor<List>> getDynamicParameters(String coverageName)
AbstractGridCoverage2DReadergetDynamicParameters in interface GridCoverage2DReadergetDynamicParameters in class AbstractGridCoverage2DReadercoverageName - 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)
GridCoverage2DReadergetNumOverviews in interface GridCoverage2DReadergetNumOverviews in class AbstractGridCoverage2DReadercoverageName - the name of the coverage for which we do want to get the number of
overviews.public int getNumOverviews()
GridCoverage2DReadergetNumOverviews in interface GridCoverage2DReadergetNumOverviews in class AbstractGridCoverage2DReaderpublic double[] getReadingResolutions(OverviewPolicy policy, double[] requestedResolution)
AbstractGridCoverage2DReadergetReadingResolutions in interface GridCoverage2DReadergetReadingResolutions in class AbstractGridCoverage2DReaderpolicy - the OverviewPolicy to use during evaluation.requestedResolution - the requested resolutionpublic double[] getReadingResolutions(String coverageName, OverviewPolicy policy, double[] requestedResolution)
AbstractGridCoverage2DReadergetReadingResolutions in interface GridCoverage2DReadergetReadingResolutions in class AbstractGridCoverage2DReadercoverageName - 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
MosaicConfigurationBeanconfiguration - the MosaicConfigurationBean to be used to create the RasterManagerinit - true if the Manager should be initialized.IOExceptionpublic GranuleSource getGranules(String coverageName, boolean readOnly) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReadergetGranules in interface StructuredGridCoverage2DReadercoverageName - the name of the specified coveragereadOnly - a boolean indicating whether we may want modify the GranuleSourceGranuleSourceIOExceptionUnsupportedOperationExceptionpublic boolean isReadOnly()
StructuredGridCoverage2DReaderisReadOnly in interface StructuredGridCoverage2DReaderpublic void createCoverage(String coverageName, SimpleFeatureType indexSchema) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReadercreateCoverage in interface StructuredGridCoverage2DReaderIOExceptionUnsupportedOperationExceptionpublic boolean removeCoverage(String coverageName, boolean delete) throws IOException
StructuredGridCoverage2DReaderremoveCoverage in interface StructuredGridCoverage2DReaderIOExceptionpublic GeneralEnvelope getOriginalEnvelope()
AbstractGridCoverage2DReaderGeneralEnvelope for this AbstractGridCoverage2DReader.getOriginalEnvelope in interface GridCoverage2DReadergetOriginalEnvelope in class AbstractGridCoverage2DReaderGeneralEnvelope for this AbstractGridCoverage2DReader.public GeneralEnvelope getOriginalEnvelope(String coverageName)
AbstractGridCoverage2DReaderGeneralEnvelope for this AbstractGridCoverage2DReader.getOriginalEnvelope in interface GridCoverage2DReadergetOriginalEnvelope in class AbstractGridCoverage2DReadercoverageName - the name of the coverage to work on.GeneralEnvelope for this AbstractGridCoverage2DReader.public GridEnvelope getOriginalGridRange()
AbstractGridCoverage2DReaderGeneralGridEnvelope that represents the raster grid dimensions of the
highest resolution level in this dataset.getOriginalGridRange in interface GridCoverage2DReadergetOriginalGridRange in class AbstractGridCoverage2DReaderGeneralGridEnvelope that represents the raster grid dimensions of the
highest resolution level in this dataset.public GridEnvelope getOriginalGridRange(String coverageName)
AbstractGridCoverage2DReaderGeneralGridEnvelope that represents the raster grid dimensions of the
highest resolution level in this dataset.getOriginalGridRange in interface GridCoverage2DReadergetOriginalGridRange in class AbstractGridCoverage2DReadercoverageName - 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)
AbstractGridCoverage2DReaderAbstractGridCoverage2DReader.getOriginalGridToWorld in interface GridCoverage2DReadergetOriginalGridToWorld in class AbstractGridCoverage2DReaderpixInCell - specifies the datum of the transformation we want.AbstractGridCoverage2DReader.public MathTransform getOriginalGridToWorld(String coverageName, PixelInCell pixInCell)
AbstractGridCoverage2DReaderAbstractGridCoverage2DReader.getOriginalGridToWorld in interface GridCoverage2DReadergetOriginalGridToWorld in class AbstractGridCoverage2DReadercoverageName - the name of the coverage to work withpixInCell - specifies the datum of the transformation we want.AbstractGridCoverage2DReader.public CoordinateReferenceSystem getCoordinateReferenceSystem()
AbstractGridCoverage2DReaderGeneralEnvelope for this AbstractGridCoverage2DReader.getCoordinateReferenceSystem in interface GridCoverage2DReadergetCoordinateReferenceSystem in class AbstractGridCoverage2DReaderGeneralEnvelope for this AbstractGridCoverage2DReader.public CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName)
AbstractGridCoverage2DReaderGeneralEnvelope for this AbstractGridCoverage2DReader.getCoordinateReferenceSystem in interface GridCoverage2DReadergetCoordinateReferenceSystem in class AbstractGridCoverage2DReaderGeneralEnvelope for this AbstractGridCoverage2DReader.public ImageLayout getImageLayout()
throws IOException
GridCoverage2DReaderImageLayout for the default coverage.
Throw an IllegalArgumentException in case the name is wrong and/or no such a
coverage exists.
getImageLayout in interface GridCoverage2DReadergetImageLayout in class AbstractGridCoverage2DReaderImageLayout that is useful for actually knowing the ColorModel,
the SampleModel as well as the tile grid for the default coverage.IOExceptionpublic ImageLayout getImageLayout(String coverageName) throws IOException
GridCoverage2DReaderImageLayout for the specified coverage.
Throw an IllegalArgumentException in case the name is wrong and/or no such a
coverage exists.
getImageLayout in interface GridCoverage2DReadergetImageLayout in class AbstractGridCoverage2DReadercoverageName - 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.IOExceptionpublic double[][] getResolutionLevels()
throws IOException
GridCoverage2DReaderThrow an IllegalArgumentException in case the name is wrong and/or no such a
coverage exists.
getResolutionLevels in interface GridCoverage2DReadergetResolutionLevels in class AbstractGridCoverage2DReaderIOExceptionpublic double[][] getResolutionLevels(String coverageName) throws IOException
GridCoverage2DReaderThrow an IllegalArgumentException in case the name is wrong and/or no such a
coverage exists.
getResolutionLevels in interface GridCoverage2DReadergetResolutionLevels in class AbstractGridCoverage2DReadercoverageName - the name of the coverage for which we want to know the resolution levels.IOExceptionpublic List<HarvestedSource> harvest(String defaultCoverage, Object source, Hints hints) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReaderharvest in interface StructuredGridCoverage2DReadersource - 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 sourcesIOExceptionUnsupportedOperationExceptionpublic List<DimensionDescriptor> getDimensionDescriptors(String coverageName) throws IOException
StructuredGridCoverage2DReadergetDimensionDescriptors in interface StructuredGridCoverage2DReaderIOExceptionpublic void delete(boolean deleteData)
throws IOException
StructuredGridCoverage2DReaderdelete in interface StructuredGridCoverage2DReaderdeleteData - specifies whether data (granules) should be deleted too.IOExceptionpublic boolean removeCoverage(String coverageName) throws IOException, UnsupportedOperationException
removeCoverage in interface StructuredGridCoverage2DReaderIOExceptionUnsupportedOperationExceptionpublic ResourceInfo getInfo(String coverageName)
AbstractGridCoverage2DReadergetInfo in interface GridCoverage2DReadergetInfo in class AbstractGridCoverage2DReaderpublic ServiceInfo getInfo()
AbstractGridCoverage2DReaderSubclasses should provide additional format specific information.
getInfo in interface GridCoverage2DReadergetInfo in class AbstractGridCoverage2DReaderpublic ExecutorService getMultiThreadedLoader()
Copyright © 1996–2019 Geotools. All rights reserved.