Skip to main content
A MULTIPOINT is a collection of . MultiPoints are useful for gathering a group of Points into one geometry. For example, you may want to gather the points denoting all of the State Capitols in the U.S. into a single geometry. You can also store a MULTIPOINT with the following additional dimensions:
  • A third dimension coordinate Z ( MULTIPOINTZ ).
  • A measure coordinate M ( MULTIPOINTM ).
  • Both a third dimension and a measure coordinate ( MULTIPOINTZM ).
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

SQL

A MultiPoint can be created from SQL by calling an aggregate function such as ST_Collect or on a column that contains geometries. In the example below, we will build a MultiPoint from several Points.
  1. Insert the Points:
  2. Build a MultiPoint from the individual using ST_Collect, and check the output with ST_GeometryType to verify that it is indeed a MultiPoint:
  3. Drop the temporary table:

Well known text

A MultiPoint can be created from SQL by calling the st_geomfromtext function on a MultiPoint definition expressed in the format. For example, the MultiPoint in the example below includes the locations of independent bookstores in Chicago, Illinois USA:

See also