Class GeometryCoordinateSwapper

java.lang.Object
io.debezium.spatial.GeometryCoordinateSwapper

class GeometryCoordinateSwapper extends Object
Swaps X/Y coordinates in geometry data.
Author:
Chris Cranford
  • Field Details

    • DEFAULT_SWAP_SRIDS

      static final int[] DEFAULT_SWAP_SRIDS
  • Constructor Details

    • GeometryCoordinateSwapper

      GeometryCoordinateSwapper()
  • Method Details

    • swap

      public static GeometryBytes swap(GeometryBytes geometry)
      Swap geometry coordinates using default spatial reference identifiers.
      Parameters:
      geometry - geometry, should not be null
      Returns:
      a new geometry instance with coordinates swapped if SRID matched
    • swap

      public static GeometryBytes swap(GeometryBytes geometry, int... srids)
      Swap geometry coordinates using default spatial reference identifiers.
      Parameters:
      geometry - geometry, should not be null
      srids - list of SRIDs to filter whether to swap coordinates by
      Returns:
      a new geometry instance with coordinates swapped if SRID matched
    • swapNoCheck

      public static GeometryBytes swapNoCheck(GeometryBytes geometry)
      Swap geometry coordinates, as long as an SRID is present.
      Parameters:
      geometry - geometry, should not be null
      Returns:
      a new geometry instance with coordinates swapped or existing geometry if no SRID is set
    • needsSwapping

      private static boolean needsSwapping(int srid, int[] allowedSrids)
    • swapCoordinates

      private static byte[] swapCoordinates(byte[] wkb)