gov.nasa.worldwind.data
Class AbstractDataRaster
java.lang.Object
gov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.data.AbstractDataRaster
- All Implemented Interfaces:
- AVList, DataRaster, Disposable
- Direct Known Subclasses:
- BufferedImageRaster, BufferWrapperRaster, GDALDataRaster
public abstract class AbstractDataRaster
- extends AVListImpl
- implements DataRaster
|
Method Summary |
protected Rectangle |
computeClipRect(Sector clipSector,
DataRaster clippedRaster)
|
protected AffineTransform |
computeGeographicToRasterTransform(int width,
int height,
Sector sector)
|
protected AffineTransform |
computeSourceToDestTransform(int sourceWidth,
int sourceHeight,
Sector sourceSector,
int destWidth,
int destHeight,
Sector destSector)
|
int |
getHeight()
Returns the raster's height in raster units. |
Sector |
getSector()
Returns the region covered be the data. |
DataRaster |
getSubRaster(AVList params)
Reads the specified region of interest (ROI) with given extent, width, and height, and type |
DataRaster |
getSubRaster(int width,
int height,
Sector sector,
AVList params)
Returns a portion of this raster as another raster. |
int |
getWidth()
Returns the raster's width in raster units. |
Object |
setValue(String key,
Object value)
Adds a key/value pair to the list. |
| Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gov.nasa.worldwind.avlist.AVList |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues |
height
protected int height
width
protected int width
AbstractDataRaster
protected AbstractDataRaster()
AbstractDataRaster
protected AbstractDataRaster(int width,
int height,
Sector sector)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
AbstractDataRaster
protected AbstractDataRaster(int width,
int height,
Sector sector,
AVList list)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
computeClipRect
protected Rectangle computeClipRect(Sector clipSector,
DataRaster clippedRaster)
computeGeographicToRasterTransform
protected AffineTransform computeGeographicToRasterTransform(int width,
int height,
Sector sector)
computeSourceToDestTransform
protected AffineTransform computeSourceToDestTransform(int sourceWidth,
int sourceHeight,
Sector sourceSector,
int destWidth,
int destHeight,
Sector destSector)
getHeight
public int getHeight()
- Description copied from interface:
DataRaster
- Returns the raster's height in raster units.
- Specified by:
getHeight in interface DataRaster
- Returns:
- the raster's height in raster units.
getSector
public Sector getSector()
- Description copied from interface:
DataRaster
- Returns the region covered be the data.
- Specified by:
getSector in interface DataRaster
- Returns:
- a sector indicating the region covered by the raster.
getSubRaster
public DataRaster getSubRaster(AVList params)
- Reads the specified region of interest (ROI) with given extent, width, and height, and type
- Specified by:
getSubRaster in interface DataRaster
- Parameters:
params - Required parameters are:
AVKey.HEIGHT as Integer, specifies a height of the desired ROI AVKey.WIDTH as Integer, specifies a
width of the desired ROI AVKey.SECTOR as Sector, specifies an extent of the desired ROI
Optional parameters are:
AVKey.BAND_ORDER as array of integers, examples: for RGBA image: new int[] { 0, 1, 2, 3 }, or for
ARGB image: new int[] { 3, 0, 1, 2 } or if you want only RGB bands of the RGBA image: new int[] {
0, 1, 2 } or only Intensity (4th) band of the specific aerial image: new int[] { 3 }
- Returns:
- DataRaster (BufferedImageRaster for imagery or ByteBufferDataRaster for elevations)
getSubRaster
public DataRaster getSubRaster(int width,
int height,
Sector sector,
AVList params)
- Description copied from interface:
DataRaster
- Returns a portion of this raster as another raster. The returned raster conforms to EPSG:4326 even if this raster
does not.
- Specified by:
getSubRaster in interface DataRaster
- Parameters:
width - the width to make the returned sub-raster.height - the height to make the returned sub-raster.sector - the sector to copy.params - a list of parameters that specify the width, height and sector of the region to return. Specify
these values using AVKey.WIDTH, AVKey.HEIGHT and AVKey.SECTOR.
- Returns:
- the requested raster, or null if the raster could not be created.
getWidth
public int getWidth()
- Description copied from interface:
DataRaster
- Returns the raster's width in raster units.
- Specified by:
getWidth in interface DataRaster
- Returns:
- the raster's width in raster units.
setValue
public Object setValue(String key,
Object value)
- Description copied from interface:
AVList
- Adds a key/value pair to the list. Replaces an existing key/value pair if the list already contains the key.
- Specified by:
setValue in interface AVList- Overrides:
setValue in class AVListImpl
- Parameters:
key - the attribute name. May not be null.value - the attribute value. May be null, in which case any existing value for the key is
removed from the collection.
- Returns:
- previous value associated with specified key, or null if there was no mapping for key. A null return can
also indicate that the map previously associated null with the specified key, if the implementation
supports null values.