Class AscReaderDriver


  • public class AscReaderDriver
    extends Object
    Driver to import ESRI ASCII Raster file as polygons This class is written to directly access the ESRI ascii grid format. The ASCII grid data file format comprises a few lines of header data followed by lists of cell values. The header data includes the following keywords and values: ncols : number of columns in the data set. nrows : number of rows in the data set. xllcorner : x-coordinate of the west border of the LowerLeft corner. yllcorner : y-coordinate of the south border of the LowerLeft corner. cellsize : size of the square cell of the data set. NODATA_value : arbitrary value assigned to unknown cells.
    Author:
    Nicolas Fortin (Université Gustave Eiffel 2020), Erwan Bocher, CNRS, 2020
    • Constructor Detail

      • AscReaderDriver

        public AscReaderDriver()
    • Method Detail

      • isAs3DPoint

        public boolean isAs3DPoint()
        Returns:
        If true ASC is imported as 3D points cloud, Raster is imported in pixel polygons otherwise.
      • setAs3DPoint

        public void setAs3DPoint​(boolean as3DPoint)
        Parameters:
        as3DPoint - If true ASC is imported as 3D points cloud, Raster is imported in pixel polygons otherwise.
      • getExtractEnvelope

        public org.locationtech.jts.geom.Envelope getExtractEnvelope()
        Returns:
        Imported geometries are filtered using this optional envelope
      • setExtractEnvelope

        public void setExtractEnvelope​(org.locationtech.jts.geom.Envelope extractEnvelope)
        Parameters:
        extractEnvelope - Imported geometries are filtered using this optional envelope. Set Null object for no filtering.
      • getDownScale

        public int getDownScale()
        Returns:
        Coefficient used for exporting less cells (1 all cells, 2 for size / 2)
      • setDownScale

        public void setDownScale​(int downScale)
        Parameters:
        downScale - Coefficient used for exporting less cells (1 all cells, 2 for size / 2)
      • read

        public String[] read​(Connection connection,
                             File fileName,
                             org.h2gis.api.ProgressVisitor progress,
                             String tableReference,
                             int srid)
                      throws SQLException,
                             IOException
        Read asc file
        Parameters:
        connection - database connection
        fileName - input file
        progress - Progress visitor following the execution.
        tableReference - output table name
        srid - the espg code of the input file
        Throws:
        IOException - Throw exception is the file cannot be accessed
        SQLException - Throw exception is the file name contains unsupported characters
      • setZType

        public void setZType​(int zType)
        Use to set the z conversion type 1 = integer 2 = double
        Parameters:
        zType - value type to manage the z value
      • setDeleteTable

        public void setDeleteTable​(boolean deleteTable)
        Set true to delete the input table if exists
        Parameters:
        deleteTable - true to delete the table
      • setEncoding

        public void setEncoding​(String encoding)
        Set encoding
        Parameters:
        encoding - file encoding
      • setImportNodata

        public void setImportNodata​(boolean importNodata)
        Set to true if nodata must be imported. Default is false
        Parameters:
        importNodata - true to read to data value