Class Point

java.lang.Object
io.debezium.data.geometry.Geometry
io.debezium.data.geometry.Point

public class Point extends Geometry
A semantic type for a geometric Point, defined as a set of (x,y) coordinates. This historically used to be a useful class, but is now mostly obsolete due to the generic Geometry type. TODO for 1.0: Decide whether to remove it or keep it.
Author:
Horia Chiorean, Omar Al-Safi
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    private static final int
     
    private static final int
     
    static final String
     
    static final String
     

    Fields inherited from class io.debezium.data.geometry.Geometry

    SRID_FIELD, WKB_FIELD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.kafka.connect.data.SchemaBuilder
    Returns a SchemaBuilder for a Point field.
    private static byte[]
    buildWKBPoint(double x, double y)
    Creates WKB for a 2D {x,y} point.
    static org.apache.kafka.connect.data.Struct
    createValue(org.apache.kafka.connect.data.Schema geomSchema, byte[] wkb, Integer srid)
    Create a value for this schema using WKB
    static org.apache.kafka.connect.data.Struct
    createValue(org.apache.kafka.connect.data.Schema geomSchema, double x, double y)
    Creates a value for this schema using 2 given coordinates.
    static double[]
    parseWKBPoint(byte[] wkb)
    Parses a 2D WKB Point into a {x,y} coordinate array.

    Methods inherited from class io.debezium.data.geometry.Geometry

    schema

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • Point

      public Point()
  • Method Details

    • builder

      public static org.apache.kafka.connect.data.SchemaBuilder builder()
      Returns a SchemaBuilder for a Point field. A Geometry with extra X & Y fields
      Returns:
      the schema builder
    • buildWKBPoint

      private static byte[] buildWKBPoint(double x, double y)
      Creates WKB for a 2D {x,y} point.
      Parameters:
      x - coordinate
      y - coordinate
      Returns:
      OGC WKB byte array
    • parseWKBPoint

      public static double[] parseWKBPoint(byte[] wkb) throws IllegalArgumentException
      Parses a 2D WKB Point into a {x,y} coordinate array. Returns null for any non-point or points with Z/M/etc modifiers.
      Parameters:
      wkb - OGC WKB geometry
      Returns:
      x,y coordinate array
      Throws:
      IllegalArgumentException
    • createValue

      public static org.apache.kafka.connect.data.Struct createValue(org.apache.kafka.connect.data.Schema geomSchema, double x, double y)
      Creates a value for this schema using 2 given coordinates.
      Parameters:
      geomSchema - a Schema instance which represents a point; may not be null
      x - the X coordinate of the point; may not be null
      y - the Y coordinate of the point; may not be null
      Returns:
      a Struct which represents a Connect value for this schema; never null
    • createValue

      public static org.apache.kafka.connect.data.Struct createValue(org.apache.kafka.connect.data.Schema geomSchema, byte[] wkb, Integer srid) throws IllegalArgumentException
      Create a value for this schema using WKB
      Parameters:
      geomSchema - a Schema instance which represents a point; may not be null
      wkb - the original Well-Known binary representation of the coordinate; may not be null
      srid - the coordinate reference system identifier; null if unset/unknown
      Returns:
      a Struct which represents a Connect value for this schema; never null
      Throws:
      IllegalArgumentException