scale#

GeosSeriesAccessor.scale(x, y, z=None, *, origin=None)#

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

2D
\[\begin{split}\begin{bmatrix} x' \\ y' \\ 1 \end{bmatrix} &= \begin{bmatrix} x_s & 0 & x_{off} \\ 0 & y_s & y_{off} \\ 0 & 0 & 1 \\ \end{bmatrix} \begin{bmatrix} x \\ y \\ 1 \end{bmatrix} \\ x_{off} &= x_{origin} - x_{origin}*x_s \\ y_{off} &= y_{origin} - y_{origin}*y_s\end{split}\]
3D
\[\begin{split}\begin{bmatrix} x' \\ y' \\ z' \\ 1 \end{bmatrix} &= \begin{bmatrix} x_s & 0 & 0 & x_{off} \\ 0 & y_s & 0 & y_{off} \\ 0 & 0 & z_s & z_{off} \\ 0 & 0 & 0 & 1 \\ \end{bmatrix} \begin{bmatrix} x \\ y \\ z \\ 1 \end{bmatrix} \\ x_{off} &= x_{origin} - x_{origin}*x_s \\ y_{off} &= y_{origin} - y_{origin}*y_s \\ z_{off} &= z_{origin} - z_{origin}*z_s\end{split}\]
Parameters:
  • x (float) – Scaling value in the X direction.

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

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

  • origin (shapely.lib.Geometry or list-like) – Origin point for the transformation.

Returns:

Transformed geometries.

Return type:

pandas.Series