Interface TiledGridCoverageResource.Pyramid

Enclosing class:
Tiled­Grid­Coverage­Resource

public static interface TiledGridCoverageResource.Pyramid
Description of a Tile­Matrix­Set implemented as an image pyramid. This interface is used by the default implementation of Tiled­Grid­Coverage­Resource​.get­Tile­Matrix­Sets(). There is usually only one pyramid per Tiled­Grid­Coverage­Resource 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 for­Pyramid­Level(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 Details

    • identifier

      default String 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 Tile­Matrix­Set​.get­Identifier().

      Returns:
      an identifier for this pyramid. Default is "TMS".
      See Also:
    • identifierOfLevel

      default String identifierOfLevel(int level)
      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

      default int levelOfIdentifier(String identifier)
      Returns the level in this pyramid for the given local identifier. This method is the converse of identifier­Of­Level(int).
      Parameters:
      identifier - the identifier for which to get the pyramid level.
      Returns:
      pyramid level associated with the given identifier.
      Throws:
      Illegal­Argument­Exception - if the given identifier is not recognized by this pyramid.
    • numberOfLevels

      default OptionalInt 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 invoke for­Pyramid­Level(int) with increasing level values until that method returns null.
      Returns:
      the number of pyramid levels if this information is known.
    • representative

      default TiledGridCoverageResource representative() throws DataStoreException
      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 null if none.
      Throws:
      Data­Store­Exception - if an error occurred while creating the resource.
    • forPyramidLevel

      TiledGridCoverageResource forPyramidLevel(int level) throws DataStoreException
      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 return null.

      If this method returns a non-null instance r, then the following condition should hold: r​.get­Grid­Geometry()​.get­Resolution(false) should be equal, ignoring NaN values and rounding errors, to get­Available­Resolutions()​.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 null if the given level is too high.
      Throws:
      Data­Store­Exception - if an error occurred while creating the resource.
      See Also:
    • nameFactory

      default NameFactory nameFactory()
      Returns the name factory to use for creating identifiers of tiles and tile matrices. The default implementation returns Default­Name­Factory​.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.