Class GridReaderLayer
- Object
-
- Layer
-
- StyleLayer
-
- RasterLayer
-
- GridReaderLayer
-
- Direct Known Subclasses:
WMSLayer,WMTSMapLayer
public class GridReaderLayer extends RasterLayer
Layer used to draw a rasterGridCoverage2DReader.Direct access to the
AbstractGridCoverage2DReaderis available usinggetReader(), the outline of the raster is also available viatoFeatureCollection()for vector based rendering systems.- Since:
- 2.7
- Author:
- Jody Garnett
-
-
Field Summary
Fields Modifier and Type Field Description protected GeneralParameterValue[]paramsOptional parameters to control the rendering process.protected GridCoverage2DReaderreaderGrid coverage reader allowing direct access to raster content.-
Fields inherited from class RasterLayer
source
-
Fields inherited from class StyleLayer
style
-
-
Constructor Summary
Constructors Constructor Description GridReaderLayer(GridCoverage2DReader reader, Style style)Create a lyaer to draw the provided grid coverage reader.GridReaderLayer(GridCoverage2DReader reader, Style style, String title)Create a layer to draw the provided grid coverage reader.GridReaderLayer(GridCoverage2DReader reader, Style style, String title, GeneralParameterValue[] params)Create layer title and optional parameters used to control the rendering process.GridReaderLayer(GridCoverage2DReader reader, Style style, GeneralParameterValue[] params)Create a layer with optional parameters to control the rendering process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Allows a Layer to clean up any listeners, or internal caches or resources it has added during use.ReferencedEnvelopegetBounds()The bounds of the Layer content (if known).GeneralParameterValue[]getParams()Parameter values used when reading.GridCoverage2DReadergetReader()Reader used for efficient access to raster content.SimpleFeatureCollectiontoFeatureCollection()Supply a FeatureCollection indicating where the raster is located, we ask that the features use the same coordinate reference system as your raster data and form an outline or foot print of the information you have available.-
Methods inherited from class RasterLayer
getFeatureSource
-
Methods inherited from class StyleLayer
getStyle, setStyle
-
Methods inherited from class Layer
addMapLayerListener, connectDataListener, finalize, fireMapLayerListenerLayerChanged, fireMapLayerListenerLayerDeselected, fireMapLayerListenerLayerHidden, fireMapLayerListenerLayerPreDispose, fireMapLayerListenerLayerSelected, fireMapLayerListenerLayerShown, getQuery, getTitle, getUserData, isSelected, isVisible, preDispose, removeMapLayerListener, setSelected, setTitle, setVisible, toString
-
-
-
-
Field Detail
-
reader
protected GridCoverage2DReader reader
Grid coverage reader allowing direct access to raster content.
-
params
protected GeneralParameterValue[] params
Optional parameters to control the rendering process.
-
-
Constructor Detail
-
GridReaderLayer
public GridReaderLayer(GridCoverage2DReader reader, Style style)
Create a lyaer to draw the provided grid coverage reader.- Parameters:
reader- a reader with the new layer that will be added
-
GridReaderLayer
public GridReaderLayer(GridCoverage2DReader reader, Style style, String title)
Create a layer to draw the provided grid coverage reader.- Parameters:
reader- a reader with the new layer that will be added.
-
GridReaderLayer
public GridReaderLayer(GridCoverage2DReader reader, Style style, GeneralParameterValue[] params)
Create a layer with optional parameters to control the rendering process.- Parameters:
reader- a reader with the new layer that will be added.
-
GridReaderLayer
public GridReaderLayer(GridCoverage2DReader reader, Style style, String title, GeneralParameterValue[] params)
Create layer title and optional parameters used to control the rendering process.- Parameters:
reader- a reader with the new layer that will be added.params- GeneralParameterValue[] that describe how theAbstractGridCoverage2DReadershall read the images
-
-
Method Detail
-
dispose
public void dispose()
Description copied from class:LayerAllows a Layer to clean up any listeners, or internal caches or resources it has added during use.- Overrides:
disposein classRasterLayer
-
getBounds
public ReferencedEnvelope getBounds()
Description copied from class:LayerThe bounds of the Layer content (if known). The bounds can be used to determine if any of the layers content is "on screen" when rendering the map; however often it is expensive to calculate a layers bounds up front so we are allowing this value to be optional.The returned bounds are a ReferencedEnvelope using the same CoordinateReferenceSystem as the layers contents.
-
getReader
public GridCoverage2DReader getReader()
Reader used for efficient access to raster content.
-
getParams
public GeneralParameterValue[] getParams()
Parameter values used when reading.- Returns:
- parameters used when reader
-
toFeatureCollection
public SimpleFeatureCollection toFeatureCollection()
Description copied from class:RasterLayerSupply a FeatureCollection indicating where the raster is located, we ask that the features use the same coordinate reference system as your raster data and form an outline or foot print of the information you have available.This is an interesting method for a RasterLayer to have; some of the rendering systems are willing to render your raster content as an outline; for this to work they need this method to supply a feature collection indicating where the content is located. The information may also be used to determine if any of your raster content is on screen (and thus needs to be rendered).
Note this is a feature collection to allow for raster content that contains more than one image; and is not based bounding boxes (as sometimes rasters are rotated or stretched into position).
You may find the
FeatureUtilitiesuseful in wrapping up your raster content.- Specified by:
toFeatureCollectionin classRasterLayer- Returns:
- SimpleFeatureCollection indicating the location of raster content
-
-