Skip to main content
A GEOMETRYCOLLECTION is a collection of heterogeneous , such as , , , or other GEOMETRYCOLLECTIONs. It provides a way of referring to a group of spatial objects as one “thing” so that you can operate on it/them more conveniently using various SQL functions. You can also store a “ with the following additional dimensions:
  • A third dimension coordinate Z (Z).
  • A measure coordinate M (M).
  • Both a third dimension and a measure coordinate (ZM).
The Z and M dimensions can be accessed or modified using a number of , including:
  • ST_Z
  • ST_M
  • ST_Affine
  • ST_Zmflag
  • ST_MakePoint
  • ST_MakePointM
  • ST_Force3D
  • ST_Force3DZ
  • ST_Force3DM
  • ST_Force4D
  • ST_Snap
  • ST_SnapToGrid
  • ST_RotateZ
  • ST_AddMeasure
Note that CockroachDB’s is still based on the 2D coordinate system. This means that:
  • The Z/M dimension is not index accelerated when using spatial predicates.
  • Some spatial functions ignore the Z/M dimension, with transformations discarding the Z/M value.

Examples

A GeometryCollection can be created from SQL by calling the st_geomfromtext function on a GeometryCollection definition expressed in the format as shown below.

See also