Class JGrassRasterData

  • All Implemented Interfaces:
    RasterData

    public class JGrassRasterData
    extends Object
    implements RasterData
    Class representing JGrass's internal data format. Basically a wrapper.
    Author:
    Andrea Antonello - www.hydrologis.com
    • Constructor Detail

      • JGrassRasterData

        public JGrassRasterData​(double[][] data)
        Create the object from an existing data matrix
        Parameters:
        data -
      • JGrassRasterData

        public JGrassRasterData​(double[][] data,
                                double value)
        Create a new data object initializing its values
        Parameters:
        data - the new memory allocation for the data
        value - init value
    • Method Detail

      • getValueAt

        public double getValueAt​(int row,
                                 int col)
        Description copied from interface: RasterData
        Get the raster's value at given row and col.
        Specified by:
        getValueAt in interface RasterData
        Returns:
        the value in double format
      • getValueAt

        public double getValueAt​(int index)
        Description copied from interface: RasterData
        Get the raster's value at given position.
        Specified by:
        getValueAt in interface RasterData
        Returns:
        the value in double format
      • getValueAt

        public double getValueAt​(Point point)
        Description copied from interface: RasterData
        Get the raster's value at given position.
        Specified by:
        getValueAt in interface RasterData
        Parameters:
        point - the row, col position
        Returns:
        the value in double format
      • setValueAt

        public void setValueAt​(int row,
                               int col,
                               double value)
        Description copied from interface: RasterData
        Set the raster's value at given row and col.
        Specified by:
        setValueAt in interface RasterData
      • setValueAt

        public void setValueAt​(int index,
                               double value)
        Description copied from interface: RasterData
        Set the raster's value at given position.
        Specified by:
        setValueAt in interface RasterData
      • getRows

        public int getRows()
        Specified by:
        getRows in interface RasterData
        Returns:
        the number of rows of the raster
      • getCols

        public int getCols()
        Specified by:
        getCols in interface RasterData
        Returns:
        the number of cols of the raster
      • getRowValue

        public double[] getRowValue​(int row)
        Description copied from interface: RasterData
        Get a row of the raster matrix
        Specified by:
        getRowValue in interface RasterData
        Parameters:
        row - the row to extract
      • getData

        public double[][] getData()
        Description copied from interface: RasterData
        Get the matrix of data.
        Specified by:
        getData in interface RasterData
        Returns:
        the matrix of data.