public class DefaultRasterSet extends AbstractIndexedVisitable implements RasterSet, Observer
Modifier and Type | Field and Description |
---|---|
protected Buffer |
buffer |
protected static Logger |
logger |
protected RasterQuery |
query |
INTERPOLATION_BicubicSpline, INTERPOLATION_Bilinear, INTERPOLATION_BSpline, INTERPOLATION_InverseDistance, INTERPOLATION_NearestNeighbour, INTERPOLATION_Undefined
Constructor and Description |
---|
DefaultRasterSet(RasterStore store,
RasterQuery query)
Creates a RasterSet with the raster filtered by the query
|
Modifier and Type | Method and Description |
---|---|
void |
addBand(Band band)
Adds a band
|
void |
addObserver(Observer o) |
boolean |
areAllBandsOfTheSameType() |
Buffer |
clip(Envelope envelope) |
Buffer |
convert(ICoordTrans ct,
SimpleTaskStatus status)
Converts buffer using specified coordinate transformation
|
Buffer |
createInterpolated(int rows,
int columns,
int interpolationMode,
SimpleTaskStatus status)
Creates a interpolated buffer
|
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
protected void |
doAccept(Visitor visitor,
long firstValueIndex)
Provides each value of this container to the provided
Visitor . |
void |
doDispose()
Internal implementation for the
dispose() method. |
protected void |
finalize() |
Band |
getBand(int pos)
Gets the band in the "pos" position
|
Band.BandByte |
getBandByte(int pos) |
int |
getBandCount() |
Band.BandDouble |
getBandDouble(int pos) |
Band.BandFloat |
getBandFloat(int pos) |
Band.BandInt |
getBandInt(int pos) |
NoData[] |
getBandNoData() |
Band[] |
getBands() |
Band.BandShort |
getBandShort(int pos) |
BandInfo[] |
getBandsInfo() |
int[] |
getBandTypes() |
java.awt.image.BufferedImage |
getBufferedImage() |
int |
getColumns() |
BufferDimensions |
getDimensions() |
Envelope |
getEnvelope() |
double |
getPixelSizeX() |
double |
getPixelSizeY() |
IProjection |
getProjection() |
int |
getRows() |
Statistics |
getStatistics(SimpleTaskStatus status)
Gets the statistics of the object than implements this interface
|
boolean |
isEmpty() |
boolean |
isFromStore(DataStore store)
Indicates whether this DataSet belongs to a specific store
|
boolean |
isInside(int cellX,
int cellY)
Returns true if passed as parameter cell is inside of the buffer, else returns false.
|
boolean |
isInside(Point point)
Returns true if passed as parameter point is inside of the buffer, else returns false.
|
java.util.Iterator<Band> |
iterator() |
void |
removeBand(int pos)
Removes the band in the "pos" position
|
void |
setBand(int pos,
Band band)
Sets a band in the "pos" position
|
void |
switchBands(int[] positions)
Switches the bands as indicated by the parameter
|
void |
switchBands(int pos1,
int pos2)
Switches two bands
|
void |
update(Observable observable,
java.lang.Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
accept, doAccept
accept
protected static final Logger logger
protected RasterQuery query
protected Buffer buffer
public DefaultRasterSet(RasterStore store, RasterQuery query) throws DataException
store
- query
- DataException
public int getBandCount()
getBandCount
in interface Buffer
public Band[] getBands()
public int getColumns()
getColumns
in interface Buffer
public boolean areAllBandsOfTheSameType()
areAllBandsOfTheSameType
in interface Buffer
public Envelope getEnvelope() throws LocatorException, CreateEnvelopeException
getEnvelope
in interface Buffer
LocatorException
CreateEnvelopeException
public IProjection getProjection()
getProjection
in interface Buffer
public boolean isInside(int cellX, int cellY)
Buffer
public boolean isInside(Point point)
Buffer
public void setBand(int pos, Band band) throws BandException
Buffer
setBand
in interface Buffer
BandException
public void removeBand(int pos)
Buffer
removeBand
in interface Buffer
public Band getBand(int pos)
Buffer
public Band.BandByte getBandByte(int pos)
getBandByte
in interface Buffer
public Band.BandShort getBandShort(int pos)
getBandShort
in interface Buffer
public Band.BandInt getBandInt(int pos)
getBandInt
in interface Buffer
public Band.BandFloat getBandFloat(int pos)
getBandFloat
in interface Buffer
public Band.BandDouble getBandDouble(int pos)
getBandDouble
in interface Buffer
public void switchBands(int[] positions)
Buffer
switchBands
in interface Buffer
public void switchBands(int pos1, int pos2)
Buffer
switchBands
in interface Buffer
public Buffer createInterpolated(int rows, int columns, int interpolationMode, SimpleTaskStatus status) throws LocatorException, BufferException
Buffer
createInterpolated
in interface Buffer
LocatorException
BufferException
public Buffer convert(ICoordTrans ct, SimpleTaskStatus status) throws BufferException
Buffer
convert
in interface Buffer
ct
- Coordinate transformation to convert bufferBufferException
- If there are problems converting bufferpublic int[] getBandTypes()
getBandTypes
in interface Buffer
public NoData[] getBandNoData()
getBandNoData
in interface Buffer
public Buffer clip(Envelope envelope) throws BufferException
clip
in interface Buffer
BufferException
public double getPixelSizeX()
getPixelSizeX
in interface Buffer
public double getPixelSizeY()
getPixelSizeY
in interface Buffer
public Statistics getStatistics(SimpleTaskStatus status)
StatisticsCapable
getStatistics
in interface StatisticsCapable
public void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
public java.util.Iterator<Band> iterator()
iterator
in interface java.lang.Iterable<Band>
public boolean isFromStore(DataStore store)
DataSet
isFromStore
in interface DataSet
store
- a DataStorepublic void update(Observable observable, java.lang.Object notification)
Observer
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
protected void doAccept(Visitor visitor, long firstValueIndex) throws VisitCanceledException, BaseException
AbstractIndexedVisitable
Visitor
.
The VisitCanceledException
will be managed by the parent
AbstractIndexedVisitable
class, so simply throw it.doAccept
in class AbstractIndexedVisitable
VisitCanceledException
BaseException
public final void dispose()
Disposable
NOTE:After calling this method, the object may not be usable anymore.
dispose
in interface Disposable
public void doDispose() throws BaseException
dispose()
method.BaseException
dispose()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.awt.image.BufferedImage getBufferedImage()
getBufferedImage
in interface Buffer
public BufferDimensions getDimensions()
getDimensions
in interface Buffer
public BandInfo[] getBandsInfo()
getBandsInfo
in interface Buffer