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

# ST_EqualsIdentical

Returns true when two geometries have identical geometry types, component and coordinate ordering, dimensional layouts, and coordinate values.

Every available coordinate dimension participates in the comparison, including Z and M. Corresponding NaN ordinates compare equal. SRID, precision model, and user data are not compared.

Unlike `ST_Equals`, this function checks representation rather than two-dimensional topological equality. Unlike `ST_EqualsExact`, it compares Z and M and does not accept a tolerance.

## Signatures

```sql theme={"system"}
ST_EqualsIdentical(A: Geometry, B: Geometry)
```

## Parameters

<ParamField body="A" type="Geometry" required>The first geometry.</ParamField>
<ParamField body="B" type="Geometry" required>The second geometry.</ParamField>

## Return type

<ResponseField type="Boolean">Returns `true` when the geometry representations are identical, `false` otherwise, or `NULL` if either input is `NULL`.</ResponseField>

The comparison uses the dimensions retained by the input geometry values. It checks geometric content, not a byte-for-byte encoding. Compare SRIDs separately when CRS identity is also required.

## Visual examples

### Structure and coordinate order

The inputs are shown separately so their traversal direction and container structure are easy to
compare. Geometries can occupy the same locations and still be non-identical when their vertex
order, geometry type, or nesting differs.

<img src="https://mintcdn.com/wherobots/qgskT70dgmj4LJ8Z/images/sql-functions/ST_EqualsIdentical/ST_EqualsIdentical_structure.svg?fit=max&auto=format&n=qgskT70dgmj4LJ8Z&q=85&s=d7ccf1ff4dec5b0dd1b8f49d3fbd7a77" alt="ST_EqualsIdentical compares geometry structure and coordinate order" width="1200" height="830" data-path="images/sql-functions/ST_EqualsIdentical/ST_EqualsIdentical_structure.svg" />

### Z, M, and ZM dimensions

The coordinate layout is part of a geometry's identity. `POINT Z (1 2 3)` and
`POINT M (1 2 3)` contain the same numeric values, but the third ordinate has a different role.
For ZM geometries, both the Z and M values participate in the comparison.

<img src="https://mintcdn.com/wherobots/qgskT70dgmj4LJ8Z/images/sql-functions/ST_EqualsIdentical/ST_EqualsIdentical_dimensions.svg?fit=max&auto=format&n=qgskT70dgmj4LJ8Z&q=85&s=b0b2ac8fef19652ac5f70142b76cd838" alt="ST_EqualsIdentical compares every X, Y, Z, and M ordinate" width="1200" height="970" data-path="images/sql-functions/ST_EqualsIdentical/ST_EqualsIdentical_dimensions.svg" />

## Examples

### Identical geometries

```sql theme={"system"}
SELECT ST_EqualsIdentical(
    ST_GeomFromWKT('POINT Z (1 2 3)'),
    ST_GeomFromWKT('POINT Z (1 2 3)')
);
```

```text theme={"system"}
true
```

### Coordinate values and dimensional roles

Changing a Z value makes the geometries non-identical. An XYZ point and an XYM point are also non-identical even when their numeric values match.

```sql theme={"system"}
SELECT
    ST_EqualsIdentical(
        ST_GeomFromWKT('POINT Z (1 2 3)'),
        ST_GeomFromWKT('POINT Z (1 2 4)')
    ) AS changed_z,
    ST_EqualsIdentical(
        ST_GeomFromWKT('POINT Z (1 2 3)'),
        ST_GeomFromWKT('POINT M (1 2 3)')
    ) AS z_is_not_m;
```

```text theme={"system"}
changed_z | z_is_not_m
----------+-----------
false     | false
```

### Coordinate order

Reversing a line preserves its shape but changes its coordinate order.

```sql theme={"system"}
SELECT ST_EqualsIdentical(
    ST_GeomFromWKT('LINESTRING (0 0, 1 1, 2 0)'),
    ST_GeomFromWKT('LINESTRING (2 0, 1 1, 0 0)')
);
```

```text theme={"system"}
false
```
