Class AscReaderDriver
- java.lang.Object
-
- org.noise_planet.noisemodelling.jdbc.utils.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 Summary
Constructors Constructor Description AscReaderDriver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDownScale()
org.locationtech.jts.geom.Envelope
getExtractEnvelope()
boolean
isAs3DPoint()
String[]
read(Connection connection, File fileName, org.h2gis.api.ProgressVisitor progress, String tableReference, int srid)
Read asc filevoid
setAs3DPoint(boolean as3DPoint)
void
setDeleteTable(boolean deleteTable)
Set true to delete the input table if existsvoid
setDownScale(int downScale)
void
setEncoding(String encoding)
Set encodingvoid
setExtractEnvelope(org.locationtech.jts.geom.Envelope extractEnvelope)
void
setImportNodata(boolean importNodata)
Set to true if nodata must be imported.void
setZType(int zType)
Use to set the z conversion type 1 = integer 2 = double
-
-
-
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
-fileName
-progress
-tableReference
-srid
- the espg code of the input file- Throws:
SQLException
IOException
-
setZType
public void setZType(int zType)
Use to set the z conversion type 1 = integer 2 = double- Parameters:
zType
-
-
setDeleteTable
public void setDeleteTable(boolean deleteTable)
Set true to delete the input table if exists- Parameters:
deleteTable
-
-
setEncoding
public void setEncoding(String encoding)
Set encoding- Parameters:
encoding
-
-
setImportNodata
public void setImportNodata(boolean importNodata)
Set to true if nodata must be imported. Default is false- Parameters:
importNodata
-
-
-