translate#

GeosSeriesAccessor.translate(x, y, z=None)#

Performs a 2D or 3D translation on all the coordinates.

2D
\[\begin{split}\begin{bmatrix} x' \\ y' \\ 1 \end{bmatrix} &= \begin{bmatrix} 1 & 0 & x_t \\ 0 & 1 & y_t \\ 0 & 0 & 1 \\ \end{bmatrix} \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}\end{split}\]
3D
\[\begin{split}\begin{bmatrix} x' \\ y' \\ z' \\ 1 \end{bmatrix} &= \begin{bmatrix} 1 & 0 & 0 & x_t \\ 0 & 1 & 0 & y_t \\ 0 & 0 & 1 & z_t \\ 0 & 0 & 0 & 1 \\ \end{bmatrix} \begin{bmatrix} x \\ y \\ z \\ 1 \end{bmatrix}\end{split}\]
Parameters:
  • x (float) – Translation value in the X direction.

  • y (float) – Translation value in the Y direction.

  • z (float, optional) – Translation value in the Z direction; Default None.

Returns:

Transformed geometries.

Return type:

pandas.Series