org.geotools.data.db2
Class DB2WKBWriter

Object
  extended by DB2WKBWriter

public class DB2WKBWriter
extends Object

Author:
Christian Mueller Version of JTS WKB Writer adjusted for DB2
See Also:
for JTS Java Doc
Module:
modules/plugin/jdbc-db2 (gt-jdbc-db2.jar)

Constructor Summary
DB2WKBWriter()
          Creates a writer that writes Geometrys with output dimension = 2 and BIG_ENDIAN byte order
DB2WKBWriter(int outputDimension)
          Creates a writer that writes Geometrys with the given dimension (2 or 3) for output coordinates and BIG_ENDIAN byte order.
DB2WKBWriter(int outputDimension, int byteOrder)
          Creates a writer that writes Geometrys with the given dimension (2 or 3) for output coordinates and byte order If the input geometry has a small coordinate dimension, coordinates will be padded with NULL_ORDINATE.
 
Method Summary
static String bytesToHex(byte[] bytes)
           
static int guessCoorinateDims(Geometry g)
          returns the coordinate dimension for a geometry
 byte[] write(Geometry geom)
          Writes a Geometry into a byte array.
 void write(Geometry geom, OutStream os)
          Writes a Geometry to an OutStream.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2WKBWriter

public DB2WKBWriter()
Creates a writer that writes Geometrys with output dimension = 2 and BIG_ENDIAN byte order


DB2WKBWriter

public DB2WKBWriter(int outputDimension)
Creates a writer that writes Geometrys with the given dimension (2 or 3) for output coordinates and BIG_ENDIAN byte order. If the input geometry has a small coordinate dimension, coordinates will be padded with NULL_ORDINATE.

Parameters:
outputDimension - the coordinate dimension to output (2 or 3)

DB2WKBWriter

public DB2WKBWriter(int outputDimension,
                    int byteOrder)
Creates a writer that writes Geometrys with the given dimension (2 or 3) for output coordinates and byte order If the input geometry has a small coordinate dimension, coordinates will be padded with NULL_ORDINATE.

Parameters:
outputDimension - the coordinate dimension to output (2 or 3)
byteOrder - the byte ordering to use
Method Detail

guessCoorinateDims

public static final int guessCoorinateDims(Geometry g)
returns the coordinate dimension for a geometry

Parameters:
Geometry - g
Returns:
if there is one z value != NaN, then 3 else 2

bytesToHex

public static String bytesToHex(byte[] bytes)

write

public byte[] write(Geometry geom)
Writes a Geometry into a byte array.

Parameters:
geom - the geometry to write
Returns:
the byte array containing the WKB

write

public void write(Geometry geom,
                  OutStream os)
           throws IOException
Writes a Geometry to an OutStream.

Parameters:
geom - the geometry to write
os - the out stream to write to
Throws:
IOException - if an I/O error occurs


Copyright © 1996-2009 Geotools. All Rights Reserved.