跳转至

Geometry 3d affine transformation(几何三维仿射变换(Geometry 3D Affine Transformation))

Supported in: Batch, Faster, Streaming

Applies a three dimensional affine transformation to the input geometry. This transformation occurs in the user-provided projected coordinate system, and the result is projected back to WGS84. Two dimensional geometries will have their z-coordinates set to 0 before the affine transformation is applied. The returned geometry is three dimensional and for each coordinate [x,y,z] represents the matrix multiplication [[x0, x1, x2, x-offset], [y0, y1, y2, y-offset], [z0, z1, z2, z-offset], [0, 0, 0, 1]] * [x, y, z, 1], where the first three ordinates of the result are returned.

Expression categories: Geospatial

Declared arguments

  • Geometry column: The geometries on which the affine transformation is applied.
    Expression\
  • Projected coordinate system: Coordinate system identifier formatted as "authority:id". For example, UTM zone 18N could be identified by EPSG:32618. Geometries will be cast to the source coordinate system, have an affine transformation applied, then re-cast to WGS84.
    Literal\
  • optional X offset: The (0,3) value of the matrix with default 0.0. This parameter represents the distance in projected coordinates that the geometry will be translated in the positive x direction.
    Literal\
  • optional X0: The (0,0) value of the matrix with default 1.0.
    Literal\
  • optional X1: The (0,1) value of the matrix with default 0.0.
    Literal\
  • optional X2: The (0,2) value of the matrix with default 0.0.
    Literal\
  • optional Y offset: The (1,3) value of the matrix with default 0.0. This parameter represents the distance in projected coordinates that the geometry will be translated in the positive y direction.
    Literal\
  • optional Y0: The (1,0) value of the matrix with default 0.0.
    Literal\
  • optional Y1: The (1,1) value of the matrix with default 1.0.
    Literal\
  • optional Y2: The (1,2) value of the matrix with default 0.0.
    Literal\
  • optional Z offset: The (2,3) value of the matrix with default 0.0. This parameter represents the distance in projected coordinates that the geometry will be translated in the positive z direction.
    Literal\
  • optional Z0: The (2,0) value of the matrix with default 0.0.
    Literal\
  • optional Z1: The (2,1) value of the matrix with default 0.0.
    Literal\
  • optional Z2: The (2,2) value of the matrix with default 1.0.
    Literal\

Output type: Geometry

Examples

Example 1: Base case

Argument values:

  • Geometry column: geometry
  • Projected coordinate system: EPSG:4326
  • X offset: 0.0
  • X0: 0.0
  • X1: -1.0
  • X2: 0.0
  • Y offset: 0.0
  • Y0: 1.0
  • Y1: 0.0
  • Y2: 0.0
  • Z offset: 0.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 0.0
geometry Output
{"type":"Polygon","coordinates":[[[0.0, 0.0],[1.0, 0.0],[1.0, 1.0],[0.0, 1.0],[0.0, 0.0]]]} {"type":"Polygon","coordinates":[[[0.0, 0.0, 0.0],[0.0, 1.0, 0.0],[-1.0, 1.0, 0.0],[-1.0, 0.0, 0.0],[0.0, 0.0, 0.0]]]}

Example 2: Base case

Argument values:

  • Geometry column: geometry
  • Projected coordinate system: EPSG:4326
  • X offset: 1.0
  • X0: 0.0
  • X1: -3.0
  • X2: 0.0
  • Y offset: 2.0
  • Y0: 0.0
  • Y1: 2.0
  • Y2: 0.0
  • Z offset: 3.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 1.0
geometry Output
{"type":"Polygon","coordinates":[[[0.0, 0.0, 1.0],[1.0, 0.0, 2.0],[1.0, 1.0, 3.0],[0.0, 1.0, 2.0],[0.0, 0.0, 1.0]]]} {"type":"Polygon","coordinates":[[[1.0, 2.0, 4.0],[1.0, 2.0, 5.0],[-2.0, 4.0, 6.0],[-2.0, 4.0, 5.0],[1.0, 2.0, 4.0]]]}

