Package io.debezium.connector.mysql
Class MySqlGeometry
- java.lang.Object
-
- io.debezium.connector.mysql.MySqlGeometry
-
public class MySqlGeometry extends Object
A parser API for MySQL Geometry types- Author:
- Omar Al-Safi, Robert Coup
-
-
Field Summary
Fields Modifier and Type Field Description private Integer
srid
Coordinate reference system identifier.private byte[]
wkb
Open Geospatial Consortium Well-Known-Binary representation of the Geometry.private static byte[]
WKB_EMPTY_GEOMETRYCOLLECTION
private static int
WKB_POINT_SIZE
-
Constructor Summary
Constructors Modifier Constructor Description private
MySqlGeometry(byte[] wkb, Integer srid)
Create a MySqlGeometry using the supplied wkb, note this should be the cleaned wkb for MySQL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MySqlGeometry
createEmpty()
Create a GEOMETRYCOLLECTION EMPTY MySqlGeometrystatic MySqlGeometry
fromBytes(byte[] mysqlBytes)
Create a MySqlGeometry from the original byte array from MySQL binlog eventInteger
getSrid()
Returns the coordinate reference system identifier (SRID)byte[]
getWkb()
Returns the standard well-known binary representation of the MySQL byteboolean
isPoint()
Returns whether this geometry is a 2D POINT type.
-
-
-
Field Detail
-
WKB_POINT_SIZE
private static final int WKB_POINT_SIZE
- See Also:
- Constant Field Values
-
WKB_EMPTY_GEOMETRYCOLLECTION
private static final byte[] WKB_EMPTY_GEOMETRYCOLLECTION
-
wkb
private final byte[] wkb
Open Geospatial Consortium Well-Known-Binary representation of the Geometry. http://www.opengeospatial.org/standards/sfa
-
srid
private final Integer srid
Coordinate reference system identifier. While it's technically user-defined, the standard/common values in use are the EPSG code list http://www.epsg.org/ null if unset/unknown
-
-
Constructor Detail
-
MySqlGeometry
private MySqlGeometry(byte[] wkb, Integer srid)
Create a MySqlGeometry using the supplied wkb, note this should be the cleaned wkb for MySQL- Parameters:
wkb
- the Well-Known binary representation of the coordinate in the standard format
-
-
Method Detail
-
fromBytes
public static MySqlGeometry fromBytes(byte[] mysqlBytes)
Create a MySqlGeometry from the original byte array from MySQL binlog event- Parameters:
mysqlBytes
- he original byte array from MySQL binlog event- Returns:
- a
MySqlGeometry
which represents a MySqlGeometry API
-
getWkb
public byte[] getWkb()
Returns the standard well-known binary representation of the MySQL byte- Returns:
byte
which represents the standard well-known binary
-
getSrid
public Integer getSrid()
Returns the coordinate reference system identifier (SRID)- Returns:
- srid
-
isPoint
public boolean isPoint()
Returns whether this geometry is a 2D POINT type.- Returns:
- true if the geometry is a 2D Point.
-
createEmpty
public static MySqlGeometry createEmpty()
Create a GEOMETRYCOLLECTION EMPTY MySqlGeometry- Returns:
- a
MySqlGeometry
which represents a MySqlGeometry API
-
-