Class TileReadEvent

All Implemented Interfaces:
Serializable, Localized

public final class TileReadEvent extends StoreEvent
Notifies listeners that the process of reading a tile has started. This event contains the bounding box of the tile in real world coordinates. Because this event may be sent early in the reading process, the associated Tile is generally not known yet.
Since:
1.7
See Also:
  • Method Details

    • getTileLocation

      public long[] getTileLocation()
      Returns the location of the tile in units of grid coordinates of the grid coverage. The two first elements of the array are the minimum x grid coordinate and the minimum y grid coordinate in that exact order. All other elements, if any, are the coordinates of the slice in other dimensions.

      Note: the coordinate order returned by this method is not necessarily the same as the coordinate order of the grid coverage, because this method always put x and y first for making easy to ignore the supplemental dimensions.

      Returns:
      tile location in an array of length 2 or more.
    • getTileSize

      public Dimension getTileSize()
      Returns the width and height of the tile in pixels.
      Returns:
      width and height of the tile in pixels.
    • getPyramidLevel

      public int getPyramidLevel()
      Returns the zero-based index of the pyramid level of the tile which is read. This is typically the index in the list of resource's resolution where the values returned by get­Resolution() can be found. The level with coarsest resolution (the overview) is the level 0.
      Returns:
      zero-based index of the pyramid level of the tile which is read.
      See Also:
    • getResolution

      public double[] getResolution()
      Returns the resolution in units of the coverage CRS. The length of the returned array should be 2.
      Returns:
      the resolution in units of the coverage CRS.
      Throws:
      Incomplete­Grid­Geometry­Exception - if the resolution information is missing.
    • bounds

      Computes the bounds of the tile in the given two-dimensional CRS. If the use of the given CRS may change straight lines into curves (as with some map projections), the returned bounding box contains fully (on a best-effort basis) the tile.
      Parameters:
      crs - the two-dimensional CRS of the desired bounding box.
      Returns:
      real world coordinates of the tile expressed in the given CRS.
      Throws:
      Incomplete­Grid­Geometry­Exception - if the "grid to CRS" transform is missing.
      Transform­Exception - if the tile bounds cannot be transformed to the given CRS.
    • outline

      public Shape outline(CoordinateReferenceSystem crs) throws TransformException
      Computes the outline of the tile in the given two-dimensional CRS. The returned shape may have curved lines if the use of the given CRS implies a map projection.
      Parameters:
      crs - the two-dimensional CRS of the desired outline.
      Returns:
      real world coordinates of the tile expressed in the given CRS.
      Throws:
      Incomplete­Grid­Geometry­Exception - if the "grid to CRS" transform is missing.
      Transform­Exception - if the tile bounds cannot be transformed to the given CRS.
    • toString

      public String toString()
      Returns a string representation of this event for debugging purposes.
      Overrides:
      to­String in class Event­Object
      Returns:
      a string representation of this event.