ST_BoxndfToGeom

更新时间: 2026-08-31 14:02:35

Converts a boxndf bounding box into a geometry object. The output dimension depends on which spatial dimensions the bounding box contains.

Syntax

geometry ST_BoxNDFToGeom(boxndf box);

Parameters

ParameterDescription
boxThe bounding box to convert.

Behavior

  • If the bounding box includes the z dimension, the function returns a three-dimensional geometry.

  • If the bounding box does not include the z dimension, the function returns a two-dimensional geometry.

  • If the bounding box does not include the x or y dimension, the function returns NULL.

Example

SELECT ST_AsText(ST_BoxndfToGeom(ST_MakeBox2dt(0,0,'2000-01-01'::timestamp, 20,20, '2020-01-01'::timestamp)));
             st_astext
------------------------------------
 POLYGON((0 0,0 20,20 20,20 0,0 0))
上一篇: ST_MakeBox{Z|T|2D|2DT|3D|3DT} 下一篇: ST_Has{xy|z|t}