public class GridReaderLayer extends RasterLayer
GridCoverage2DReader
.
Direct access to the AbstractGridCoverage2DReader
is available using getReader()
, the outline of the raster is also available via toFeatureCollection()
for
vector based rendering systems.
Modifier and Type | Field and Description |
---|---|
protected GeneralParameterValue[] |
params
Optional parameters to control the rendering process.
|
protected GridCoverage2DReader |
reader
Grid coverage reader allowing direct access to raster content.
|
source
style
Constructor and Description |
---|
GridReaderLayer(GridCoverage2DReader reader,
Style style)
Create a lyaer to draw the provided grid coverage reader.
|
GridReaderLayer(GridCoverage2DReader reader,
Style style,
GeneralParameterValue[] params)
Create a layer with optional parameters to control the rendering process.
|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Allows a Layer to clean up any listeners, or internal caches or resources it has added during
use.
|
ReferencedEnvelope |
getBounds()
The bounds of the Layer content (if known).
|
GeneralParameterValue[] |
getParams()
Parameter values used when reading.
|
GridCoverage2DReader |
getReader()
Reader used for efficient access to raster content.
|
SimpleFeatureCollection |
toFeatureCollection()
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.
|
getFeatureSource
getStyle, setStyle
addMapLayerListener, connectDataListener, finalize, fireMapLayerListenerLayerChanged, fireMapLayerListenerLayerDeselected, fireMapLayerListenerLayerHidden, fireMapLayerListenerLayerPreDispose, fireMapLayerListenerLayerSelected, fireMapLayerListenerLayerShown, getQuery, getTitle, getUserData, isSelected, isVisible, preDispose, removeMapLayerListener, setSelected, setTitle, setVisible, toString
protected GridCoverage2DReader reader
protected GeneralParameterValue[] params
public GridReaderLayer(GridCoverage2DReader reader, Style style)
reader
- a reader with the new layer that will be addedstyle
- SchemaException
FactoryRegistryException
TransformException
public GridReaderLayer(GridCoverage2DReader reader, Style style, String title)
reader
- a reader with the new layer that will be added.style
- title
- params
- GeneralParameterValue[] that describe how the GridCoverage2DReader
shall read the imagesSchemaException
FactoryRegistryException
TransformException
public GridReaderLayer(GridCoverage2DReader reader, Style style, GeneralParameterValue[] params)
reader
- a reader with the new layer that will be added.style
- title
- SchemaException
FactoryRegistryException
TransformException
public GridReaderLayer(GridCoverage2DReader reader, Style style, String title, GeneralParameterValue[] params)
reader
- a reader with the new layer that will be added.style
- title
- params
- GeneralParameterValue[] that describe how the AbstractGridCoverage2DReader
shall read the imagesSchemaException
FactoryRegistryException
TransformException
public void dispose()
Layer
dispose
in class RasterLayer
public ReferencedEnvelope getBounds()
Layer
The returned bounds are a ReferencedEnvelope using the same CoordinateReferenceSystem as the layers contents.
public GridCoverage2DReader getReader()
public GeneralParameterValue[] getParams()
public SimpleFeatureCollection toFeatureCollection()
RasterLayer
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 FeatureUtilities
useful in wrapping up your raster content.
toFeatureCollection
in class RasterLayer
Copyright © 1996–2019 Geotools. All rights reserved.