~= — Returns TRUE
if the geometry A is the same as B.
boolean ~=(
geometry
A
,
geometry
B
)
;
The ~=
operator returns TRUE
if geometry A is the same as geometry B.
It tests actual geometric equality of two features. So if A and B are the same feature, vertex-by-vertex, the
operator returns TRUE
.
This operand will make use of any indexes that may be available on the geometries. |
SELECT tbl1.column1, tbl2.column1, tbl1.column2 ~= tbl2.column2 AS same FROM ( VALUES (1, 'LINESTRING (0 0, 2 2)'::geometry)) AS tbl1, ( VALUES (2, 'LINESTRING (0 0, 1 1, 2 2)'::geometry), (3, 'LINESTRING (2 2, 0 0)'::geometry), (4, 'LINESTRING (0 0, 2 2)'::geometry)) AS tbl2; column1 | column1 | same ---------+---------+------ 1 | 2 | f 1 | 3 | f 1 | 4 | t (3 rows)