Package org.geotools.gce.imagemosaic
Class GranuleDescriptor
- Object
-
- GranuleDescriptor
-
public class GranuleDescriptor extends Object
A granuleDescriptor is a single piece of the mosaic, with its own overviews and everything.This class is responsible for caching the various size of the different levels of each single granuleDescriptor since computing them each time is expensive (opening a file, looking for a reader, parsing metadata,etc...).
Right now we are making the assumption that a single granuleDescriptor is made a by a single file with embedded overviews, either explicit or intrinsic through wavelets like MrSID, ECW or JPEG2000.
- Since:
- 2.5.5
- Author:
- Simone Giannecchini, GeoSolutions S.A.S., Stefan Alfons Krueger (alfonx), Wikisquare.de : Support for jar:file:foo.jar/bar.properties URLs
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGranuleDescriptor.GranuleLoadingResultSimple placeholder class to store the result of a Granule Loading which comprises of a raster as well as aROIShapefor its footprint.
-
Field Summary
Fields Modifier and Type Field Description static HintsEXCLUDE_MOSAICHints to use for avoiding to search for the ImageMosaic formatstatic doubleREAD_THRESHOLDMinimum portion of a single pixel the code is going to read before giving up on the read, this is used to avoid reading granules that touch the reading area without actually contributing anything to the output
-
Constructor Summary
Constructors Constructor Description GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider)GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, boolean heterogeneousGranules)GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, int maxDecimationFactor)GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, int maxDecimationFactor, boolean heterogeneousGranules)GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, int maxDecimationFactor, boolean heterogeneousGranules, boolean handleArtifactsFiltering)GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, int maxDecimationFactor, boolean heterogeneousGranules, boolean handleArtifactsFiltering, Hints hints)GranuleDescriptor(SimpleFeature feature, ImageReaderSpi suggestedSPI, AbstractGridFormat suggestedFormat, ImageInputStreamSpi suggestedIsSPI, PathType pathType, String locationAttribute, String parentLocation)GranuleDescriptor(SimpleFeature feature, ImageReaderSpi suggestedSPI, PathType pathType, AbstractGridFormat suggestedFormat, ImageInputStreamSpi suggestedIsSPI, String locationAttribute, String parentLocation, MultiLevelROI roiProvider)Constructor for theGranuleDescriptorassuming it doesn't belong to an heterogeneous granules set.GranuleDescriptor(SimpleFeature feature, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, PathType pathType, String locationAttribute, String parentLocation, boolean heterogeneousGranules)GranuleDescriptor(SimpleFeature feature, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, PathType pathType, String locationAttribute, String parentLocation, boolean heterogeneousGranules, Hints hints)GranuleDescriptor(SimpleFeature feature, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, PathType pathType, String locationAttribute, String parentLocation, MultiLevelROI roiProvider, boolean heterogeneousGranules, Hints hints)Constructor for theGranuleDescriptor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeometrygetFootprint()BoundingBoxgetGranuleBBOX()GeneralBoundsgetGranuleEnvelope()URLgetGranuleUrl()MaskOverviewProvidergetMaskOverviewProvider()SimpleFeaturegetOriginator()OverviewsControllergetOverviewsController()AbstractGridCoverage2DReadergetReader()Returns a new instance of the AbstractGridCoverage2DReader associated with this descriptor.MultiLevelROIgetRoiProvider()protected voidinit(BoundingBox granuleBBOX, URL granuleUrl, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, boolean heterogeneousGranules, boolean handleArtifactsFiltering, Hints hints)GranuleDescriptor.GranuleLoadingResultloadRaster(ImageReadParam imageReadParameters, int index, ReferencedEnvelope cropBBox, MathTransform2D mosaicWorldToGrid, RasterLayerRequest request, Hints hints)Load a specified a raster as a portion of the granule describe by thisGranuleDescriptor.voidsetGranuleEnvelope(GeneralBounds granuleEnvelope)StringtoString()
-
-
-
Field Detail
-
EXCLUDE_MOSAIC
public static final Hints EXCLUDE_MOSAIC
Hints to use for avoiding to search for the ImageMosaic format
-
READ_THRESHOLD
public static final double READ_THRESHOLD
Minimum portion of a single pixel the code is going to read before giving up on the read, this is used to avoid reading granules that touch the reading area without actually contributing anything to the output
-
-
Constructor Detail
-
GranuleDescriptor
public GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider)
-
GranuleDescriptor
public GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, boolean heterogeneousGranules)
-
GranuleDescriptor
public GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, int maxDecimationFactor)
-
GranuleDescriptor
public GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, int maxDecimationFactor, boolean heterogeneousGranules)
-
GranuleDescriptor
public GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, int maxDecimationFactor, boolean heterogeneousGranules, boolean handleArtifactsFiltering)
-
GranuleDescriptor
public GranuleDescriptor(String granuleLocation, BoundingBox granuleBBox, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, int maxDecimationFactor, boolean heterogeneousGranules, boolean handleArtifactsFiltering, Hints hints)
-
GranuleDescriptor
public GranuleDescriptor(SimpleFeature feature, ImageReaderSpi suggestedSPI, AbstractGridFormat suggestedFormat, ImageInputStreamSpi suggestedIsSPI, PathType pathType, String locationAttribute, String parentLocation)
-
GranuleDescriptor
public GranuleDescriptor(SimpleFeature feature, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, PathType pathType, String locationAttribute, String parentLocation, boolean heterogeneousGranules, Hints hints)
-
GranuleDescriptor
public GranuleDescriptor(SimpleFeature feature, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, PathType pathType, String locationAttribute, String parentLocation, boolean heterogeneousGranules)
-
GranuleDescriptor
public GranuleDescriptor(SimpleFeature feature, ImageReaderSpi suggestedSPI, PathType pathType, AbstractGridFormat suggestedFormat, ImageInputStreamSpi suggestedIsSPI, String locationAttribute, String parentLocation, MultiLevelROI roiProvider)
Constructor for theGranuleDescriptorassuming it doesn't belong to an heterogeneous granules set.- Parameters:
feature- aSimpleFeaturereferring to that granulesuggestedSPI- the suggestedImageReaderSpito be used to get a reader to handle this granule.pathType- APathTypeidentifying if the granule location should be resolved as a relative or an absolute path.locationAttribute- the attribute containing the granule location.parentLocation- the location of the parent of that granule.
-
GranuleDescriptor
public GranuleDescriptor(SimpleFeature feature, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, PathType pathType, String locationAttribute, String parentLocation, MultiLevelROI roiProvider, boolean heterogeneousGranules, Hints hints)
Constructor for theGranuleDescriptor- Parameters:
feature- aSimpleFeaturereferring to that granulesuggestedSPI- the suggestedImageReaderSpito be used to get a reader to handle this granule.pathType- APathTypeidentifying if the granule location should be resolved as a relative or an absolute path.locationAttribute- the attribute containing the granule location.parentLocation- the location of the parent of that granule.heterogeneousGranules- iftrue, this granule belongs to a set of heterogeneous granules
-
-
Method Detail
-
getGranuleEnvelope
public GeneralBounds getGranuleEnvelope()
-
setGranuleEnvelope
public void setGranuleEnvelope(GeneralBounds granuleEnvelope)
-
init
protected void init(BoundingBox granuleBBOX, URL granuleUrl, AbstractGridFormat suggestedFormat, ImageReaderSpi suggestedSPI, ImageInputStreamSpi suggestedIsSPI, MultiLevelROI roiProvider, boolean heterogeneousGranules, boolean handleArtifactsFiltering, Hints hints)
-
getOverviewsController
public OverviewsController getOverviewsController()
-
loadRaster
public GranuleDescriptor.GranuleLoadingResult loadRaster(ImageReadParam imageReadParameters, int index, ReferencedEnvelope cropBBox, MathTransform2D mosaicWorldToGrid, RasterLayerRequest request, Hints hints) throws IOException
Load a specified a raster as a portion of the granule describe by thisGranuleDescriptor.- Parameters:
imageReadParameters- theImageReadParamto use for reading.index- the index to use for theImageReader.cropBBox- the bbox to use for cropping.mosaicWorldToGrid- the cropping grid to world transform.request- the incoming request to satisfy.hints-Hintsto be used for creating this raster.- Returns:
- a specified a raster as a portion of the granule describe by this
GranuleDescriptor. - Throws:
IOException- in case an error occurs.
-
getGranuleBBOX
public BoundingBox getGranuleBBOX()
-
getGranuleUrl
public URL getGranuleUrl()
-
getOriginator
public SimpleFeature getOriginator()
-
getFootprint
public Geometry getFootprint()
-
getReader
public AbstractGridCoverage2DReader getReader()
Returns a new instance of the AbstractGridCoverage2DReader associated with this descriptor. It's the responsibility of the caller to dispose of it.
-
getRoiProvider
public MultiLevelROI getRoiProvider()
- Returns:
-
getMaskOverviewProvider
public MaskOverviewProvider getMaskOverviewProvider()
-
-