# geometry

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: geometry
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-data-types/geometry
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-data-types/geometry.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-data-types/geometry.adoc
description: The `geometry` data type stores planar (Cartesian) spatial point values as two double-precision coordinates.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-data-types/geometry.md -->

The `geometry` data type stores planar (Cartesian) spatial point values as two double-precision coordinates. It uses [Well-Known Text (WKT)](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) and [Well-Known Binary (WKB)](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary) formats for input and output.

> 📝 **NOTE**
>
> Redpanda SQL supports only `POINT` geometries. Multi-part geometries such as `POLYGON`, `LINESTRING`, and `MULTIPOINT` are not supported.

## [](#format)Format

`geometry` values can be specified in the following formats:

-   WKT: `POINT(x y)` (space-separated coordinates)

-   EWKT: `SRID=4326;POINT(x y)` (SRID is accepted but ignored for `geometry`)

-   EWKB: A hex-encoded binary string (42 hex characters)


```sql
SELECT GEOMETRY 'POINT(0.1234 5.6789)';
```

## [](#differences-between-geometry-and-geography)Differences between `geometry` and `geography`

| geometry | geography |
| --- | --- |
| Uses a Cartesian (planar) coordinate system | Uses a geodetic (spherical) coordinate system |
| SRID is ignored | SRID is always 4326 (WGS84) |
| st_distance returns Euclidean distance | st_distance returns distance in meters |

## [](#casting)Casting

`geometry` supports the following casts:

-   `geometry` → `text`: Returns WKB hex string

-   `text` → `geometry`: Parses WKT or EWKB string

-   `geometry` → `geography`: Adds SRID=4326

-   `geography` → `geometry`: Removes SRID

-   `geometry` → `point`: Converts to `(x,y)` format

-   `point` → `geometry`: Converts to WKB format


## [](#functions)Functions

The following functions work with `geometry` values:

| Function | Description | Return type |
| --- | --- | --- |
| st_astext(geometry) | Returns the WKT representation of the geometry | text |
| st_astext(geometry, max_digits) | Returns the WKT representation with limited decimal digits | text |
| st_asewkt(geometry) | Returns the Extended WKT representation | text |
| st_asewkt(geometry, max_digits) | Returns the Extended WKT representation with limited decimal digits | text |
| st_distance(geometry, geometry) | Returns the Euclidean distance between two geometry points | double precision |

## [](#examples)Examples

```sql
SELECT
  ST_ASTEXT(GEOMETRY 'POINT(1.5 2.5)') AS wkt,
  ST_DISTANCE(
    GEOMETRY 'POINT(0 0)',
    GEOMETRY 'POINT(3 4)'
  ) AS distance;
```

```sql
      wkt       | distance
----------------+----------
 POINT(1.5 2.5) |        5
```