Interface RasterData

  • All Known Implementing Classes:
    JGrassRasterData

    public interface RasterData

    Interface describing a raster map for JGrass internal usage.

    This was thought instead of the direct data matrix usage in order to be able to migrate to the coverage standard at some point.

    Author:
    Andrea Antonello - www.hydrologis.com
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getCols()  
      double[][] getData()
      Get the matrix of data.
      int getRows()  
      double[] getRowValue​(int row)
      Get a row of the raster matrix
      double getValueAt​(int index)
      Get the raster's value at given position.
      double getValueAt​(int row, int col)
      Get the raster's value at given row and col.
      double getValueAt​(Point point)
      Get the raster's value at given position.
      void setValueAt​(int index, double value)
      Set the raster's value at given position.
      void setValueAt​(int row, int col, double value)
      Set the raster's value at given row and col.
      String toString()  
    • Method Detail

      • getValueAt

        double getValueAt​(int row,
                          int col)
        Get the raster's value at given row and col.
        Parameters:
        row -
        col -
        Returns:
        the value in double format
      • getValueAt

        double getValueAt​(int index)
        Get the raster's value at given position.
        Parameters:
        index -
        Returns:
        the value in double format
      • getValueAt

        double getValueAt​(Point point)
        Get the raster's value at given position.
        Parameters:
        point - the row, col position
        Returns:
        the value in double format
      • setValueAt

        void setValueAt​(int row,
                        int col,
                        double value)
        Set the raster's value at given row and col.
        Parameters:
        row -
        col -
        value -
      • setValueAt

        void setValueAt​(int index,
                        double value)
        Set the raster's value at given position.
        Parameters:
        index -
        value -
      • getRows

        int getRows()
        Returns:
        the number of rows of the raster
      • getCols

        int getCols()
        Returns:
        the number of cols of the raster
      • toString

        String toString()
        Overrides:
        toString in class Object
        Returns:
        a string representation of the raster
      • getRowValue

        double[] getRowValue​(int row)
        Get a row of the raster matrix
        Parameters:
        row - the row to extract
      • getData

        double[][] getData()
        Get the matrix of data.
        Returns:
        the matrix of data.