Example 3: Base case

Argument values:

  • Geometry column: geometry
  • Projected coordinate system: EPSG:4326
  • X offset: 0.0
  • X0: 2.0
  • X1: 0.0
  • X2: 0.0
  • Y offset: 0.0
  • Y0: 0.0
  • Y1: 3.0
  • Y2: 0.0
  • Z offset: 0.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 4.0
geometry Output
{"type":"Point","coordinates":[1.0, 2.0, 3.0]} {"type":"Point","coordinates":[2.0, 6.0, 12.0]}
{"type":"LineString","coordinates":[[0.0, 1.0, 1.0], [1.0, 2.0, 3.0]]} {"type":"LineString","coordinates":[[0.0, 3.0, 4.0],[2.0, 6.0, 12.0]]}
{"type":"Polygon","coordinates":[[[0.0, 0.0],[1.0, 0.0],[1.0, 1.0],[0.0, 1.0],[0.0, 0.0]]]} {"type":"Polygon","coordinates":[[[0.0, 0.0, 0.0],[2.0, 0.0, 0.0],[2.0, 3.0, 0.0],[0.0, 3.0, 0.0],[0.0, 0.0, 0.0]]]}

Example 4: Base case

Argument values:

  • Geometry column: geometry
  • Projected coordinate system: EPSG:4326
  • X offset: 0.0
  • X0: 1.0
  • X1: 1.0
  • X2: 0.0
  • Y offset: 0.0
  • Y0: 0.0
  • Y1: 1.0
  • Y2: 0.0
  • Z offset: 0.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 0.0
geometry Output
{"type":"Polygon","coordinates":[[[0.0, 0.0],[1.0, 0.0],[1.0, 1.0],[0.0, 1.0],[0.0, 0.0]]]} {"type":"Polygon","coordinates":[[[0.0, 0.0, 0.0],[1.0, 0.0, 0.0],[2.0, 1.0, 0.0],[1.0, 1.0, 0.0],[0.0, 0.0, 0.0]]]}

Example 5: Base case

Argument values:

  • Geometry column: geometry
  • Projected coordinate system: EPSG:4326
  • X offset: 1.0
  • X0: 1.0
  • X1: 0.0
  • X2: 0.0
  • Y offset: 1.0
  • Y0: 0.0
  • Y1: 1.0
  • Y2: 0.0
  • Z offset: 1.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 1.0
geometry Output
{"type":"Point","coordinates":[1.0, 2.0, 3.0]} {"type":"Point","coordinates":[2.0, 3.0, 4.0]}
{"type":"LineString","coordinates":[[0.0, 1.0, 2.0], [1.0, 2.0, 3.0]]} {"type":"LineString","coordinates":[[1.0, 2.0, 3.0],[2.0, 3.0, 4.0]]}
{"type":"Polygon","coordinates":[[[0.0, 0.0],[1.0, 0.0],[1.0, 1.0],[0.0, 1.0],[0.0, 0.0]]]} {"type":"Polygon","coordinates":[[[1.0, 1.0, 1.0],[2.0, 1.0, 1.0],[2.0, 2.0, 1.0],[1.0, 2.0, 1.0],[1.0, 1.0, 1.0]]]}

Example 6: Null case

Argument values:

  • Geometry column: geometry
  • Projected coordinate system: EPSG:32618
  • X offset: 0.0
  • X0: 2.0
  • X1: 0.0
  • X2: 0.0
  • Y offset: 0.0
  • Y0: 3.0
  • Y1: 0.0
  • Y2: 0.0
  • Z offset: 0.0
  • Z0: 4.0
  • Z1: 0.0
  • Z2: 0.0
geometry Output
null null


中文翻译


几何三维仿射变换(Geometry 3D Affine Transformation)

支持:批量(Batch)、快速(Faster)、流式(Streaming)

