org.h2gis.drivers.shp
Class SHPRead

java.lang.Object
  extended by org.h2gis.h2spatialapi.AbstractFunction
      extended by org.h2gis.drivers.shp.SHPRead
All Implemented Interfaces:
Function, ScalarFunction

public class SHPRead
extends AbstractFunction
implements ScalarFunction

SQL Function to copy Shape File data into a Table.

Author:
Nicolas Fortin

Field Summary
 
Fields inherited from interface org.h2gis.h2spatialapi.ScalarFunction
PROP_DETERMINISTIC, PROP_NOBUFFER
 
Fields inherited from interface org.h2gis.h2spatialapi.Function
PROP_NAME, PROP_REMARKS
 
Constructor Summary
SHPRead()
           
 
Method Summary
 String getJavaStaticMethod()
           
static void readShape(Connection connection, String fileName)
          Copy data from Shape File into a new table in specified connection.
static void readShape(Connection connection, String fileName, String tableReference)
          Copy data from Shape File into a new table in specified connection.
static void readShape(Connection connection, String fileName, String tableReference, String forceEncoding)
          Copy data from Shape File into a new table in specified connection.
 
Methods inherited from class org.h2gis.h2spatialapi.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.h2spatialapi.Function
getProperty
 

Constructor Detail

SHPRead

public SHPRead()
Method Detail

getJavaStaticMethod

public String getJavaStaticMethod()
Specified by:
getJavaStaticMethod in interface ScalarFunction

readShape

public static void readShape(Connection connection,
                             String fileName,
                             String tableReference,
                             String forceEncoding)
                      throws IOException,
                             SQLException
Copy data from Shape File into a new table in specified connection.

Parameters:
connection - Active connection
tableReference - [[catalog.]schema.]table reference
fileName - File path of the SHP file or URI
forceEncoding - Use this encoding instead of DBF file header encoding property.
Throws:
IOException
SQLException

readShape

public static void readShape(Connection connection,
                             String fileName,
                             String tableReference)
                      throws IOException,
                             SQLException
Copy data from Shape File into a new table in specified connection.

Parameters:
connection - Active connection
tableReference - [[catalog.]schema.]table reference
fileName - File path of the SHP file or URI
Throws:
IOException
SQLException

readShape

public static void readShape(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


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.