org.openjump.core.rasterimage.sextante
Class OpenJUMPSextanteRasterLayer

java.lang.Object
  extended by org.openjump.core.rasterimage.sextante.AbstractSextanteRasterLayer
      extended by org.openjump.core.rasterimage.sextante.OpenJUMPSextanteRasterLayer
All Implemented Interfaces:
ISextanteDataObject, ISextanteLayer, ISextanteRasterLayer

public class OpenJUMPSextanteRasterLayer
extends AbstractSextanteRasterLayer


Field Summary
 
Fields inherited from class org.openjump.core.rasterimage.sextante.AbstractSextanteRasterLayer
m_BaseDataObject
 
Fields inherited from interface org.openjump.core.rasterimage.sextante.ISextanteRasterLayer
INTERPOLATION_BicubicSpline, INTERPOLATION_Bilinear, INTERPOLATION_BSpline, INTERPOLATION_InverseDistance, INTERPOLATION_NearestNeighbour, RASTER_DATA_TYPE_BYTE, RASTER_DATA_TYPE_DOUBLE, RASTER_DATA_TYPE_FLOAT, RASTER_DATA_TYPE_INT, RASTER_DATA_TYPE_SHORT
 
Constructor Summary
OpenJUMPSextanteRasterLayer()
           
 
Method Summary
 void close()
          This method closes the data object, which was opened using the open() method.
 void create(RasterImageLayer layer)
           
 void create(RasterImageLayer layer, boolean loadFromFile)
           
 void create(java.lang.String name, java.lang.String filename, GridExtent ge, int dataType, int numBands, java.lang.Object crs, LayerManager layerManager)
           
 void fitToGridExtent(GridExtent ge, LayerManager layerManager)
          Resamples the layer so the new full extent is the same as a given gridExtent
 int getBandsCount()
          Returns the number of bands of the layer
 double getCellValueInLayerCoords(int x, int y, int band)
          Returns the value of a cell in the original image coords, that is, not using the query window
 java.lang.Object getCRS()
          Returns an object with information about the CRS associated to this layer.
 int getDataType()
          Returns the data type of the layer
 java.lang.String getFilename()
          Returns the filename associated to this data object.
 java.awt.geom.Rectangle2D getFullExtent()
          Returns the extent covered by the layer
 double getLayerCellSize()
          Return the original cellsize of the layer.
 GridExtent getLayerGridExtent()
          Returns the grid extent of the layer
 java.lang.String getName()
          Returns the name of this data object
 double getNoDataValue()
          Gets the no-data value of the layer
 void open()
          This methods initialize the data object, so it is ready to be accessed
 void postProcess()
          This method post-processes the object after it has been created.
 void setCellValue(int x, int y, int band, double value)
          Sets the value at a cell
 void setName(java.lang.String sName)
          Sets a new name for this object
 void setNoDataValue(double noDataValue)
          Sets the no-data value of the layer
 
Methods inherited from class org.openjump.core.rasterimage.sextante.AbstractSextanteRasterLayer
add, addToCellValue, addToCellValue, assign, assign, assignNoData, getAccumulatedHistogram, getAccumulatedHistogram, getAspect, getBaseDataObject, getCellValueAsByte, getCellValueAsByte, getCellValueAsDouble, getCellValueAsDouble, getCellValueAsFloat, getCellValueAsFloat, getCellValueAsInt, getCellValueAsInt, getCellValueAsShort, getCellValueAsShort, getDirToNextDownslopeCell, getDirToNextDownslopeCell, getDistToNeighborInDir, getHistogram, getHistogram, getMaxValue, getMaxValue, getMeanValue, getMeanValue, getMinValue, getMinValue, getNX, getNY, getSlope, getUnitDistToNeighborInDir, getValueAt, getValueAt, getVariance, getVariance, getWindowCellSize, getWindowGridExtent, isInWindow, isNoDataValue, multiply, setCellValue, setFullExtent, setInterpolationMethod, setNoData, setNoData, setWindowExtent, setWindowExtent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenJUMPSextanteRasterLayer

