org.geotools.data.db2
Class DB2WKBWriter

java.lang.Object
  extended by org.geotools.data.db2.DB2WKBWriter

public class DB2WKBWriter
extends java.lang.Object

Author:
Christian Mueller Version of JTS WKB Writer adjusted for DB2
See Also:
for JTS Java Doc

Constructor Summary
DB2WKBWriter(boolean hasOGCWkbZTyps)
          Creates a writer that writes Geometrys with output dimension = 2 and BIG_ENDIAN byte order
DB2WKBWriter(int outputDimension, boolean hasOGCWkbZTyps)
          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, boolean hasOGCWkbZTyps)
          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 java.lang.String bytesToHex(byte[] bytes)
           
static int guessCoorinateDims(com.vividsolutions.jts.geom.Geometry g)
          returns the coordinate dimension for a geometry
 byte[] write(com.vividsolutions.jts.geom.Geometry geom)
          Writes a Geometry into a byte array.
 void write(com.vividsolutions.jts.geom.Geometry geom, com.vividsolutions.jts.io.OutStream os)
          Writes a Geometry to an OutStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2WKBWriter

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


DB2WKBWriter

public DB2WKBWriter(int outputDimension,
                    boolean hasOGCWkbZTyps)
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,
                    boolean hasOGCWkbZTyps)
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(com.vividsolutions.jts.geom.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 java.lang.String bytesToHex(byte[] bytes)

write

public byte[] write(com.vividsolutions.jts.geom.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(com.vividsolutions.jts.geom.Geometry geom,
                  com.vividsolutions.jts.io.OutStream os)
           throws java.io.IOException
Writes a Geometry to an OutStream.

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


Copyright © 1996-2010 Geotools. All Rights Reserved.