Package org.h2gis.functions.io.asc

## Class AscRead

- java.lang.Object
- - org.h2gis.api.AbstractFunction
  - - org.h2gis.functions.io.asc.AscRead

All Implemented Interfaces:
  `org.h2gis.api.Function`, `org.h2gis.api.ScalarFunction`

    public class AscRead
    extends org.h2gis.api.AbstractFunction
    implements org.h2gis.api.ScalarFunction

SQL function to import ESRI ASCII Raster file as points or polygons table.

Author:
  Nicolas Fortin (Université Gustave Eiffel 2020)

### Field Summary

### Fields inherited from interface org.h2gis.api.Function

`PROP_NAME, PROP_REMARKS`

### Fields inherited from interface org.h2gis.api.ScalarFunction

`PROP_DETERMINISTIC`

### Constructor Summary

Constructors
`AscRead()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`String` `getJavaStaticMethod()`
`static void` `readAscii​(Connection connection, String fileName)` Read the ASCII file.
`static void` `readAscii​(Connection connection, String fileName, String tableReference, org.h2.value.Value option)` Read the ASCII file.
`static void` `readAscii​(Connection connection, String fileName, String tableReference, org.locationtech.jts.geom.Geometry envelope, int downScale, boolean extractAsPolygons)` Import a small subset of ASC file.
`static void` `readAscii​(Connection connection, String fileName, String tableReference, org.locationtech.jts.geom.Geometry envelope, int downScale, boolean extractAsPolygons, boolean deleteTable)` Import a small subset of ASC file.
`static void` `readAscii​(Connection connection, String fileName, String tableReference, org.locationtech.jts.geom.Geometry envelope, int downScale, boolean extractAsPolygons, boolean deleteTable, String encoding, int zType)` Import a small subset of ASC file.
`static void` `readAscii​(Connection connection, String fileName, org.h2.value.Value option)` Read the ASCII file.

### Methods inherited from class org.h2gis.api.AbstractFunction

`addProperty, getProperty, removeProperty`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.h2gis.api.Function

`getProperty`

### Constructor Detail

#### AscRead

    public AscRead()

### Method Detail

#### getJavaStaticMethod

    public String getJavaStaticMethod()

Specified by:
  `getJavaStaticMethod` in interface `org.h2gis.api.ScalarFunction`

#### readAscii

    public static void readAscii​(Connection connection,
                                 String fileName)
                          throws IOException,
                                 SQLException

Read the ASCII file.

Parameters:
  `connection` - input database connection
  `fileName` - file to read
Throws:
  `IOException` - Throw exception is the file cannot be accessed
  `SQLException` - Throw exception is the file name contains unsupported characters

#### readAscii

    public static void readAscii​(Connection connection,
                                 String fileName,
                                 org.h2.value.Value option)
                          throws IOException,
                                 SQLException

Read the ASCII file.

Parameters:
  `connection` - input database connection
  `fileName` - input file name
  `option` - options to parse the file
Throws:
  `IOException` - Throw exception is the file cannot be accessed
  `SQLException` - Throw exception is the file name contains unsupported characters

#### readAscii

    public static void readAscii​(Connection connection,
                                 String fileName,
                                 String tableReference,
                                 org.h2.value.Value option)
                          throws IOException,
                                 SQLException

Read the ASCII file.

Parameters:
  `connection` - database connection
  `fileName` - input file name
  `tableReference` - output table name
  `option` - options to parse the file
Throws:
  `IOException` - Throw exception is the file cannot be accessed
  `SQLException` - Throw exception is the file name contains unsupported characters

#### readAscii

    public static void readAscii​(Connection connection,
                                 String fileName,
                                 String tableReference,
                                 org.locationtech.jts.geom.Geometry envelope,
                                 int downScale,
                                 boolean extractAsPolygons)
                          throws IOException,
                                 SQLException

Import a small subset of ASC file.

Parameters:
  `connection` - database connection
  `fileName` - input file
  `tableReference` - output table name
  `envelope` - Extract only pixels that intersects the provided geometry envelope, null to disable filter
  `downScale` - Coefficient used for exporting less cells (1 all cells, 2 for size / 2)
  `extractAsPolygons` - If true pixels are converted to polygon. (default false)
Throws:
  `IOException` - Throw exception is the file cannot be accessed
  `SQLException` - Throw exception is the file name contains unsupported characters

#### readAscii

    public static void readAscii​(Connection connection,
                                 String fileName,
                                 String tableReference,
                                 org.locationtech.jts.geom.Geometry envelope,
                                 int downScale,
                                 boolean extractAsPolygons,
                                 boolean deleteTable)
                          throws IOException,
                                 SQLException

Import a small subset of ASC file.

Parameters:
  `connection` - database connection
  `fileName` - input file
  `tableReference` - output table name
  `envelope` - Extract only pixels that intersects the provided geometry envelope, null to disable filter
  `downScale` - Coefficient used for exporting less cells (1 all cells, 2 for size / 2)
  `extractAsPolygons` - If true pixels are converted to polygon. (default false)
Throws:
  `IOException` - Throw exception is the file cannot be accessed
  `SQLException` - Throw exception is the file name contains unsupported characters

#### readAscii

    public static void readAscii​(Connection connection,
                                 String fileName,
                                 String tableReference,
                                 org.locationtech.jts.geom.Geometry envelope,
                                 int downScale,
                                 boolean extractAsPolygons,
                                 boolean deleteTable,
                                 String encoding,
                                 int zType)
                          throws IOException,
                                 SQLException

Import a small subset of ASC file.

Parameters:
  `connection` - database
  `fileName` - input file
  `tableReference` - output table name
  `envelope` - Extract only pixels that intersects the provided geometry envelope, null to disable filter
  `downScale` - Coefficient used for exporting less cells (1 all cells, 2 for size / 2)
  `extractAsPolygons` - If true pixels are converted to polygon. (default false)
Throws:
  `IOException` - Throw exception is the file cannot be accessed
  `SQLException` - Throw exception is the file name contains unsupported characters