[postgis-tickets] [PostGIS] #4246: Undefined behaviour in define_plane

PostGIS trac at osgeo.org
Tue Nov 20 04:58:08 PST 2018


#4246: Undefined behaviour in define_plane
-------------------------+---------------------------
  Reporter:  Algunenano  |      Owner:  Algunenano
      Type:  defect      |     Status:  new
  Priority:  high        |  Milestone:  PostGIS 3.0.0
 Component:  postgis     |    Version:  trunk
Resolution:              |   Keywords:
-------------------------+---------------------------

Comment (by Algunenano):

 I've found several issues when investigating this peculiar case but the
 main one is that the polygon used (`POLYGON((0 0 0, 2 2 2, 3 3 3, 0 0
 0))`) isn't valid as it's just defining a 3d line.

 @nicklas What do you think is the proper way to handle this? I'm thinking
 about `lwerror("%s: Polygon does not define a plane", __func__);` when the
 polygon passed does not define a plane.
 It's either that or be clever or default to line to line distance, but
 then we'd ignoring possible holes so I don't really like it.

 I'm also adding a bunch of tests around the
 `lwgeom_mindistance3d_tolerance` since it appears to have several issues
 with division by zero when the geometries interect.

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