org.wkb4j.engine
Class WKBParser3D

java.lang.Object
  |
  +--org.wkb4j.engine.WKBParser
        |
        +--org.wkb4j.engine.WKBParser3D
All Implemented Interfaces:
WKBGeometryTypes

public class WKBParser3D
extends WKBParser

Generate events from the submitted array of bytes holding binary data in the Well-Known Binary format. It generates a beginGeometry event when it sees the beginning of a given Geometry, an endGeometry event when it sees the end of a given Geometry, and an abortGeometry event if something happens that makes the completion of the current Geometry impossible.
Points are treated differently from other Geometries: all the points in a Geometry are collected into a single array of byte and passed to the WKBFactory all at once. Events are nested, meaning that for a classical MultiLineString element with two LineStrings made of respectively 3 and 2 Points each, the following events will occur:


The basic idea is to provide the author of each factory with as much freedom as possible while allowing for strong performance. wkbByteOrder aren't taken into account because will rely on the database to provide the data in the Big-Endian format (MSB, Most Significant Byte), the Endian used in Java.
Unlike the WKBParser, the WKBParser3D can handle 3D points as specified in:
Inspired by the SAX API.
Creation date: 6 juil. 2002 23:49:28

Version:
$Revision: 1.3 $ $Date: 2003/06/14 22:31:26 $
Author:
David Garnier

Field Summary
protected static org.apache.log4j.Logger log
           
private static int ZFLAG
           
 
Fields inherited from class org.wkb4j.engine.WKBParser
DIMENSION2, DIMENSION3, endianess, factory, inputStream, internalBuffer, words
 
Fields inherited from interface org.wkb4j.engine.WKBGeometryTypes
linearRing, wkbGeometryCollection, wkbLineString, wkbMultiLineString, wkbMultiPoint, wkbMultiPolygon, wkbPoint, wkbPolygon
 
Constructor Summary
WKBParser3D(org.wkb4j.engine.WKBFactory3D _factory)
          Constructor for WKBParser.
 
Method Summary
protected  void decodeData(int srid)
          Read the raw WKB data from the DataInputStream and generate the beginUnit/endUnit calls and the calls to the top-level geometries (MultiLineString, LineString, Polygon, MultiPolygon, GeometryCollection, Point)
All the readGeometry method can throw IOException if something goes wrong.
protected  void readGeometryCollection()
          Reads a GeometryCollection.
protected  void readMultiLineString()
          Reads a MultiLineString.
protected  void readMultiPoint()
          Reads a MultiPoint.
protected  void readMultiPolygon()
          Reads a MultiPolygon.
protected  void readPoints(int pointCount, int dimension)
          Reads a number of Points.
 
Methods inherited from class org.wkb4j.engine.WKBParser
decodeData, parseData, parseData, parseData, parseInt, parseType, readLinearRing, readLineString, readMultiPolygon, readPoint, readPolygon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log

ZFLAG

private static final int ZFLAG
See Also:
Constant Field Values
Constructor Detail

WKBParser3D

public WKBParser3D(org.wkb4j.engine.WKBFactory3D _factory)
Constructor for WKBParser.

Parameters:
_factory - that will receive the events.
Method Detail

decodeData

protected void decodeData(int srid)
Read the raw WKB data from the DataInputStream and generate the beginUnit/endUnit calls and the calls to the top-level geometries (MultiLineString, LineString, Polygon, MultiPolygon, GeometryCollection, Point)
All the readGeometry method can throw IOException if something goes wrong.

Parameters:
srid - defines the SRID applied to all the geometries contained in the current record.

readMultiLineString

protected void readMultiLineString()
                            throws java.io.IOException
Reads a MultiLineString.

Overrides:
readMultiLineString in class WKBParser
Throws:
java.io.IOException

readPoints

protected void readPoints(int pointCount,
                          int dimension)
                   throws java.io.IOException
Reads a number of Points.

Overrides:
readPoints in class WKBParser
Parameters:
pointCount -
dimension - dimension of the points contained in this geometry.
Throws:
java.io.IOException

readMultiPolygon

protected void readMultiPolygon()
                         throws java.io.IOException
Reads a MultiPolygon.

Throws:
java.io.IOException

readMultiPoint

protected void readMultiPoint()
                       throws java.io.IOException
Reads a MultiPoint.

Overrides:
readMultiPoint in class WKBParser
Throws:
java.io.IOException

readGeometryCollection

protected void readGeometryCollection()
                               throws java.io.IOException
Reads a GeometryCollection.

Overrides:
readGeometryCollection in class WKBParser
Throws:
java.io.IOException


Copyright © 2002-2003 David Garnier. All Rights Reserved.