Class BinlogGeometry

java.lang.Object
io.debezium.connector.binlog.BinlogGeometry

public class BinlogGeometry extends Object
A simple parser API for binlog-based connector geometry data types.
Author:
Omar Al-Safi, Robert Coup, Chris Cranford
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Integer
    Coordinate reference system identifier.
    private final byte[]
    Open Geospatial Consortium Well-Known-Binary representation of the Geometry.
    private static final byte[]
     
    private static final int
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    BinlogGeometry(byte[] wkb, Integer srid)
    Create a BinlogGeometry using the supplied wkb, note this should be the cleaned wkb
  • Method Summary

    Modifier and Type
    Method
    Description
    Create a GEOMETRYCOLLECTION EMPTY BinlogGeometry
    fromBytes(byte[] mysqlBytes)
    Create a BinlogGeometry from the original byte array from binlog event
    Returns the coordinate reference system identifier (SRID)
    byte[]
    Returns the standard well-known binary representation.
    boolean
    Returns whether this geometry is a 2D POINT type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • WKB_POINT_SIZE

      private static final int WKB_POINT_SIZE
      See Also:
    • 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 Details

    • BinlogGeometry

      private BinlogGeometry(byte[] wkb, Integer srid)
      Create a BinlogGeometry using the supplied wkb, note this should be the cleaned wkb
      Parameters:
      wkb - the Well-Known binary representation of the coordinate in the standard format
  • Method Details

    • fromBytes

      public static BinlogGeometry fromBytes(byte[] mysqlBytes)
      Create a BinlogGeometry from the original byte array from binlog event
      Parameters:
      mysqlBytes - he original byte array from binlog event
      Returns:
      a BinlogGeometry which represents a BinlogGeometry API
    • getWkb

      public byte[] getWkb()
      Returns the standard well-known binary representation.
      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 BinlogGeometry createEmpty()
      Create a GEOMETRYCOLLECTION EMPTY BinlogGeometry
      Returns:
      a BinlogGeometry which represents a BinlogGeometry API