[postgis-tickets] [PostGIS] #5557: Potential bug in the ST_3DIntersects function.

PostGIS trac at osgeo.org
Thu Oct 5 21:15:37 PDT 2023


#5557: Potential bug in the ST_3DIntersects function.
----------------------+---------------------------
  Reporter:  Wenjing  |      Owner:  pramsey
      Type:  defect   |     Status:  closed
  Priority:  high     |  Milestone:  PostGIS 3.4.1
 Component:  postgis  |    Version:  3.4.x
Resolution:  wontfix  |   Keywords:
----------------------+---------------------------
Changes (by robe):

 * status:  new => closed
 * resolution:   => wontfix

Comment:

 In regard to using tolerance, try using ST_3DWithin instead.  You can
 treat it like 3DIntersects with tolerance.


 {{{
 SELECT ST_3DDWithin(Foo.a, Foo.b,0) As a_Intersects_b
 , ST_3DDWithin(Foo.a1, Foo.b1,0.000001) As a1_Intersects_b1
     FROM (
     SELECT ST_GeomFromText('LINESTRING(5 4 0, 5 0 0)', 0) As a
     ,ST_Affine(ST_GeomFromText('LINESTRING(5 4 0, 5 0 0)', 0),
 -0.9248934130614574, 0.2534855979991293, 0.2834029394388001,
 -0.2259466894528656, -0.9658860720787614, 0.12653927963108094,
 0.3058108369577812, 0.05300139027692074, 0.9506158975253333, 0, 0, 0) As
 a1
     ,ST_GeomFromText('LINESTRING(6 4 0, 4 2 0)', 0) As b
     ,ST_Affine(ST_GeomFromText('LINESTRING(6 4 0, 4 2 0)', 0),
 -0.9248934130614574, 0.2534855979991293, 0.2834029394388001,
 -0.2259466894528656, -0.9658860720787614, 0.12653927963108094,
 0.3058108369577812, 0.05300139027692074, 0.9506158975253333, 0, 0, 0) As
 b1
     ) As Foo;

 }}}


 But realistically I don't think there is anything we can do to fix the
 ST_3DIntersects, we have similar issues in ST_Intersects. e.g. the
 ST_ClosestPoint on a 2d line almost never intersects the 2d line.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5557#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list