gistoolkit.datasources
Class WKBFactory

java.lang.Object
  extended bygistoolkit.datasources.WKBFactory

public class WKBFactory
extends java.lang.Object

Class used for parsing WKB format objects into features, and vice versa.


Constructor Summary
WKBFactory()
          Creates new WKBFactory
 
Method Summary
static Shape convert(Shape inShape, java.lang.String inType)
          Converts the type of shape sent in, to therequired shape.
static java.lang.String getSQL(java.lang.String inShapeType, int inCoordinateReference)
          Returns the base Sql for updating a particular shape type, for example.
static Shape parseShape(java.io.InputStream in)
          Takes a binary input stream from the database, and parses it into a shape.
static byte[] writeWKB(Shape inShape)
          Takes a shape and produces it's Well Known Binary (WKB) form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WKBFactory

public WKBFactory()
Creates new WKBFactory

Method Detail

parseShape

public static Shape parseShape(java.io.InputStream in)
Takes a binary input stream from the database, and parses it into a shape. Creation date: (4/17/2001 2:59:59 PM)

Parameters:
in - java.io.InputStream
Returns:
features.Shape

writeWKB

public static byte[] writeWKB(Shape inShape)
Takes a shape and produces it's Well Known Binary (WKB) form.


getSQL

public static java.lang.String getSQL(java.lang.String inShapeType,
                                      int inCoordinateReference)
                               throws java.lang.Exception
Returns the base Sql for updating a particular shape type, for example.

For a point it would be db2gse.ST_PointFromWKB(cast(? as blob(1m)), db2gse.coordref()..srid(0)))

For a MultiPoint it would be db2gse.ST_>PointFromWKB(cast(? as blob(1m)), db2gse.coordref()..srid(0)))

Throws:
java.lang.Exception

convert

public static Shape convert(Shape inShape,
                            java.lang.String inType)
                     throws java.lang.Exception
Converts the type of shape sent in, to therequired shape.

Throws:
java.lang.Exception