Geometry set z-coordinate

Supported in: Batch, Streaming

Sets the z-coordinate of a geometry. If the geometry has an existing z-coordinate it will be overwritten.

Expression categories: Geospatial

Declared arguments

  • Geometry - Geometry.
    Expression<Geometry>
  • Z coordinate - Z-coordinate.
    Expression<Double>

Output type: Geometry

Examples

Example 1: Base case

Argument values:

  • Geometry: geometry
  • Z coordinate: zCoordinate
geometryzCoordinateOutput
{"type":"Point","coordinates":[1.0, 2.0]}1.0{"type":"Point","coordinates":[1.0, 2.0, 1.0]}
{"type":"Point","coordinates":[1.0, 2.0, 3.0]}1.0{"type":"Point","coordinates":[1.0, 2.0, 1.0]}

Example 2: Null case

Argument values:

  • Geometry: geometry
  • Z coordinate: zCoordinate
geometryzCoordinateOutput
null0.0null
{"type":"Point","coordinates":[1.0, 2.0]}null{"type":"Point","coordinates":[1.0, 2.0]}