对输入几何体应用三维仿射变换。该变换在用户提供的投影坐标系(projected coordinate system)中执行,结果将重新投影回 WGS84。二维几何体的 z 坐标将在应用仿射变换前被设置为 0。返回的几何体为三维,每个坐标 [x,y,z] 代表矩阵乘法 [[x0, x1, x2, x-offset], [y0, y1, y2, y-offset], [z0, z1, z2, z-offset], [0, 0, 0, 1]] * [x, y, z, 1],并返回结果的前三个坐标值。

表达式类别: 地理空间(Geospatial)

声明参数

  • 几何列(Geometry column): 应用仿射变换的几何体。
    表达式\
  • 投影坐标系(Projected coordinate system): 格式为 "authority:id" 的坐标系标识符。例如,UTM 18N 区可标识为 EPSG:32618。几何体将被转换至源坐标系,应用仿射变换,然后重新转换回 WGS84。
    字面量\
  • 可选 X 偏移(X offset): 矩阵的 (0,3) 值,默认值为 0.0。该参数表示几何体在投影坐标系中沿 x 正方向平移的距离。
    字面量\
  • 可选 X0: 矩阵的 (0,0) 值,默认值为 1.0。
    字面量\
  • 可选 X1: 矩阵的 (0,1) 值,默认值为 0.0。
    字面量\
  • 可选 X2: 矩阵的 (0,2) 值,默认值为 0.0。
    字面量\
  • 可选 Y 偏移(Y offset): 矩阵的 (1,3) 值,默认值为 0.0。该参数表示几何体在投影坐标系中沿 y 正方向平移的距离。
    字面量\
  • 可选 Y0: 矩阵的 (1,0) 值,默认值为 0.0。
    字面量\
  • 可选 Y1: 矩阵的 (1,1) 值,默认值为 1.0。
    字面量\
  • 可选 Y2: 矩阵的 (1,2) 值,默认值为 0.0。
    字面量\
  • 可选 Z 偏移(Z offset): 矩阵的 (2,3) 值,默认值为 0.0。该参数表示几何体在投影坐标系中沿 z 正方向平移的距离。
    字面量\
  • 可选 Z0: 矩阵的 (2,0) 值,默认值为 0.0。
    字面量\
  • 可选 Z1: 矩阵的 (2,1) 值,默认值为 0.0。
    字面量\
  • 可选 Z2: 矩阵的 (2,2) 值,默认值为 1.0。
    字面量\

输出类型: 几何体(Geometry)

示例

示例 1:基础案例

参数值:

  • 几何列: geometry
  • 投影坐标系: EPSG:4326
  • X 偏移: 0.0
  • X0: 0.0
  • X1: -1.0
  • X2: 0.0
  • Y 偏移: 0.0
  • Y0: 1.0
  • Y1: 0.0
  • Y2: 0.0
  • Z 偏移: 0.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 0.0
geometry 输出
{"type":"Polygon","coordinates":[[[0.0, 0.0],[1.0, 0.0],[1.0, 1.0],[0.0, 1.0],[0.0, 0.0]]]} {"type":"Polygon","coordinates":[[[0.0, 0.0, 0.0],[0.0, 1.0, 0.0],[-1.0, 1.0, 0.0],[-1.0, 0.0, 0.0],[0.0, 0.0, 0.0]]]}

示例 2:基础案例

参数值:

  • 几何列: geometry
  • 投影坐标系: EPSG:4326
  • X 偏移: 1.0
  • X0: 0.0
  • X1: -3.0
  • X2: 0.0
  • Y 偏移: 2.0
  • Y0: 0.0
  • Y1: 2.0
  • Y2: 0.0
  • Z 偏移: 3.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 1.0
geometry 输出
{"type":"Polygon","coordinates":[[[0.0, 0.0, 1.0],[1.0, 0.0, 2.0],[1.0, 1.0, 3.0],[0.0, 1.0, 2.0],[0.0, 0.0, 1.0]]]} {"type":"Polygon","coordinates":[[[1.0, 2.0, 4.0],[1.0, 2.0, 5.0],[-2.0, 4.0, 6.0],[-2.0, 4.0, 5.0],[1.0, 2.0, 4.0]]]}

