> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-properties/st_dimension.md).

# ST\_DIMENSION

## Syntax

```bnf
ST_Dimension(g)
Dimension(g)
```

## Description

Returns the inherent dimension of the geometry value *`g`*. The result can\
be

| Dimension | Definition                               |
| --------- | ---------------------------------------- |
| -1        | empty geometry                           |
| 0         | geometry with no length or area          |
| 1         | geometry with no area but nonzero length |
| 2         | geometry with nonzero area               |

`ST_Dimension()` and `Dimension()` are synonyms.

## Examples

```sql
SELECT Dimension(GeomFromText('LineString(1 1,2 2)'));
+------------------------------------------------+
| Dimension(GeomFromText('LineString(1 1,2 2)')) |
+------------------------------------------------+
|                                              1 |
+------------------------------------------------+
```

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
