Module org.apache.sis.storage
Package org.apache.sis.storage.tiling

# Interface Tile

public interface Tile
A small hyper-rectangular representation of data which is part of a tiling scheme. A tile is uniquely defined in a tile matrix by an integer index in each dimension. Tiles can be a coverage subsets, or a feature based representation (e.g. vector tiles).

All methods in this interface return non-null values.

Since:
  1.2
See Also:
  - `TileMatrix​.getTiles(GridExtent, boolean)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long[]`
  `getIndices()`
  Returns the indices of this tile in the `TileMatrix`.
  `Resource`
  `getResource()`
  Returns the tile content as a resource.
  `TileStatus`
  `getStatus()`
  Returns information about whether the tile failed to load.

- ## Method Details

  - ### getIndices

    long[] getIndices()
    Returns the indices of this tile in the `TileMatrix`. If this tile was obtained by a call to `TileMatrix​.getTile(long...)`, then the returned array contains the indices that were given in that call.

    The returned array contains coordinates in the space defined by the extent of the tiling scheme. As such, it complies with the following constraints:

    - The array length is equal to `GridExtent​.getDimension()`.
    - The axis order — usually (column, row/) — is the extent axis order.
    - Values are between the extent low and high values, inclusive.
    Returns:
      indices of this tile in the `TileMatrix`, as coordinates inside the matrix `GridExtent`.
    See Also:
      - `TileMatrix​.getTile(long...)`

  - ### getStatus

    TileStatus getStatus()
    Returns information about whether the tile failed to load. The return value can be `TileStatus​.EXISTS` or `TileStatus​.IN_ERROR`; other enumeration values should not happen after a user successfully obtained this `Tile` instance.

    #### State transition

    `TileStatus​.EXISTS` is not a guarantee that a call to `getResource()` will succeed. The error may be detected only during the first attempt to read the resource. Consequently, this method may initially return `EXISTS`, then return `IN_ERROR` later after the first read attempt.
    Returns:
      information about the availability of this tile.
    See Also:
      - `TileMatrix​.getTileStatus(long...)`

  - ### getResource

    Resource getResource() throws DataStoreException
    Returns the tile content as a resource. The resource type is typically `GridCoverageResource`, but it may also be other types (e.g. vector tiles).
    Returns:
      the tile content.
    Throws:
      `DataStoreException` - if an error occurred while reading the content.