示例 3:基础案例

参数值:

  • 几何列: geometry
  • 投影坐标系: EPSG:4326
  • X 偏移: 0.0
  • X0: 2.0
  • X1: 0.0
  • X2: 0.0
  • Y 偏移: 0.0
  • Y0: 0.0
  • Y1: 3.0
  • Y2: 0.0
  • Z 偏移: 0.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 4.0
geometry 输出
{"type":"Point","coordinates":[1.0, 2.0, 3.0]} {"type":"Point","coordinates":[2.0, 6.0, 12.0]}
{"type":"LineString","coordinates":[[0.0, 1.0, 1.0], [1.0, 2.0, 3.0]]} {"type":"LineString","coordinates":[[0.0, 3.0, 4.0],[2.0, 6.0, 12.0]]}
{"type":"Polygon","coordinates":[[[0.0, 0.0],[1.0, 0.0],[1.0, 1.0],[0.0, 1.0],[0.0, 0.0]]]} {"type":"Polygon","coordinates":[[[0.0, 0.0, 0.0],[2.0, 0.0, 0.0],[2.0, 3.0, 0.0],[0.0, 3.0, 0.0],[0.0, 0.0, 0.0]]]}

示例 4:基础案例

参数值:

  • 几何列: geometry
  • 投影坐标系: EPSG:4326
  • X 偏移: 0.0
  • X0: 1.0
  • X1: 1.0
  • X2: 0.0
  • Y 偏移: 0.0
  • Y0: 0.0
  • Y1: 1.0
  • Y2: 0.0
  • Z 偏移: 0.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 0.0
geometry 输出
{"type":"Polygon","coordinates":[[[0.0, 0.0],[1.0, 0.0],[1.0, 1.0],[0.0, 1.0],[0.0, 0.0]]]} {"type":"Polygon","coordinates":[[[0.0, 0.0, 0.0],[1.0, 0.0, 0.0],[2.0, 1.0, 0.0],[1.0, 1.0, 0.0],[0.0, 0.0, 0.0]]]}

示例 5:基础案例

参数值:

  • 几何列: geometry
  • 投影坐标系: EPSG:4326
  • X 偏移: 1.0
  • X0: 1.0
  • X1: 0.0
  • X2: 0.0
  • Y 偏移: 1.0
  • Y0: 0.0
  • Y1: 1.0
  • Y2: 0.0
  • Z 偏移: 1.0
  • Z0: 0.0
  • Z1: 0.0
  • Z2: 1.0
geometry 输出
{"type":"Point","coordinates":[1.0, 2.0, 3.0]} {"type":"Point","coordinates":[2.0, 3.0, 4.0]}
{"type":"LineString","coordinates":[[0.0, 1.0, 2.0], [1.0, 2.0, 3.0]]} {"type":"LineString","coordinates":[[1.0, 2.0, 3.0],[2.0, 3.0, 4.0]]}
{"type":"Polygon","coordinates":[[[0.0, 0.0],[1.0, 0.0],[1.0, 1.0],[0.0, 1.0],[0.0, 0.0]]]} {"type":"Polygon","coordinates":[[[1.0, 1.0, 1.0],[2.0, 1.0, 1.0],[2.0, 2.0, 1.0],[1.0, 2.0, 1.0],[1.0, 1.0, 1.0]]]}

示例 6:空值案例

参数值:

  • 几何列: geometry
  • 投影坐标系: EPSG:32618
  • X 偏移: 0.0
  • X0: 2.0
  • X1: 0.0
  • X2: 0.0
  • Y 偏移: 0.0
  • Y0: 3.0
  • Y1: 0.0
  • Y2: 0.0
  • Z 偏移: 0.0
  • Z0: 4.0
  • Z1: 0.0
  • Z2: 0.0
geometry 输出
null null