On this page Carat arrow pointing down

A POINT is a sizeless location identified by its X and Y coordinates. These coordinates are then translated according to the current spatial reference system (denoted by an SRID) to determine what the Point "is", or what it "means" relative to the other spatial objects (if any) in the data set.

You can also store a POINT with the following additional dimensions:

  • A third dimension coordinate Z (POINTZ).
  • A measure coordinate M (POINTM).
  • Both a third dimension and a measure coordinate (POINTZM).

The Z and M dimensions can be accessed or modified using a number of built-in functions, 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 spatial indexing 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.



A Point can be created in SQL by the st_point function.

The statement below creates a Point (using the common SRID 4326).

SELECT ST_SetSRID(ST_Makepoint(0,0), 4326);
(1 row)

Well known text

A Point can be created from SQL by calling the st_geomfromtext function on a Point definition expressed in the Well Known Text (WKT) format as shown below.

SELECT ST_GeomFromText('POINT(0 0)');
(1 row)

See also

Yes No
On this page

Yes No