| java.lang.Object com.vividsolutions.jts.io.oracle.OraWriter
OraWriter | public class OraWriter (Code) | | Translates a JTS Geometry into an Oracle STRUCT representing an MDSYS.GEOMETRY object.
A connection to an oracle instance with access to the definition of the MDSYS.GEOMETRY
object is required by the oracle driver.
version: 9i author: David Zwiers, Vivid Solutions. |
Constructor Summary | |
public | OraWriter(OracleConnection con) Initialize the Oracle MDSYS.GEOMETRY Encoder with a valid oracle connection. | public | OraWriter(OracleConnection con, int dimension) Initialize the Oracle MDSYS.GEOMETRY Encoder with a valid oracle connection. |
Method Summary | |
public void | setDimension(int dimension) | public void | setSRID(int srid) Provides the oppotunity to force all geometries written using this writter to be written using the
specified srid. | public STRUCT | write(Geometry geom) This routine will translate the JTS Geometry into an Oracle MDSYS.GEOMETRY STRUCT.
Although invalid geometries may be encoded, and inserted into an Oracle DB, this is
not recomended. |
OraWriter | public OraWriter(OracleConnection con)(Code) | | Initialize the Oracle MDSYS.GEOMETRY Encoder with a valid oracle connection.
The connection should have sufficient priveledges to view the description of the MDSYS.GEOMETRY type.
The dimension is set to 2
Parameters: con - |
OraWriter | public OraWriter(OracleConnection con, int dimension)(Code) | | Initialize the Oracle MDSYS.GEOMETRY Encoder with a valid oracle connection.
The connection should have sufficient priveledges to view the description of the MDSYS.GEOMETRY type.
Parameters: con - Parameters: dimension - |
setDimension | public void setDimension(int dimension)(Code) | | Parameters: dimension - The dimension to set. |
setSRID | public void setSRID(int srid)(Code) | | Provides the oppotunity to force all geometries written using this writter to be written using the
specified srid. This is useful in two cases: 1) when you do not want the geometry's srid to be
over-written or 2) when you want to ensure an entire layer is always written using a constant srid.
Parameters: srid - |
write | public STRUCT write(Geometry geom) throws SQLException(Code) | | This routine will translate the JTS Geometry into an Oracle MDSYS.GEOMETRY STRUCT.
Although invalid geometries may be encoded, and inserted into an Oracle DB, this is
not recomended. It is the responsibility of the user to ensure the geometry is valid
prior to calling this method. The user should also ensure the the geometry's SRID
field contains the correct value, if an SRID is desired. An incorrect SRID value may
cause index exceptions during an insert or update.
When a null Geometry is passed in, a non-null, empty STRUCT is returned. Therefore,
inserting the the result of calling this method directly into a table will never result
in null insertions.
(March 2006)
To pass a NULL Geometry into an oracle geometry parameter using jdbc, use
java.sql.CallableStatement.setNull(index,java.sql.Types.STRUCT,"MDSYS.SDO_GEOMETRY")
(April 2006)
Parameters: geom - JTS Geometry to encode Oracle MDSYS.GEOMETRY STRUCT throws: SQLException - |
|
|