Interface TiledGridCoverageResource.Pyramid
- Enclosing class:
TiledGridCoverageResource
TileMatrixSet implemented as an image pyramid.
This interface is used by the default implementation of TiledGridCoverageResource.getTileMatrixSets().
There is usually only one pyramid per TiledGridCoverageResource instance,
but many pyramids may exist, for example, if data are offered in different
Coordinate Reference System (CRS).
Each pyramid can have an arbitrary number of levels.
It is recommended to have one pyramid level for each preferred resolutions.
The pyramid levels must be sorted from coarsest resolution (at level 0) to finest resolution.
The number of levels is unspecified because some data stores cannot provide this information in advance.
Instead, the forPyramidLevel(int) method will be invoked with different argument values when each
level is first requested, until that method returns null for a level too high.
- Since:
- 1.7
-
Method Summary
Modifier and TypeMethodDescriptionforPyramidLevel(int level) Returns a resource for the same data as this resource but at a different resolution level.default StringReturns an identifier for this pyramid.default StringidentifierOfLevel(int level) Returns an identifier for the given level of this pyramid.default intlevelOfIdentifier(String identifier) Returns the level in this pyramid for the given local identifier.default NameFactoryReturns the name factory to use for creating identifiers of tiles and tile matrices.default OptionalIntReturns the number of pyramid levels if this information is known.default TiledGridCoverageResourceReturns a resource which is representative of all pyramid levels except for the resolution.
-
Method Details
-
identifier
Returns an identifier for this pyramid. The default implementation returns TMS as the abbreviation of "Tile Matrix Set". This is often sufficient in the common case where there is only one Tile Matrix Set per Grid Coverage Resource.This value is used for building the value of
TileMatrixSet.getIdentifier().- Returns:
- an identifier for this pyramid. Default is
"TMS". - See Also:
-
identifierOfLevel
Returns an identifier for the given level of this pyramid. The returned identifier will be local in the namespace of the pyramid identifier.- Parameters:
level- the pyramid level where 0 is the level with the coarsest resolution.- Returns:
- a local identifier for the specified level.
-
levelOfIdentifier
Returns the level in this pyramid for the given local identifier. This method is the converse ofidentifierOfLevel(int).- Parameters:
identifier- the identifier for which to get the pyramid level.- Returns:
- pyramid level associated with the given identifier.
- Throws:
IllegalArgumentException- if the given identifier is not recognized by this pyramid.
-
numberOfLevels
Returns the number of pyramid levels if this information is known. The returned value is empty if computing the number of levels is costly. For iterations over pyramid levels, it is generally preferable to invokeforPyramidLevel(int)with increasinglevelvalues until that method returnsnull.- Returns:
- the number of pyramid levels if this information is known.
-
representative
Returns a resource which is representative of all pyramid levels except for the resolution. The default implementation returns the resource at level 0, i.e. the overview. Some formats such as TIFF rather use the image at the finest resolution as the base image from which other images are derived.This method is invoked for fetching metadata such as the Coordinate Reference System. It is usually not invoked for reading pixel values, as the resolution can be anything.
- Returns:
- a resource representative of all levels (ignoring resolution), or
nullif none. - Throws:
DataStoreException- if an error occurred while creating the resource.
-
forPyramidLevel
Returns a resource for the same data as this resource but at a different resolution level. The resource at index 0 shall be the resource with the coarsest resolution (the overview), and resources at increasing index values shall be resources with increasingly finer resolutions. If the specified level is equal or greater than the number of levels in this pyramid, then this method shall returnnull.If this method returns a non-null instance r, then the following condition should hold:
r.getGridGeometry().getResolution(false)should be equal, ignoring NaN values and rounding errors, togetAvailableResolutions().get(level).- Parameters:
level- the pyramid level where 0 is the level with the coarsest resolution (the overview).- Returns:
- a resource for data at the specified pyramid level, or
nullif the given level is too high. - Throws:
DataStoreException- if an error occurred while creating the resource.- See Also:
-
nameFactory
Returns the name factory to use for creating identifiers of tiles and tile matrices. The default implementation returnsDefaultNameFactory.provider(). Subclasses can override for more control on the identifiers to create.- Returns:
- the name factory to use for creating identifiers of tiles and tile matrices.
-