Package org.geotools.gce.imagemosaic
Class ImageMosaicConfigHandler
- Object
-
- ImageMosaicConfigHandler
-
public class ImageMosaicConfigHandler extends Object
This class is in responsible for creating and managing the catalog and the configuration of the mosaic- Author:
- Carlo Cancellieri - GeoSolutions SAS
-
-
Field Summary
Fields Modifier and Type Field Description protected GranuleCatalog
catalog
-
Constructor Summary
Constructors Constructor Description ImageMosaicConfigHandler(CatalogBuilderConfiguration configuration, ImageMosaicEventHandlers eventHandler)
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GranuleCatalog
buildCatalog()
protected boolean
coverageExists(String coverageName)
Check whether the specified coverage already exist in the reader.ImageMosaicWalker
createWalker()
Create a properImageMosaicWalker
based on the current configurationvoid
dispose()
AbstractGridFormat
getCachedFormat()
ImageReaderSpi
getCachedReaderSPI()
GranuleCatalog
getCatalog()
Map<String,MosaicConfigurationBean>
getConfigurations()
List<GranuleAcceptor>
getGranuleAcceptors()
ImageMosaicReader
getParentReader()
List<PropertiesCollector>
getPropertiesCollectors()
RasterManager
getRasterManagerForTargetCoverage(String targetCoverageName)
CatalogBuilderConfiguration
getRunConfiguration()
boolean
getStop()
String
getTargetCoverageName(GridCoverage2DReader inputCoverageReader, String inputCoverageName)
Get the name of the target coverage for a given reader.boolean
isCog()
boolean
isUseExistingSchema()
void
reset()
Perform proper clean up.void
setCachedFormat(AbstractGridFormat cachedFormat)
void
setCachedReaderSPI(ImageReaderSpi cachedReaderSPI)
void
setParentReader(ImageMosaicReader parentReader)
void
stop()
void
updateConfiguration(GridCoverage2DReader coverageReader, String inputCoverageName, File fileBeingProcessed, int fileIndex, double numFiles, DefaultTransaction transaction)
void
updateConfiguration(GridCoverage2DReader coverageReader, String inputCoverageName, ImageMosaicSourceElement element, int fileIndex, double numFiles, DefaultTransaction transaction)
Use the passed coverageReader to create or update the all the needed configurations
It not responsible of the passed coverageReader which should be disposed outside (in the caller).
-
-
-
Field Detail
-
catalog
protected GranuleCatalog catalog
-
-
Constructor Detail
-
ImageMosaicConfigHandler
public ImageMosaicConfigHandler(CatalogBuilderConfiguration configuration, ImageMosaicEventHandlers eventHandler)
Default constructor
-
-
Method Detail
-
reset
public void reset()
Perform proper clean up.Make sure to call this method when you are not running the
ImageMosaicConfigHandler
or bad things can happen. If it is running, please stop it first.
-
getStop
public boolean getStop()
-
stop
public void stop()
-
buildCatalog
protected GranuleCatalog buildCatalog() throws IOException
- Throws:
IOException
-
coverageExists
protected boolean coverageExists(String coverageName) throws IOException
Check whether the specified coverage already exist in the reader. This allows to get the rasterManager associated with that coverage instead of creating a new one.- Parameters:
coverageName
- the name of the coverage to be searched- Returns:
true
in case that coverage already exists- Throws:
IOException
-
updateConfiguration
public void updateConfiguration(GridCoverage2DReader coverageReader, String inputCoverageName, File fileBeingProcessed, int fileIndex, double numFiles, DefaultTransaction transaction) throws IOException, GranuleHandlingException, NoSuchAuthorityCodeException, FactoryException, TransformException
-
updateConfiguration
public void updateConfiguration(GridCoverage2DReader coverageReader, String inputCoverageName, ImageMosaicSourceElement element, int fileIndex, double numFiles, DefaultTransaction transaction) throws IOException, GranuleHandlingException, NoSuchAuthorityCodeException, FactoryException, TransformException
Use the passed coverageReader to create or update the all the needed configurations
It not responsible of the passed coverageReader which should be disposed outside (in the caller).
-
getTargetCoverageName
public String getTargetCoverageName(GridCoverage2DReader inputCoverageReader, String inputCoverageName)
Get the name of the target coverage for a given reader. For most input coverages, the target coverage is simply the default coverage. For structured coverages the target coverage has the same name as the input coverage.- Parameters:
inputCoverageReader
- the coverage being added to the indexinputCoverageName
- the name of the input coverage- Returns:
- the target coverage name for the input coverage
-
dispose
public void dispose()
-
getConfigurations
public Map<String,MosaicConfigurationBean> getConfigurations()
-
getCatalog
public GranuleCatalog getCatalog()
-
getRunConfiguration
public CatalogBuilderConfiguration getRunConfiguration()
-
getParentReader
public ImageMosaicReader getParentReader()
-
setParentReader
public void setParentReader(ImageMosaicReader parentReader)
-
getPropertiesCollectors
public List<PropertiesCollector> getPropertiesCollectors()
-
isUseExistingSchema
public boolean isUseExistingSchema()
-
isCog
public boolean isCog()
-
getCachedReaderSPI
public ImageReaderSpi getCachedReaderSPI()
-
setCachedReaderSPI
public void setCachedReaderSPI(ImageReaderSpi cachedReaderSPI)
-
getCachedFormat
public AbstractGridFormat getCachedFormat()
-
setCachedFormat
public void setCachedFormat(AbstractGridFormat cachedFormat)
-
getGranuleAcceptors
public List<GranuleAcceptor> getGranuleAcceptors()
-
getRasterManagerForTargetCoverage
public RasterManager getRasterManagerForTargetCoverage(String targetCoverageName)
-
createWalker
public ImageMosaicWalker createWalker()
Create a properImageMosaicWalker
based on the current configuration
-
-