Interface ISextanteRasterLayer

All Superinterfaces:
ISextanteDataObject, ISextanteLayer
All Known Implementing Classes:
AbstractSextanteRasterLayer, OpenJUMPSextanteRasterLayer

public interface ISextanteRasterLayer extends ISextanteLayer
This is the base interface that all raster object have to implement to be able to be used by SEXTANTE algorithms. Instead of implementing this class directly, it is recommended to extend AbstractSextanteRasterLayer, since it solves some of the most complex methods, such as grid window definition and resampling methods
Author:
Victor Olaya. volaya@unex.es
  • Field Details

  • Method Details

    • getDataType

      int getDataType()
      Returns the data type of the layer
      Returns:
      the data type of the layer
    • getWindowGridExtent

      GridExtent getWindowGridExtent()
      Returns the grid extent of the query window of this layer. Each layer can have a query window, which makes it easier to seamlessly combine several layers.
      Returns:
      the window grid extent
    • getLayerGridExtent

      GridExtent getLayerGridExtent()
      Returns the grid extent of the layer
      Returns:
      the grid extent of the layer
    • getWindowCellSize

      Point2D.Double getWindowCellSize()
      Return the cellsize of the query window. X and Y cellsizes are assumed to be equal
      Returns:
      the cellsize of the query window
    • getLayerCellSize

      Point2D.Double getLayerCellSize()
      Return the original cellsize of the layer. X and Y cellsizes are assumed to be equal
      Returns:
      the original cellsize of the layer
    • assign

      void assign(double dValue)
    • assign

      void assign(ISextanteRasterLayer layer)
    • assignNoData

      void assignNoData()
    • setCellValue

      void setCellValue(int x, int y, double dValue)
      Sets the value at a cell, in the first band of the layer
      Parameters:
      x - the x coordinate (cols)
      y - the y coordinate (rows)
      dValue - the new value
    • setCellValue

      void setCellValue(int x, int y, int iBand, double dValue)
      Sets the value at a cell
      Parameters:
      x - the x coordinate (cols)
      y - the y coordinate (rows)
      iBand - the band (zero-based)
      dValue - the new value
    • addToCellValue

      void addToCellValue(int x, int y, double dValue)
      Adds a value to the current value of a cell in the first band of the layer in the first band of the layer
      Parameters:
      x - the x coordinate (cols)
      y - the y coordinate (rows)
      dValue - the value to sum
    • addToCellValue

      void addToCellValue(int x, int y, int iBand, double dValue)
      Adds a value to the current value of a cell
      Parameters:
      x - the x coordinate (cols)
      y - the y coordinate (rows)
      iBand - the band (zero-based)
      dValue - the value to sum
    • add

      void add(ISextanteRasterLayer layer)
      adds the value of another raster layer to this one. Both layers must have the same window This is supposed to be used with monoband layers, so only the first band of each one is used.
      Parameters:
      layer - the ISextanteRasterLayer to add to this one
    • multiply

      void multiply(double d)
      Multiplies all the values of a layer by a fixed value
      Parameters:
      d - the value to multiply
    • getNoDataValue

      double getNoDataValue()
      Gets the no-data value of the layer
      Returns:
      the no-data value of the layer
    • setNoDataValue

      void setNoDataValue(double dNoDataValue)
      Sets the no-data value of the layer
      Parameters:
      dNoDataValue - the new no-data value
    • setNoData

      void setNoData(int x, int y, int iBand)
      Set the value of a cell to the no-data value
      Parameters:
      x - the x coordinate(col) of the cell to set to no-data
      y - the y coordinate(row) of the cell to set to no-data
      iBand - the band to set to no-data
    • setNoData

      void setNoData(int x, int y)
      Set the value of a cell in the first band of a layer to the no-data value
      Parameters:
      x - the x coordinate(col) of the cell to set to no-data
      y - the y coordinate(row) of the cell to set to no-data
    • isNoDataValue

      boolean isNoDataValue(double dNoDataValue)
      Checks if the given value equals the no-data value of the layer
      Parameters:
      dNoDataValue - a value to check
      Returns:
      true if the given value equals the no-data value of the layer
    • getCellValueAsByte

      byte getCellValueAsByte(int x, int y, int iBand)
    • getCellValueAsByte

      byte getCellValueAsByte(int x, int y)
    • getCellValueAsShort

      short getCellValueAsShort(int x, int y, int iBand)
    • getCellValueAsShort

      short getCellValueAsShort(int x, int y)
    • getCellValueAsInt

      int getCellValueAsInt(int x, int y, int iBand)
    • getCellValueAsInt

      int getCellValueAsInt(int x, int y)
    • getCellValueAsFloat

      float getCellValueAsFloat(int x, int y, int iBand)
    • getCellValueAsFloat

      float getCellValueAsFloat(int x, int y)
    • getCellValueAsDouble

      double getCellValueAsDouble(int x, int y, int iBand)
    • getCellValueAsDouble

      double getCellValueAsDouble(int x, int y)
    • getCellValueInLayerCoords

      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
      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.
    • getValueAt

      double getValueAt(double x, double y, int iBand)
      Returns the value at a given world coordinate. The current interpolation method is used if the coordinate does not fall on the exact center of a cell.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      iBand - the band to query
      Returns:
      the value at the given world coordinate
    • getValueAt

      double getValueAt(double x, double y)
      Returns the value of the first band of this layer, at a given world coordinate. The current interpolation method is used if the coordinate does not fall on the exact center of a cell.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      Returns:
      the value at the given coordinate. If it falls outside of the layer, the current no-data value of the layer is returned
    • isInWindow

      boolean isInWindow(int x, int y)
      Parameters:
      x - the x coordinate(col) of the cell
      y - the y coordinate(row) of the cell
      Returns:
      true if the given ccell is within the query window extent
    • getNX

      int getNX()
      Returns the number of columns in the query window of this layer
      Returns:
      the number of columns in the query window
    • getNY

      int getNY()
      Returns the number of rows in the query window of this layer
      Returns:
      the number of rows in the query window
    • getBandsCount

      int getBandsCount()
      Returns the number of bands of the layer
      Returns:
      the number of bands of the layer
    • setWindowExtent

      void setWindowExtent(ISextanteRasterLayer layer)
      Sets the extent of the query window using the full extent of another layer
      Parameters:
      layer - the layer from which to take the extent
    • setWindowExtent

      void setWindowExtent(GridExtent gridExtent)
      Sets a new query window extent
      Parameters:
      gridExtent - the new grid extent to set fro this layer
    • setFullExtent

      void setFullExtent()
      Sets the query window extent to the full extent of the layer
    • fitToGridExtent

      void fitToGridExtent(GridExtent gridExtent, LayerManager layerManager)
      Resamples the layer so the new full extent is the same as a given gridExtent
      Parameters:
      gridExtent - the reference gridExtent
      layerManager - the LayerManager
    • setInterpolationMethod

      void setInterpolationMethod(int iMethod)
      Sets the interpolation method to use for calculating value in points other than cell centers
      Parameters:
      iMethod - method to use for interpolation
    • getMeanValue

      double getMeanValue()
      Returns the mean value in the first band of the layer
      Returns:
      the mean value of the first band of this layer
    • getMinValue

      double getMinValue()
      Returns the min value in the first band of the layer
      Returns:
      the min value of the first band of this layer
    • getMaxValue

      double getMaxValue()
      Returns the max value in the first band of the layer
      Returns:
      the max value of the first band of this layer
    • getVariance

      double getVariance()
      Returns the variance in the first band of the layer
      Returns:
      the variance of the first band of this layer
    • getMeanValue

      double getMeanValue(int iBand)
      Returns the mean value in the given band of the layer
      Parameters:
      iBand - the index of the band (zero-based)
      Returns:
      the mean value of the given band of this layer
    • getMinValue

      double getMinValue(int iBand)
      Returns the min value in the given band of the layer
      Parameters:
      iBand - the index of the band (zero-based)
      Returns:
      the min value of the given band of this layer
    • getMaxValue

      double getMaxValue(int iBand)
      Returns the max value in the given band of the layer
      Parameters:
      iBand - the index of the band (zero-based)
      Returns:
      the max value of the given band of this layer
    • getVariance

      double getVariance(int iBand)
      Returns the variance in the given band of the layer
      Parameters:
      iBand - the index of the band (zero-based)
      Returns:
      the variance of the given band of this layer
    • getSlope

      double getSlope(int x, int y)
    • getDistToNeighborInDir

      double getDistToNeighborInDir(int i)
    • getAspect

      double getAspect(int i, int j)
    • getDirToNextDownslopeCell

      int getDirToNextDownslopeCell(int x, int y)
    • getDirToNextDownslopeCell

      int getDirToNextDownslopeCell(int x, int y, boolean b)
    • getHistogram

      int[] getHistogram()
      Returns the histogram of the first band of this layer
      Returns:
      a histogram of the first band of this layer
    • getHistogram

      int[] getHistogram(int iBand)
      Returns a histogram of a given band of this layer
      Parameters:
      iBand - the index of the band (zero-based)
      Returns:
      a histogram of the given band of this layer
    • getAccumulatedHistogram

      int[] getAccumulatedHistogram()