Skip to content

ST_Force3D

Forces a geometry into a XYZ coordinate model with an optional Z value.

Usage

geometry ST_Force3D(geom: geometry)
geometry ST_Force3D(geom: geometry, z: double)

Arguments

  • geom (geometry): Input geometry
  • z (double)

Description

If the geometry already has Z values they are preserved; otherwise the optional z argument (default 0) is used.

Examples

SELECT ST_Force3D(ST_GeomFromWKT('POINT (1 2)'), 10.0);
┌─────────────────────────────────────────────────────────────┐
│ st_force3d(st_geomfromwkt(Utf8("POINT (1 2)")),Float64(10)) │
│                           geometry                          │
╞═════════════════════════════════════════════════════════════╡
│ POINT Z(1 2 10)                                             │
└─────────────────────────────────────────────────────────────┘
SELECT ST_Force3D(ST_GeomFromWKT('POINT (1 2)'));
┌─────────────────────────────────────────────────┐
│ st_force3d(st_geomfromwkt(Utf8("POINT (1 2)"))) │
│                     geometry                    │
╞═════════════════════════════════════════════════╡
│ POINT Z(1 2 0)                                  │
└─────────────────────────────────────────────────┘
SELECT ST_Force3D(ST_GeomFromWKT('POINT Z (1 2 3)'), 10.0);
┌─────────────────────────────────────────────────────────────────┐
│ st_force3d(st_geomfromwkt(Utf8("POINT Z (1 2 3)")),Float64(10)) │
│                             geometry                            │
╞═════════════════════════════════════════════════════════════════╡
│ POINT Z(1 2 3)                                                  │
└─────────────────────────────────────────────────────────────────┘