= — AのバウンディングボックスがBのバウンディングボックスと同じ場合にTRUEを返します。倍精度浮動小数点数のバウンディングボックスを使います。
boolean =( geometry A , geometry B );
boolean =( geography A , geography B );
=演算子は、ジオメトリ/ジオグラフィAのバウンダリボックスが、Bのバウンダリボックスと同じ場合にTRUEを返します。PostgreSQLは、ジオメトリが内部の並べ替えの実行やジオメトリの比較を行うために定義した=, <, >演算子を使います (GROUP BYやORDER BY節)。
![]() | |
This is cause for a lot of confusion. When you compare geometryA = geometryB it will return true even when the geometries are clearly different IF their bounding boxes are the same. To check for true equality use ST_OrderingEquals or ST_Equals |
![]() | |
これのオペランドはジオメトリで使用できるインデクスを*使いません*。 |
This method supports Circular Strings and Curves
This function supports Polyhedral surfaces.
Changed: 2.0.0 ジオメトリのバウンディングボックスをfloat4使用から倍精度使用に変更しました。ほんの少し違う位置にある特定のポイントについて、float4でのバウンディングボックスなら同じになるのにfloat8 (倍精度)でのバウンディングボックスでは異なるため、以前の版ではtrueが返ったのが2.0以上ではfalseが返る、という副作用があります。
SELECT 'LINESTRING(0 0, 0 1, 1 0)'::geometry = 'LINESTRING(1 1, 0 0)'::geometry;
?column?
----------
t
(1 row)
SELECT ST_AsText(column1)
FROM ( VALUES
('LINESTRING(0 0, 1 1)'::geometry),
('LINESTRING(1 1, 0 0)'::geometry)) AS foo;
st_astext
---------------------
LINESTRING(0 0,1 1)
LINESTRING(1 1,0 0)
(2 rows)
-- Note: the GROUP BY uses the "=" to compare for geometry equivalency.
SELECT ST_AsText(column1)
FROM ( VALUES
('LINESTRING(0 0, 1 1)'::geometry),
('LINESTRING(1 1, 0 0)'::geometry)) AS foo
GROUP BY column1;
st_astext
---------------------
LINESTRING(0 0,1 1)
(1 row)
-- In versions prior to 2.0, this used to return true --
SELECT ST_GeomFromText('POINT(1707296.37 4820536.77)') =
ST_GeomFromText('POINT(1707296.27 4820536.87)') As pt_intersect;
--pt_intersect --
f