Class SHPWrite

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

    public class SHPWrite
    extends org.h2gis.api.AbstractFunction
    implements org.h2gis.api.ScalarFunction
    SQL Function to read a table and write it into a shape file.
    Author:
    Nicolas Fortin, Erwan Bocher, CNRS
    • Constructor Detail

      • SHPWrite

        public SHPWrite()
    • Method Detail

      • getJavaStaticMethod

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

        public static void exportTable​(Connection connection,
                                       String fileName,
                                       String tableReference,
                                       org.h2.value.Value option)
                                throws IOException,
                                       SQLException
        Read a table and write it into a shape file.
        Parameters:
        connection - Active connection
        fileName - Shape file name or URI
        tableReference - Table name or select query Note : The select query must be enclosed in parenthesis
        option - Could be string file encoding charset or boolean value to delete the existing file
        Throws:
        IOException
        SQLException
      • exportTable

        public static void exportTable​(Connection connection,
                                       String fileName,
                                       String tableReference,
                                       String encoding,
                                       boolean deleteFiles)
                                throws IOException,
                                       SQLException
        Read a table and write it into a shape file.
        Parameters:
        connection - Active connection
        fileName - Shape file name or URI
        tableReference - Table name or select query Note : The select query must be enclosed in parenthesis
        encoding - charset encoding
        deleteFiles - true to delete output file
        Throws:
        IOException
        SQLException