[postgis-tickets] [PostGIS] #3244: ST_3DClosestPoint returns garbage in Z for 3dz-2d arg

PostGIS trac at osgeo.org
Wed Aug 19 08:44:15 PDT 2015


#3244: ST_3DClosestPoint returns garbage in Z for 3dz-2d arg
----------------------+---------------------------
  Reporter:  strk     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  high     |  Milestone:  PostGIS 2.2.0
 Component:  postgis  |    Version:  trunk
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by pramsey):

 The problem, in lw_dist3d_distanceline and lw_dist3d_distancepoint, is the
 use of FLT_MIN as the bottom of the "big vertical line". It doesn't mean
 what you think, it's the smallest value greater than zero that can be
 represented. (In fact, it's the value of Z, seen above). You want -1 *
 FLT_MAX.

 Except. I tried that fix, and unfortunately then we're constructing an
 edge that is so huge that the floating point math in your 3d seg-seg
 routine falls apart and can no longer correctly calculate the z value of
 the projection between the lines. So... there we are.

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