From 08e461795d306932b777a8b965a246ce83189d2d Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Wed, 13 Sep 2017 21:51:22 +0000 Subject: [PATCH] update docs to reflect = operator changed in 2.4.0. correct the examples to exhibit new behavior. Put a note in ~= which means what = used to mean References #3844 for PostGIS 2.4.0 git-svn-id: http://svn.osgeo.org/postgis/trunk@15721 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_operator.xml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/doc/reference_operator.xml b/doc/reference_operator.xml index 4e2284a24..58654ffc6 100644 --- a/doc/reference_operator.xml +++ b/doc/reference_operator.xml @@ -918,7 +918,8 @@ FROM = - Returns TRUE if A's bounding box is the same as B's. Uses double precision bounding box. + Returns TRUE if the coordinates and coordinate order geometry/geography A + are the same as the coordinates and coordinate order of geometry/geography B. @@ -971,15 +972,18 @@ FROM Only geometry/geography that are exactly equal in all respects, with the same coordinates, in the same order, are considered equal by this operator. For "spatial equality", that ignores - things like coordinate order, and can detect features that - cover the same spatial area with different representations, - use + things like coordinate order, and can detect features that + cover the same spatial area with different representations, + use or This operand will NOT make use of any indexes that may be available on the geometries. For an index assisted exact equality test, combine = with &&. + + Changed: 2.4.0, in prior versions this was bounding box equality not a geometric equality. If you need bounding box equality, use instead. + &curve_support; &P_support; @@ -991,7 +995,7 @@ FROM SELECT 'LINESTRING(0 0, 0 1, 1 0)'::geometry = 'LINESTRING(1 1, 0 0)'::geometry; ?column? ---------- - t + f (1 row) SELECT ST_AsText(column1) @@ -1010,10 +1014,11 @@ FROM ( VALUES ('LINESTRING(0 0, 1 1)'::geometry), ('LINESTRING(1 1, 0 0)'::geometry)) AS foo GROUP BY column1; - st_astext + st_astext --------------------- LINESTRING(0 0,1 1) -(1 row) + LINESTRING(1 1,0 0) +(2 rows) -- In versions prior to 2.0, this used to return true -- SELECT ST_GeomFromText('POINT(1707296.37 4820536.77)') = @@ -1027,7 +1032,7 @@ f See Also - , + , , @@ -1820,8 +1825,7 @@ FROM which behavior your database has. To find out which behavior your database has you can run the query below. To check for true equality use or and to check for bounding box equality ; - operator is a safer option. + linkend="ST_Equals" />. @@ -1834,7 +1838,6 @@ select 'LINESTRING(0 0, 1 1)'::geometry ~= 'LINESTRING(0 1, 1 0)'::geometry as e -----------------+ t | - The above can be used to test if you have the new or old behavior of ~= operator. See Also -- 2.40.0