public OpenJUMPSextanteRasterLayer()
Method Detail

create

public void create(RasterImageLayer layer)

create

public void create(RasterImageLayer layer,
                   boolean loadFromFile)

create

public void create(java.lang.String name,
                   java.lang.String filename,
                   GridExtent ge,
                   int dataType,
                   int numBands,
                   java.lang.Object crs,
                   LayerManager layerManager)

fitToGridExtent

public void fitToGridExtent(GridExtent ge,
                            LayerManager layerManager)
Description copied from interface: ISextanteRasterLayer
Resamples the layer so the new full extent is the same as a given gridExtent

Parameters:
ge - the reference gridExtent

getBandsCount

public int getBandsCount()
Description copied from interface: ISextanteRasterLayer
Returns the number of bands of the layer

Returns:
the number of bands of the layer

getCellValueInLayerCoords

public double getCellValueInLayerCoords(int x,
                                        int y,
                                        int band)
Description copied from interface: ISextanteRasterLayer
Returns the value of a cell in the original image coords, that is, not using the query window

Parameters:
x - the x coordinate(col) of the cell
y - the y coordinate(row) of the cell
band - the band to be queried
Returns:
the value of a cell in the original image coords.

getDataType

public int getDataType()
Description copied from interface: ISextanteRasterLayer
Returns the data type of the layer

Returns:
the data type of the layer

getLayerCellSize

public double getLayerCellSize()
Description copied from interface: ISextanteRasterLayer
Return the original cellsize of the layer. X and Y cellsizes are assumed to be equal

Returns:
the original cellsize of the layer

getLayerGridExtent

public GridExtent getLayerGridExtent()
Description copied from interface: ISextanteRasterLayer
Returns the grid extent of the layer

Returns:
the grid extent of the layer

getNoDataValue

public double getNoDataValue()
Description copied from interface: ISextanteRasterLayer
Gets the no-data value of the layer

Returns:
the no-data value of the layer

setCellValue

public void setCellValue(int x,
                         int y,
                         int band,
                         double value)
Description copied from interface: ISextanteRasterLayer
Sets the value at a cell

Parameters:
x - the x coordinate (cols)
y - the y coordinate (rows)
band - the band (zero-based)
value - the new value

setNoDataValue

public void setNoDataValue(double noDataValue)
Description copied from interface: ISextanteRasterLayer
Sets the no-data value of the layer

Parameters:
noDataValue - the new no-data value

getCRS

public java.lang.Object getCRS()
Description copied from interface: ISextanteLayer
Returns an object with information about the CRS associated to this layer. The class of this object depends on the implementation of this interface

Returns:
An object with information about the CRS used for this layer (i.e. a string with a EPSG code)

getFullExtent

public java.awt.geom.Rectangle2D getFullExtent()
Returns the extent covered by the layer

Returns:
the extent of the layer

open

public void open()
Description copied from interface: ISextanteDataObject
This methods initialize the data object, so it is ready to be accessed


close

public void close()
Description copied from interface: ISextanteDataObject
This method closes the data object, which was opened using the open() method.


postProcess

public void postProcess()
                 throws java.lang.Exception
Description copied from interface: ISextanteDataObject
This method post-processes the object after it has been created. If, for instance, data are kept in memory before they are dumped to file, this method should write that file.

Throws:
java.lang.Exception

getFilename

public java.lang.String getFilename()
Description copied from interface: ISextanteDataObject
Returns the filename associated to this data object.

Returns:
the filename associated to this data object. Can be null, since the object wrapped by this class doesn't have to be file-based.

getName

public java.lang.String getName()
Description copied from interface: ISextanteDataObject
Returns the name of this data object

Returns:
the name of this data object

setName

public void setName(java.lang.String sName)
Description copied from interface: ISextanteDataObject
Sets a new name for this object

Parameters:
sName - the new name