Class GeometryUtil

java.lang.Object
io.debezium.spatial.GeometryUtil

public class GeometryUtil extends Object
Simple geometry utility class.
Author:
Chris Cranford
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Integer
    extractSrid(byte[] ewkb)
    Reads the spatial reference identifier from a potential EWKB byte array.
    static ByteOrder
    getByteOrder(byte byteOrder)
    Given the WKB byte (0x00 or 0x01) byte order, returns the Java byte order.
    static byte
    Given a Java byte order, returns the mapped WKB type (0x00 or 0x01).
    static boolean
    hasSrid(int wkbType)
    Checks whether the Well-Known Binary type has the SRID flag encoded.
    static boolean
    isExtended(byte[] wkb)
    Check whether the WKB byte array represents a EWKB (Extended Well-Known Binary) format.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      true if the array is an EWKB, false if it is a WKB
    • extractSrid

      public static Integer extractSrid(byte[] ewkb)
      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:
      true if the SRID is encoded, false if the SRID is not encoded
    • getByteOrder

      public static ByteOrder getByteOrder(byte byteOrder)
      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

      public static byte getByteOrderByte(ByteOrder byteOrder)
      Given a Java byte order, returns the mapped WKB type (0x00 or 0x01).
      Parameters:
      byteOrder - the Java byte order
      Returns:
      the WKB byte order