You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The distance from Point c ('POINT( 0.2 0.9)') to Line a ('LINESTRING(2 0, 0 1)') is 0. Line b ('LINESTRING(2 0, 0.2 0.9, 0 1)') is Line a plus Point c.
SELECT ST_Equals(Foo.a, Foo.b), ST_Distance(Foo.a, Foo.c)
FROM (SELECT ST_GeomFromText('LINESTRING(2 0, 0 1)') As a,
ST_GeomFromText('LINESTRING(2 0, 0.2 0.9, 0 1)') As b,
ST_GeomFromText('POINT( 0.2 0.9)') As c) As Foo;
SELECT ST_Equals(g1, g2) As g1Equalsg2
FROM (SELECT ST_GeomFromText('LINESTRING(0 0, 10 10)') As g1,
ST_GeomFromText('LINESTRING(0 0, 5 5, 10 10)') As g2) As Foo;
g1equalsg2
------------
t
(1 row)
Actual Behavior
PostGIS doesn’t think Line a equals Line b. The following statement is the same as the statement in the geometry description. The result of st_equals is false which means Postgis doesn’t think they are the same line.
SELECT ST_Equals(Foo.a, Foo.b), ST_Distance(Foo.a, Foo.c)
FROM (SELECT ST_GeomFromText('LINESTRING(2 0, 0 1)') As a,
ST_GeomFromText('LINESTRING(2 0, 0.2 0.9, 0 1)') As b,
ST_GeomFromText('POINT( 0.2 0.9)') As c) As Foo;
st_equals | st_distance
-----------+-------------
f | 0
(1 row)
Additional Information
SQLServer thinks the two LINESTRINGs are equal.
DECLARE @g1 geometry;DECLARE @g2 geometry;DECLARE @g3 geometry;
SET @g1 = geometry::STGeomFromText ('LINESTRING(2 0, 0 1)',0);
SET @g2 = geometry::STGeomFromText ('LINESTRING(2 0, 0.2 0.9, 0 1)',0);
SET @g3 = geometry::STGeomFromText ('POINT(0.2 0.9)',0);
SELECT @g1.STEquals(@g2) As g1Equalsg2
g1Equalsg2
----------1
(1 rows affected)
The text was updated successfully, but these errors were encountered:
Geometry Description
The distance from
Point c
('POINT( 0.2 0.9)') toLine a
('LINESTRING(2 0, 0 1)') is 0.Line b
('LINESTRING(2 0, 0.2 0.9, 0 1)') isLine a
plusPoint c
.Expected Behavior
Line a
should equalLine b
. As the example in the document [link](https://postgis.net/docs/ST_Equals.html):Actual Behavior
PostGIS doesn’t think
Line a
equalsLine b
. The following statement is the same as the statement in the geometry description. The result of st_equals is false which means Postgis doesn’t think they are the same line.Additional Information
SQLServer thinks the two LINESTRINGs are equal.
The text was updated successfully, but these errors were encountered: