[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Inconsistent results on ST_Intersects and ST_Distance
From:       Palmetzhofer Dietmar <Dietmar.Palmetzhofer () vorarlberg ! at>
Date:       2020-02-27 13:28:12
Message-ID: 7d897925fd624cac9c900b20dc4eae69 () vorarlberg ! at
[Download RAW message or body]

For practical anlysis in GIS, I am considering 0-tolerance is a problem. But I do not \
want to start a new tolerance-discussion here. I was just confused, because I read \
that ST_Intersects uses a tolerance, and assumed, ST_Intersection also uses this \
tolerance. But ST_Intersection does not (my fault - I did not read the documentation \
well). Using postgis.topology and adding both tables to it solves the problem. When \
creating the topology I can specify a tolerance, and because a vertex is inserted at \
that specific position for both geometries, the intersection afterwards gives the \
expected results.

Regards,
Didi

-----Ursprüngliche Nachricht-----
Von: postgis-users <postgis-users-bounces@lists.osgeo.org> Im Auftrag von Paul Ramsey
Gesendet: Mittwoch, 26. Februar 2020 17:07
An: PostGIS Users Discussion <postgis-users@lists.osgeo.org>
Betreff: Re: [postgis-users] Inconsistent results on ST_Intersects and ST_Distance



> On Feb 26, 2020, at 2:02 AM, Palmetzhofer Dietmar \
> <Dietmar.Palmetzhofer@vorarlberg.at> wrote: 
> I have a simple LINE-Geometry and a POINT, that I want to query, if it intersects \
> the line. The result ist, that ST_Intersects gives „FALSE", and ST_Distance gives \
> „0". So, this is contradictory. An analysis with JTS shows, that there is a \
> distance of 6.611191059663252E-13. Should ST_Distance not also return this result?
> 

They are different code lines, and have different tolerances. At some point "very \
small" becomes "zero", and unfortunately these two lines have different places where \
that happens. If we patched up this case you'd just find a new one at E-20 :) the \
boundary between real math and discrete math exists and is manifest in the code.

P
_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic