[postgis-tickets] [PostGIS] #4270: ST_3DIntersects says 'no' despite geometries intersecting

PostGIS trac at osgeo.org
Thu Dec 6 06:26:52 PST 2018


#4270: ST_3DIntersects says 'no' despite geometries intersecting
---------------------+---------------------------
  Reporter:  tilt    |      Owner:  colivier
      Type:  defect  |     Status:  new
  Priority:  medium  |  Milestone:  PostGIS 2.5.2
 Component:  sfcgal  |    Version:  2.5.x
Resolution:          |   Keywords:
---------------------+---------------------------

Comment (by nicklas):

 You are running this function with geos backend I goes (which means
 running it native PostGIS in this case).

 If you try with SFCGal backend it gives a hint about the problem:

 {{{

 NOTICE:  During intersects_3d(A,B) :
 NOTICE:    with A: POLYGON((4205955507539673/34359738368
 4204001555118031/8589934592
 7486962518827739/1125899906842624,8411590988476187/68719476736
 8408038706925011/17179869184
 4233629971063459/1125899906842624,2102939339582341/17179869184
 4204066099886555/8589934
 NOTICE:     and B: POLYHEDRALSURFACE(((8412156068733387/68719476736
 8408327861303247/17179869184 0/1,8412264439348199/68719476736
 8408389502673879/17179869184 0/1,8412264439348199/68719476736
 8408389502673879/17179869184 10/1,8412156068733387/68719476736 840832786


 ERROR:  Polygon is invalid : points don't lie in the same plane :
 POLYGON((4205955507539673/34359738368 4204001555118031/8589934592
 7486962518827739/1125899906842624,8411590988476187/68719476736
 8408038706925011/17179869184 4233629971063459/1125899906842624,21029

 ********** Error **********

 ERROR: Polygon is invalid : points don't lie in the same plane :
 POLYGON((4205955507539673/34359738368 4204001555118031/8589934592
 7486962518827739/1125899906842624,8411590988476187/68719476736
 8408038706925011/17179869184 4233629971063459/1125899906842624,21029
 SQL state: XX000
 }}}


 There is no real check in the postgis code if the polygon is coplanar. But
 it tries to calculate an "average plane". From the illustration you
 attached I think that calculation should manage this situation, but it is
 a little bit difficult so see what the polygons really looks like (and I
 have no good viewer by hand).
 But if for instance some part of the polygon is wrapped on the backside of
 the erst of the polygon this "average calculation" will give a very
 strange answer and the calculation will be totally wrong.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4270#comment:5>
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