> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# POINT

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

A `POINT` is a sizeless location identified by its X and Y coordinates. These coordinates are then translated according to the current <InternalLink path="architecture/glossary#spatial-reference-system">spatial reference system</InternalLink> (denoted by an <InternalLink path="architecture/glossary#srid">SRID</InternalLink>) to determine what the Point "is", or what it "means" relative to the <InternalLink path="spatial-data-overview#spatial-objects">other spatial objects</InternalLink> (if any) in the data set.

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 <InternalLink path="functions-and-operators">built-in functions</InternalLink>, 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 <InternalLink path="spatial-indexes">spatial indexing</InternalLink> 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 Point can be created in SQL by the `st_point` function.

The statement below creates a Point (using the common <InternalLink path="architecture/glossary#srid">SRID 4326</InternalLink>).

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
SELECT ST_SetSRID(ST_Makepoint(0,0), 4326);
```

```
                      st_setsrid
------------------------------------------------------
  0101000020E610000000000000000000000000000000000000
(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 <InternalLink path="architecture/glossary#wkt">Well Known Text (WKT)</InternalLink> format as shown below.

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
SELECT ST_GeomFromText('POINT(0 0)');
```

```
               st_geomfromtext
----------------------------------------------
  010100000000000000000000000000000000000000
(1 row)
```

## See also

* <InternalLink path="spatial-tutorial">Spatial tutorial</InternalLink>
* <InternalLink path="spatial-data-overview#spatial-objects">Spatial objects</InternalLink>
* <InternalLink path="linestring">LINESTRING</InternalLink>
* <InternalLink path="polygon">POLYGON</InternalLink>
* <InternalLink path="multipoint">MULTIPOINT</InternalLink>
* <InternalLink path="multilinestring">MULTILINESTRING</InternalLink>
* <InternalLink path="multipolygon">MULTIPOLYGON</InternalLink>
* <InternalLink path="geometrycollection">GEOMETRYCOLLECTION</InternalLink>
* <InternalLink path="geoserver">Using GeoServer with CockroachDB</InternalLink>
