Class SHPRead

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

    public class SHPRead
    extends org.h2gis.api.AbstractFunction
    implements org.h2gis.api.ScalarFunction
    SQL Function to copy Shape File data into a Table.
    Author:
    Nicolas Fortin, Erwan Bocher, CNRS
    • Constructor Detail

      • SHPRead

        public SHPRead()
    • Method Detail

      • getJavaStaticMethod

        public String getJavaStaticMethod()
        Specified by:
        getJavaStaticMethod in interface org.h2gis.api.ScalarFunction
      • importTable

        public static void importTable​(Connection connection,
                                       String fileName,
                                       String tableReference,
                                       org.h2.value.Value option)
                                throws IOException,
                                       SQLException
        Copy data from Shape File into a new table in specified connection.
        Parameters:
        connection - Active connection
        tableReference - [[catalog.]schema.]table reference
        option - Could be string file encoding charset or boolean value to delete the existing table
        fileName - File path of the SHP file or URI
        Throws:
        IOException
        SQLException
      • importTable

        public static void importTable​(Connection connection,
                                       String fileName,
                                       String tableReference,
                                       String forceEncoding,
                                       boolean deleteTables)
                                throws IOException,
                                       SQLException
        Copy data from Shape File into a new table in specified connection.
        Parameters:
        connection - Active connection
        tableReference - [[catalog.]schema.]table reference
        forceEncoding - Use this encoding instead of DBF file header encoding property.
        fileName - File path of the SHP file or URI
        deleteTables - delete existing tables
        Throws:
        IOException
        SQLException
      • importTable

        public static void importTable​(Connection connection,
                                       String fileName,
                                       org.h2.value.Value option)
                                throws IOException,
                                       SQLException
        Copy data from Shape File into a new table in specified connection.
        Parameters:
        connection - Active connection
        fileName - File path of the SHP file or URI
        option - [[catalog.]schema.]table reference
        Throws:
        IOException
        SQLException
      • importTable

        public static void importTable​(Connection connection,
                                       String fileName)
                                throws IOException,
                                       SQLException
        Copy data from Shape File into a new table in specified connection. The newly created table is given the same name as the filename without the ".shp" extension. If such a table already exists, an exception is thrown.
        Parameters:
        connection - Active connection
        fileName - File path of the SHP file or URI
        Throws:
        IOException
        SQLException