Class 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 
      Constructor Description
      AscRead()  
    • 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,
                                     String tableReference,
                                     org.locationtech.jts.geom.Geometry envelope,
                                     int downScale,
                                     boolean extractAsPolygons)
                              throws IOException,
                                     SQLException
        Import a small subset of ASC file.
        Parameters:
        connection -
        fileName -
        tableReference -
        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
        SQLException
      • 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 -
        fileName -
        tableReference -
        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
        SQLException
      • 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 -
        fileName -
        tableReference -
        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
        SQLException