This class provides limited support of EWKB. EWKB is based on Well-known Binary Representation (WKB) from OGC 06-103r4 and includes additional PostGIS extensions. This class can read dimension system marks in both OGC WKB and EWKB formats, but always writes them in EWKB format. SRID support from EWKB is implemented. As an addition POINT EMPTY is stored with NaN values as specified in OGC 12-128r15.
| Modifier and Type | Class and Description |
|---|---|
| private static class | EWKBUtils.
Helper source object for EWKB reading. |
| public static class | EWKBUtils.
Converter output target that writes a EWKB. |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | EWKB_M
Geometry type mask that indicates presence of dimension M. |
| public static final int | EWKB_SRID
Geometry type mask that indicates presence of SRID. |
| public static final int | EWKB_Z
Geometry type mask that indicates presence of dimension Z. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | addCoordinate(EWKBUtils.
|
| private static void | addRing(EWKBUtils.
|
| public static byte[] | |
| public static byte[] | Returns: canonical EWKB, may be the same as the sourcesource EWKB ewkb)Converts any supported EWKB to EWKB representation that is used by this class. |
| public static byte[] | Returns: canonical EWKB, may be the same as the sourcesource EWKB ewkb, int dimension system dimensionSystem)Converts any supported EWKB to EWKB representation that is used by this class. |
| public static int | Returns: the dimension systemEWKB ewkb)Reads the dimension system from EWKB. |
| public static void | |
| private static void | parseEWKB(EWKBUtils.
EWKB source source,output target target,type of parent geometry collection, or 0 for the root geometry parentType)Parses a EWKB. |
| public static int | Returns: dimension systemgeometry type with flags type)Converts geometry type with flags to a dimension system. |
| EWKB_M | back to summary |
|---|---|
| public static final int EWKB_M Geometry type mask that indicates presence of dimension M. | |
| EWKB_SRID | back to summary |
|---|---|
| public static final int EWKB_SRID Geometry type mask that indicates presence of SRID. | |
| EWKB_Z | back to summary |
|---|---|
| public static final int EWKB_Z Geometry type mask that indicates presence of dimension Z. | |
| EWKBUtils | back to summary |
|---|---|
| private EWKBUtils() | |
| addCoordinate | back to summary |
|---|---|
| private static void addCoordinate(EWKBUtils. | |
| addRing | back to summary |
|---|---|
| private static void addRing(EWKBUtils. | |
| envelope2wkb | back to summary |
|---|---|
| public static byte[] envelope2wkb(double[] envelope) Converts an envelope to a WKB.
| |
| ewkb2ewkb | back to summary |
|---|---|
| public static byte[] ewkb2ewkb(byte[] ewkb) Converts any supported EWKB to EWKB representation that is used by this class. Reduces dimension system to minimal possible and uses EWKB flags for dimension system indication. May also perform other changes.
| |
| ewkb2ewkb | back to summary |
|---|---|
| public static byte[] ewkb2ewkb(byte[] ewkb, int dimensionSystem) Converts any supported EWKB to EWKB representation that is used by this class. Reduces dimension system to minimal possible and uses EWKB flags for dimension system indication. May also perform other changes.
| |
| getDimensionSystem | back to summary |
|---|---|
| public static int getDimensionSystem(byte[] ewkb) Reads the dimension system from EWKB.
| |
| parseEWKB | back to summary |
|---|---|
| public static void parseEWKB(byte[] ewkb, GeometryUtils. Parses a EWKB.
| |
| parseEWKB | back to summary |
|---|---|
| private static void parseEWKB(EWKBUtils. Parses a EWKB.
| |
| type2dimensionSystem | back to summary |
|---|---|
| public static int type2dimensionSystem(int type) Converts geometry type with flags to a dimension system.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv boolean | bigEndian
Whether current byte order is big-endian. |
| private final byte[] | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv byte | |
| pack-priv double | Returns: next 64-bit floating pointReads a 64-bit floating point using current byte order. |
| pack-priv int | |
| public String |
| bigEndian | back to summary |
|---|---|
| pack-priv boolean bigEndian Whether current byte order is big-endian. | |
| ewkb | back to summary |
|---|---|
| private final byte[] ewkb | |
| offset | back to summary |
|---|---|
| private int offset | |
| EWKBSource | back to summary |
|---|---|
| pack-priv EWKBSource(byte[] ewkb) Creates new instance of EWKB source.
| |
| readByte | back to summary |
|---|---|
| pack-priv byte readByte() Reads one byte.
| |
| readCoordinate | back to summary |
|---|---|
| pack-priv double readCoordinate() Reads a 64-bit floating point using current byte order.
| |
| readInt | back to summary |
|---|---|
| pack-priv int readInt() Reads a 32-bit integer using current byte order.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final int | |
| private final ByteArrayOutputStream | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | EWKBTarget(ByteArrayOutputStream
output stream output, int dimension system to use dimensionSystem)Creates a new EWKB output target. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addCoordinate(double
X coordinate x, double Y coordinate y, double Z coordinate (NaN if not used) z, double M coordinate (NaN if not used) m, int 0-based index of coordinate in the current sequence index, int total number of coordinates in the current sequence total)Implements abstract org. Invoked to add a coordinate to a geometry. |
| protected void | init(int
SRID srid)Overrides org. Initializes top-level target. |
| protected void | startCollection(int
type of collection, one of
type, int GeometryUtils#MULTI_POINT,
GeometryUtils#MULTI_LINE_STRING,
GeometryUtils#MULTI_POLYGON,
GeometryUtils#GEOMETRY_COLLECTIONnumber of items in this collection numItems)Overrides org. Invoked before writing of a collection. |
| protected GeometryUtils. | startCollectionItem(int
0-based index of this item in the collection index, int total number of items in the collection total)Overrides org. Invoked before writing of a collection item. |
| protected void | startLineString(int
number of points in line string numPoints)Overrides org. Invoked before writing a LINESTRING. |
| protected void | startPoint()
Overrides org. Invoked before writing a POINT. |
| protected void | startPolygon(int
number of inner polygons numInner, int number of points in outer polygon numPoints)Overrides org. Invoked before writing a POLYGON. |
| protected void | startPolygonInner(int
number of points in inner polygon numInner)Overrides org. Invoked before writing an inner polygon in POLYGON. |
| private void | |
| private void | |
| private void |
| buf | back to summary |
|---|---|
| private final byte[] buf | |
| dimensionSystem | back to summary |
|---|---|
| private final int dimensionSystem | |
| output | back to summary |
|---|---|
| private final ByteArrayOutputStream output | |
| srid | back to summary |
|---|---|
| private int srid | |
| type | back to summary |
|---|---|
| private int type | |
| EWKBTarget | back to summary |
|---|---|
| public EWKBTarget(ByteArrayOutputStream output, int dimensionSystem) Creates a new EWKB output target.
| |
| addCoordinate | back to summary |
|---|---|
| protected void addCoordinate(double x, double y, double z, double m, int index, int total) Implements abstract org. Doc from org. Invoked to add a coordinate to a geometry.
| |
| init | back to summary |
|---|---|
| protected void init(int srid) Overrides org. Doc from org. Initializes top-level target.
| |
| startCollection | back to summary |
|---|---|
| protected void startCollection(int type, int numItems) Overrides org. Doc from org. Invoked before writing of a collection.
| |
| startCollectionItem | back to summary |
|---|---|
| protected GeometryUtils. Overrides org. Doc from org. Invoked before writing of a collection item.
| |
| startLineString | back to summary |
|---|---|
| protected void startLineString(int numPoints) Overrides org. Doc from org. Invoked before writing a LINESTRING.
| |
| startPoint | back to summary |
|---|---|
| protected void startPoint() Overrides org. Doc from org. Invoked before writing a POINT.
| |
| startPolygon | back to summary |
|---|---|
| protected void startPolygon(int numInner, int numPoints) Overrides org. Doc from org. Invoked before writing a POLYGON. If polygon is empty, both parameters are 0.
| |
| startPolygonInner | back to summary |
|---|---|
| protected void startPolygonInner(int numInner) Overrides org. Doc from org. Invoked before writing an inner polygon in POLYGON.
| |
| writeDouble | back to summary |
|---|---|
| private void writeDouble(double v) | |
| writeHeader | back to summary |
|---|---|
| private void writeHeader(int type) | |
| writeInt | back to summary |
|---|---|
| private void writeInt(int v) | |