Class GrassRasterReader


  • public class GrassRasterReader
    extends MapReader

    This reads any native Raster map format. It supports integer, float and double and the transformation of any of those into int, float and double matrixes, as well as in the ByteBuffers of the same tipes.

    Since:
    1.1.0
    Author:
    Andrea Antonello - www.hydrologis.com
    • Constructor Detail

      • GrassRasterReader

        public GrassRasterReader()
        Creates a new instance of GrassRasterReader
    • Method Detail

      • open

        public boolean open​(String mapPath)
        Description copied from class: MapReader
        Open the resource
        Specified by:
        open in class MapReader
        Parameters:
        mapPath - the full path to the resource that needs to be opened
        Returns:
        true if the resource was successfully opened
      • open

        public boolean open​(String fileName,
                            String locationPath,
                            String mapsetName)
        Description copied from class: MapReader
        Open the resource
        Specified by:
        open in class MapReader
        Parameters:
        fileName - the name of the resource
        locationPath - the path to the GRASS location
        mapsetName - the name of the mapset holding the resource
        Returns:
        true if the resource was successfully opened
      • close

        public void close()
        Description copied from class: MapReader
        close the resource, deallocation whatever needed to be deallocated
        Specified by:
        close in class MapReader
      • hasChanged

        public void hasChanged​(boolean _haschanged)
      • setOutputDataObject

        public void setOutputDataObject​(Object _dataObject)
        Description copied from class: MapReader
        Define the output data object. The output data object is the kind of result that the reader will give. This can be for example:
        • when you need to elaborate the data, a double matrix, so the odo would be new double[][]
        • when you need to visualize the data, a floatbuffer, so the odo would be new FloatBuffer
        Overrides:
        setOutputDataObject in class MapReader
        Parameters:
        _dataObject - the output data object
      • getMapPath

        public String getMapPath()
        Returns the path to the map relative to the mapset.
      • getRange

        public double[] getRange()
        retrieve the range values of the map
        Specified by:
        getRange in class MapReader
        Returns:
        an array containing the min and max value of the resource