Class TileReadEvent
Object
EventObject
StoreEvent
TileReadEvent
- All Implemented Interfaces:
Serializable, Localized
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:
-
Field Summary
Fields inherited from class EventObject
source -
Method Summary
Modifier and TypeMethodDescriptionComputes the bounds of the tile in the given two-dimensional CRS.intReturns the zero-based index of the pyramid level of the tile which is read.double[]Returns the resolution in units of the coverage CRS.long[]Returns the location of the tile in units of grid coordinates of the grid coverage.Returns the width and height of the tile in pixels.Computes the outline of the tile in the given two-dimensional CRS.Returns a string representation of this event for debugging purposes.Methods inherited from class StoreEvent
consume, getLocale, getSource, isConsumedModifier and TypeMethodDescriptionvoidconsume(boolean later) Marks this event as consumed.Returns the locale associated with this event, ornullif unspecified.Returns the resource where the event occurred.final booleanIndicates whether this event has been consumed by any listener.
-
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
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 bygetResolution()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:
IncompleteGridGeometryException- 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:
IncompleteGridGeometryException- if the "grid to CRS" transform is missing.TransformException- if the tile bounds cannot be transformed to the given CRS.
-
outline
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:
IncompleteGridGeometryException- if the "grid to CRS" transform is missing.TransformException- if the tile bounds cannot be transformed to the given CRS.
-
toString
Returns a string representation of this event for debugging purposes.- Overrides:
toStringin classEventObject- Returns:
- a string representation of this event.
-