You are viewing documentation for an unreleased version of Debezium.
If you want to view the latest stable version of this page, please go here.

SwapGeometryCoordinates

Table of Contents

In environments where you must send data from a source database that uses one coordinate system to a target that uses a different system, you can use the SwapGeometryCoordinates SMT to reformat the data. When serializing geometry information into a well-known binary (WKB) or extended well-known binary (EWKB) byte array, the source database uses one of the following coordinate systems:

Legacy CRS:84

An older convention that serializes coordinates by using (x, y) or (longitude, latitude) axis order.

European Petroleum Survey Group (EPSG)

A modern convention that serializes coordinates by using (y, x) or (latitude, longitude) axis order.

The serialization format is irrelevant in a Debezium source connector, because the connector always uses the coordinate system of the source database when it writes data to a change event. However, a sink connector must not only be able to interpret the coordinate system of the source database, but also provide data to the target system in a format that it can consume.

Example

To convert the coordinate system of the data that a Debezium connector captures from a source database to a different coordinate system, add the SwapGeometryCoordinates SMT to the connector configuration. You can configure the transformation so that it converts the default set of spatial reference identifiers, or you can customize the configuration so that the transform applies only to specific identifiers. Other fields are left unchanged. For example, to configure the connector to convert the default set of spatial reference identifiers, add the following lines to the connector configuration:

transforms=swap
transforms.swap.type=io.debezium.transforms.SwapGeometryCoordinates

To apply the transformation only to spatial reference identifier 4326, add the following lines to your connector configuration:

transforms=swap
transforms.swap.type=io.debezium.transforms.SwapGeometryCoordinates
transforms.swap.srids=4326

Configuration options

The following table lists the configuration options that you can use with the SwapGeometryCoordinates SMT.

Table 1. SwapGeometryCoordinates SMT configuration options

Property

Description

Type

Default

Valid Values

Importance

A comma-separated list of spatial reference identifier values to which you want to apply the transformation. The transformation swaps the coordinate system only for the specified values. Other geometry values are passed as-is.

list

4326,3857, 4269

non-empty list

low