# Package org.apache.sis.storage.tiling

package org.apache.sis.storage.tiling
Base types for retrieving and saving tiles in resources. A `TiledResource` if a resource capable to describe its tiling schemes as `TileMatrixSet` instances. A `TileMatrixSet` is a collection of `TileMatrix` instances in the same CRS but at different scale levels. A `TileMatrix` is a collection of `Tile` instances with the same size and properties placed on a regular grid with no overlapping. The "tile" word is used because of its wide usage with two-dimensional data, but actually this package has no restriction on the number of dimensions and can work with multi-dimensional "tiles" as well.

## References

- OGC Two Dimensional Tile Matrix Set — the core standard used in this package.
- OGC Web Map Tile Service (WMTS) — a common use of above standard.
- OGC Geopackage: Extension for Tiled Gridded Coverage Data — another common use.
- OGC Geopackage: Extension for vector tiles — experimental work for tiled geometries.

The concepts developed in above references are also used, often with different names, by other projects such as OSGeo Tile Map Service Specification, Cesium QuantizedMesh, Open Street Map: Slippy Map, Google Map and MapBox Tiling service.

## Relationship with OGC specifications

The `TileMatrix` and `TileMatrixSet` class names are reused as defined by OGC. The "2D" suffix in class names is omitted because this package is fully multi-dimensional. The concept of "tiling scheme" is encapsulated in a `GridGeometry`.

### Departures with OGC specifications

The OGC `TileMatrixLimits` class is replaced by `GridExtent`. The OGC restriction against negative numbers is removed (Apache SIS accepts negative tile indices). The tile span and tile matrix min/max coefficients are replaced by a more generic "grid to CRS" `MathTransform`, usually affine but not necessarily. Users may need to enforce above OGC restrictions themselves if compatibility with OGC specification is desired).

## Relationship with Java2D rendered image

OGC tiles can be mapped to Java2D tiles with the following restrictions:

- Java2D tile indices and pixel indices are 32 bits integer instead of 64 bits. See grid coverage render (in particular the relative pixel coordinates) for the workaround applied in Apache SIS.
- Java2D does not support coalescence coefficient (used in OGC tiles for compensating distortions near poles). Tiles in Java2D are expanded as needed as if the `TileMatrix` had no coalescence.

Since:
  1.2

- Related Packages
  Package
  Description
  org.apache.sis.storage
  Data store base types for retrieving and saving geospatial data in various storage formats.
- Class
  Description
  Tile
  A small hyper-rectangular representation of data which is part of a tiling scheme.
  TiledResource
  A resource which content can be accessed by smaller chunks called tiles.
  TileMatrix
  A collection of tiles with the same size and properties placed on a regular grid with no overlapping.
  TileMatrixSet
  A collection of `TileMatrix` in the same CRS but at different scale levels.
  TileStatus
  Information about the availability of a tile.
  WritableTiledResource
  A `TiledResource` that can write and delete tile matrix sets.
  WritableTileMatrix
  A `TileMatrix` that can write and delete tiles.
  WritableTileMatrixSet
  A `TileMatrixSet` that can write and delete tile matrices.