Package 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDataRaster()
protected
AbstractDataRaster(int width, int height, Sector sector)
protected
AbstractDataRaster(int width, int height, Sector sector, AVList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.Rectangle
computeClipRect(Sector clipSector, DataRaster clippedRaster)
protected java.awt.geom.AffineTransform
computeGeographicToRasterTransform(int width, int height, Sector sector)
protected java.awt.geom.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(int width, int height, Sector sector, AVList params)
Returns a portion of this raster as another raster.DataRaster
getSubRaster(AVList params)
Reads the specified region of interest (ROI) with given extent, width, and height, and typeint
getWidth()
Returns the raster's width in raster units.java.lang.Object
setValue(java.lang.String key, java.lang.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, 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
-
Methods inherited from interface gov.nasa.worldwind.data.DataRaster
drawOnTo
-
Methods inherited from interface gov.nasa.worldwind.Disposable
dispose
-
-
-
-
Constructor Detail
-
AbstractDataRaster
protected AbstractDataRaster()
-
AbstractDataRaster
protected AbstractDataRaster(int width, int height, Sector sector) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
-
Method Detail
-
getWidth
public int getWidth()
Description copied from interface:DataRaster
Returns the raster's width in raster units.- Specified by:
getWidth
in interfaceDataRaster
- Returns:
- the raster's width in raster units.
-
getHeight
public int getHeight()
Description copied from interface:DataRaster
Returns the raster's height in raster units.- Specified by:
getHeight
in interfaceDataRaster
- 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 interfaceDataRaster
- Returns:
- a sector indicating the region covered by the raster.
-
setValue
public java.lang.Object setValue(java.lang.String key, java.lang.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 interfaceAVList
- Overrides:
setValue
in classAVListImpl
- Parameters:
key
- the attribute name. May not benull
.value
- the attribute value. May benull
, 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.
-
computeClipRect
protected java.awt.Rectangle computeClipRect(Sector clipSector, DataRaster clippedRaster)
-
computeSourceToDestTransform
protected java.awt.geom.AffineTransform computeSourceToDestTransform(int sourceWidth, int sourceHeight, Sector sourceSector, int destWidth, int destHeight, Sector destSector)
-
computeGeographicToRasterTransform
protected java.awt.geom.AffineTransform computeGeographicToRasterTransform(int width, int height, Sector sector)
-
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 interfaceDataRaster
- 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 usingAVKey.WIDTH
,AVKey.HEIGHT
andAVKey.SECTOR
.- Returns:
- the requested raster, or null if the raster could not be created.
-
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 interfaceDataRaster
- 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)
-
-