|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.wkb4j.engine.WKBParser | +--org.wkb4j.engine.WKBParser3D
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
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 |
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 |
protected static org.apache.log4j.Logger log
private static final int ZFLAG
Constructor Detail |
public WKBParser3D(org.wkb4j.engine.WKBFactory3D _factory)
_factory
- that will receive the events.Method Detail |
protected void decodeData(int srid)
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.
protected void readMultiLineString() throws java.io.IOException
readMultiLineString
in class WKBParser
java.io.IOException
protected void readPoints(int pointCount, int dimension) throws java.io.IOException
readPoints
in class WKBParser
pointCount
- dimension
- dimension of the points contained in this geometry.
java.io.IOException
protected void readMultiPolygon() throws java.io.IOException
java.io.IOException
protected void readMultiPoint() throws java.io.IOException
readMultiPoint
in class WKBParser
java.io.IOException
protected void readGeometryCollection() throws java.io.IOException
readGeometryCollection
in class WKBParser
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |