Transformations

Swap Geometry Coordinates

qianmoQqianmoQ· 更新于 2026-09-24· 阅读 8 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

SwapGeometryCoordinates

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 single message transformation (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.

Applying the SwapGeometryCoordinates SMT to convert coordinates in captured data

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 (SRIDs), or you can customize the configuration so that the transform applies only to specific identifiers. Other fields are left unchanged.

Procedure

  1. To configure the default behavior of the transformation, add it to the connector configuration without specifying any options, as in the following example:

    transforms=swap
    transforms.swap.type=io.debezium.transforms.SwapGeometryCoordinates
  2. To selectively apply the transformation only to geometries that have embedded SRIDs that match a specific value, such as 4326, add the property transform.swap.srids to the configuration, as in the following example:

    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.

PropertyDescriptionTypeDefaultValid ValuesImportance
sridsA 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.list4326,3857, 4269non-empty listlow

Table 1. SwapGeometryCoordinates SMT configuration options

评论

登录后参与评论

正在加载评论…