Class OpenJUMPSextanteRasterLayer
- java.lang.Object
-
- org.openjump.core.rasterimage.sextante.AbstractSextanteRasterLayer
-
- 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
Constructors Constructor Description OpenJUMPSextanteRasterLayer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()This method closes the data object, which was opened using the open() method.voidcreate(String name, String filename, GridExtent ge, int dataType, int numBands, Object crs, LayerManager layerManager)voidcreate(RasterImageLayer layer)voidcreate(RasterImageLayer layer, boolean loadFromFile)voidfitToGridExtent(GridExtent ge, LayerManager layerManager)Resamples the layer so the new full extent is the same as a given gridExtentintgetBandsCount()Returns the number of bands of the layerdoublegetCellValueInLayerCoords(int x, int y, int band)Returns the value of a cell in the original image coords, that is, not using the query windowObjectgetCRS()Returns an object with information about the CRS associated to this layer.intgetDataType()Returns the data type of the layerStringgetFilename()Returns the filename associated to this data object.Rectangle2DgetFullExtent()Returns the extent covered by the layerPoint2D.DoublegetLayerCellSize()Return the original cellsize of the layer.GridExtentgetLayerGridExtent()Returns the grid extent of the layerStringgetName()Returns the name of this data objectdoublegetNoDataValue()Gets the no-data value of the layervoidopen()This methods initialize the data object, so it is ready to be accessedvoidpostProcess()This method post-processes the object after it has been created.voidsetCellValue(int x, int y, int band, double value)Sets the value at a cellvoidsetName(String sName)Sets a new name for this objectvoidsetNoDataValue(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
-
-
-
-
Method Detail
-
create
public void create(RasterImageLayer layer) throws IOException
- Throws:
IOException
-
create
public void create(RasterImageLayer layer, boolean loadFromFile) throws IOException
- Throws:
IOException
-
create
public void create(String name, String filename, GridExtent ge, int dataType, int numBands, Object crs, LayerManager layerManager)
-
fitToGridExtent
public void fitToGridExtent(GridExtent ge, LayerManager layerManager)
Description copied from interface:ISextanteRasterLayerResamples the layer so the new full extent is the same as a given gridExtent- Parameters:
ge- the reference gridExtentlayerManager- the LayerManager
-
getBandsCount
public int getBandsCount()
Description copied from interface:ISextanteRasterLayerReturns 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:ISextanteRasterLayerReturns 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 celly- the y coordinate(row) of the cellband- the band to be queried- Returns:
- the value of a cell in the original image coords.
-
getDataType
public int getDataType()
Description copied from interface:ISextanteRasterLayerReturns the data type of the layer- Returns:
- the data type of the layer
-
getLayerCellSize
public Point2D.Double getLayerCellSize()
Description copied from interface:ISextanteRasterLayerReturn 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:ISextanteRasterLayerReturns the grid extent of the layer- Returns:
- the grid extent of the layer
-
getNoDataValue
public double getNoDataValue()
Description copied from interface:ISextanteRasterLayerGets 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:ISextanteRasterLayerSets 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:ISextanteRasterLayerSets the no-data value of the layer- Parameters:
noDataValue- the new no-data value
-
getCRS
public Object getCRS()
Description copied from interface:ISextanteLayerReturns 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 Rectangle2D getFullExtent()
Returns the extent covered by the layer- Returns:
- the extent of the layer
-
open
public void open()
Description copied from interface:ISextanteDataObjectThis methods initialize the data object, so it is ready to be accessed
-
close
public void close()
Description copied from interface:ISextanteDataObjectThis method closes the data object, which was opened using the open() method.
-
postProcess
public void postProcess() throws ExceptionDescription copied from interface:ISextanteDataObjectThis 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:
Exception- if an Exception occurs during post-processing
-
getFilename
public String getFilename()
Description copied from interface:ISextanteDataObjectReturns 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 String getName()
Description copied from interface:ISextanteDataObjectReturns the name of this data object- Returns:
- the name of this data object
-
setName
public void setName(String sName)
Description copied from interface:ISextanteDataObjectSets a new name for this object- Parameters:
sName- the new name
-
-