Skip navigation links

Oracle® Spatial Java API Reference
11g Release 1 (11.1)
B28401-01


oracle.spatial.util
Class WKBasis

java.lang.Object
  extended by oracle.spatial.util.WKBasis

All Implemented Interfaces:
WKAdapter
Direct Known Subclasses:
WKB, WKT

public abstract class WKBasis
extends java.lang.Object
implements WKAdapter

This class provides some implementations common to WKB and WKT, particularly the translation between WKB/WKT and STRUCT. This translation is based on the translation between WKB/WKT and JGeometry (which is specific to the WKB and WKT subclasses of this class).


Constructor Summary
WKBasis()
           
WKBasis(ByteOrder defaultByteOrder)
           

 

Method Summary
 byte[] fromJGeometry(JGeometry geom)
          This transforms a JGeometry to a WKB/WKT geometry.
 byte[] fromSTRUCT(STRUCT geom)
          Creates a WKB/WKT geometry from a STRUCT object.
 JGeometry toJGeometry(byte[] wkb)
          This transforms a WKB/WKT geometry to a JGeometry.
 STRUCT toSTRUCT(byte[] wkContent, java.sql.Connection conn)
          Convert the given WKB/WKT geometry into an Oracle JDBC STRUCT object.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

WKBasis

public WKBasis(ByteOrder defaultByteOrder)

WKBasis

public WKBasis()

Method Detail

fromJGeometry

public byte[] fromJGeometry(JGeometry geom)
                     throws GeometryExceptionWithContext
Description copied from interface: WKAdapter
This transforms a JGeometry to a WKB/WKT geometry.
Specified by:
fromJGeometry in interface WKAdapter
Parameters:
geom - a JGeometry representing the Oracle Spatial geometry
Returns:
a byte[] representing the WKB/WKT geometry
Throws:
GeometryExceptionWithContext

toSTRUCT

public final STRUCT toSTRUCT(byte[] wkContent,
                             java.sql.Connection conn)
                      throws java.sql.SQLException,
                             GeometryExceptionWithContext
Convert the given WKB/WKT geometry into an Oracle JDBC STRUCT object. You can then bind the STRUCT object to a SQL DML statment. This function is final, for it calls the function toJGeometry, which is not final. Any code specific to WKB/WKT should be in toJGeometry.
Specified by:
toSTRUCT in interface WKAdapter
Parameters:
wkContent - the WKB/WKT geometry (byte array) to be converted
conn - the connection to be used
Returns:
an Oracle STRUCT object when successful; otherwise null
Throws:
java.sql.SQLException
GeometryExceptionWithContext

fromSTRUCT

public final byte[] fromSTRUCT(STRUCT geom)
                        throws java.sql.SQLException,
                               GeometryExceptionWithContext
Creates a WKB/WKT geometry from a STRUCT object. This function is final, for it calls the function fromJGeometry, which is not final. Any code specific to WKB/WKT should be in fromJGeometry.
Specified by:
fromSTRUCT in interface WKAdapter
Parameters:
geom - the STRUCT object from an oracle result set
Returns:
a WKB/WKT geometry (byte array) if successful; otherwise null
Throws:
java.sql.SQLException
GeometryExceptionWithContext

toJGeometry

public JGeometry toJGeometry(byte[] wkb)
                      throws GeometryExceptionWithContext
Description copied from interface: WKAdapter
This transforms a WKB/WKT geometry to a JGeometry.
Specified by:
toJGeometry in interface WKAdapter
Parameters:
wkb - a byte[] representing the WKB/WKT geometry
Returns:
a JGeometry representing the Oracle Spatial geometry
Throws:
GeometryExceptionWithContext

Skip navigation links

Oracle® Spatial Java API Reference
11g Release 1 (11.1)
B28401-01


Copyright © 2007, Oracle. All Rights Reserved.