Package io.debezium.spatial
Class GeometryUtil
java.lang.Object
io.debezium.spatial.GeometryUtil
Simple geometry utility class.
- Author:
- Chris Cranford
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IntegerextractSrid(byte[] ewkb) Reads the spatial reference identifier from a potential EWKB byte array.static ByteOrdergetByteOrder(byte byteOrder) Given the WKB byte (0x00 or 0x01) byte order, returns the Java byte order.static bytegetByteOrderByte(ByteOrder byteOrder) Given a Java byte order, returns the mapped WKB type (0x00 or 0x01).static booleanhasSrid(int wkbType) Checks whether the Well-Known Binary type has the SRID flag encoded.static booleanisExtended(byte[] wkb) Check whether the WKB byte array represents a EWKB (Extended Well-Known Binary) format.
-
Constructor Details
-
GeometryUtil
private GeometryUtil()
-
-
Method Details
-
isExtended
public static boolean isExtended(byte[] wkb) Check whether the WKB byte array represents a EWKB (Extended Well-Known Binary) format.- Parameters:
wkb- the byte array- Returns:
trueif the array is an EWKB,falseif it is a WKB
-
extractSrid
Reads the spatial reference identifier from a potential EWKB byte array.- Parameters:
ewkb- the byte array- Returns:
- the SRID if the byte array is an EWKB and has an encoded SRID, otherwise
null
-
hasSrid
public static boolean hasSrid(int wkbType) Checks whether the Well-Known Binary type has the SRID flag encoded.- Parameters:
wkbType- the WKB type- Returns:
trueif the SRID is encoded,falseif the SRID is not encoded
-
getByteOrder
Given the WKB byte (0x00 or 0x01) byte order, returns the Java byte order.- Parameters:
byteOrder- the WKB byte order byte- Returns:
- the Java byte order
-
getByteOrderByte
Given a Java byte order, returns the mapped WKB type (0x00 or 0x01).- Parameters:
byteOrder- the Java byte order- Returns:
- the WKB byte order
-