org.gvsig.fmap.geom.operation.fromwkb
Class WKBParser2

java.lang.Object
  extended by org.gvsig.fmap.geom.operation.fromwkb.WKBParser2

public class WKBParser2
extends Object

Parse binary representation of geometries. Currently, only text rep (hexed) implementation is tested. It should be easy to add char[] and CharSequence ByteGetter instances, although the latter one is not compatible with older jdks. I did not implement real unsigned 32-bit integers or emulate them with long, as both java Arrays and Strings currently can have only 2^31-1 elements (bytes), so we cannot even get or build Geometries with more than approx. 2^28 coordinates (8 bytes each).

Author:
markus.schaber@logi-track.com

Constructor Summary
WKBParser2()
           
 
Method Summary
 Geometry parse(byte[] value)
          Parse a binary encoded geometry.
protected  Geometry parseGeometry(ByteBuffer data)
          Parse a geometry starting at offset.
protected  void parseTypeAndSRID(ByteBuffer data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WKBParser2

public WKBParser2()
Throws:
GeometryTypeNotValidException
GeometryTypeNotSupportedException
Method Detail

parse

public Geometry parse(byte[] value)
               throws CreateGeometryException
Parse a binary encoded geometry. Is synchronized to protect offset counter. (Unfortunately, Java does not have neither call by reference nor multiple return values.)

Throws:
CreateGeometryException

parseTypeAndSRID

protected void parseTypeAndSRID(ByteBuffer data)

parseGeometry

protected Geometry parseGeometry(ByteBuffer data)
                          throws CreateGeometryException
Parse a geometry starting at offset.

Throws:
CreateGeometryException


Copyright © 2004-2012 gvSIG. All Rights Reserved.