Package io.debezium.spatial
Class GeometryCoordinateSwapper
java.lang.Object
io.debezium.spatial.GeometryCoordinateSwapper
Swaps X/Y coordinates in geometry data.
- Author:
- Chris Cranford
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordVisitor implementation that writes the contents of an existing geometry byte array swapping x and y. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanneedsSwapping(int srid, int[] allowedSrids) static GeometryBytesswap(GeometryBytes geometry) Swap geometry coordinates using default spatial reference identifiers.static GeometryBytesswap(GeometryBytes geometry, int... srids) Swap geometry coordinates using default spatial reference identifiers.private static byte[]swapCoordinates(byte[] wkb) static GeometryBytesswapNoCheck(GeometryBytes geometry) Swap geometry coordinates, as long as an SRID is present.
-
Field Details
-
DEFAULT_SWAP_SRIDS
static final int[] DEFAULT_SWAP_SRIDS
-
-
Constructor Details
-
GeometryCoordinateSwapper
GeometryCoordinateSwapper()
-
-
Method Details
-
swap
Swap geometry coordinates using default spatial reference identifiers.- Parameters:
geometry- geometry, should not benull- Returns:
- a new geometry instance with coordinates swapped if SRID matched
-
swap
Swap geometry coordinates using default spatial reference identifiers.- Parameters:
geometry- geometry, should not benullsrids- list of SRIDs to filter whether to swap coordinates by- Returns:
- a new geometry instance with coordinates swapped if SRID matched
-
swapNoCheck
Swap geometry coordinates, as long as an SRID is present.- Parameters:
geometry- geometry, should not benull- 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)
-