Tests if a geometry is identical to another geometry.
geometry-expression.ST_OrderingEquals(geo2)
Name | Type | Description |
---|---|---|
geo2 |
ST_Geometry |
The other geometry value that is to be compared to the geometry-expression. |
BIT Returns 1 if the two geometry values are exactly equal, otherwise 0.
Tests if an ST_Geometry value is identical to another ST_Geometry value. The two geometries must contain the same hierarchy of objects with the exact same points in the same order to be considered equal under ST_OrderingEquals.
The ST_OrderingEquals method differs from ST_Equals in that it considers the orientation of curves. Two curves can contain exactly the same points but in opposite orders. These two curves are considered equal with ST_Equals but unequal with ST_OrderingEquals. Additionally, ST_OrderingEquals requires that each point in both geometries is exactly equal, not just equal within the tolerance-distance specified by the spatial reference system.
The ST_OrderingEquals method defines the semantics used for comparison predicates (= and <>), IN list predicates, DISTINCT, and GROUP BY. If you wish to compare if two spatial values are spatially equal (contain the same set of points in set), you can use the ST_Equals method.
For more information, see How spatial comparisons work.
The SQL/MM standard defines ST_OrderingEquals to return a relative ordering, with 0 returned if two geometries are spatially equal (according to ST_Equals) and 1 if they are not equal. The SQL Anywhere implementation follows industry practice and differs from SQL/MM in that it returns a boolean with 1 indicating the geometries are equal and 0 indicating they are different. Further, the ST_OrderingEquals implementation differs from SQL/MM because it tests that values are identical (same hierarchy of objects in the same order) instead of spatially equal (same set of points in space).
SQL/MM (ISO/IEC 13249-3: 2006) 5.1.43
The following example returns the result 16
. The Shape corresponding to ShapeID the result 16
contains the exact same points in the exact same order as the specified polygon.
SELECT ShapeID FROM SpatialShapes WHERE Shape.ST_OrderingEquals( NEW ST_Polygon( 'Polygon ((0 0, 2 0, 1 2, 0 0))' ) ) = 1 |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |