[postgis-devel] [PostGIS] #2112: lw_dist3d_ptarray_poly error

PostGIS trac at osgeo.org
Wed Nov 28 13:07:35 PST 2012


#2112: lw_dist3d_ptarray_poly error
---------------------+------------------------------------------------------
 Reporter:  pramsey  |       Owner:  nicklas      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.2
Component:  postgis  |     Version:  2.0.x        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by nicklas):

 Ok, you are of course right Paul.
 Quite embarrassing mistake

 Here is an example that is failing:


 {{{
 SELECT ST_3DDistance(
  'POLYGON((1 1 1, 5 1 1,5 5 1, 1 5 1,1 1 1))'::geometry,
  'LINESTRING(0 0 2, 0 0 0,5 5 2)'::geometry)
 }}}

 should give 0 but instead gives 0.557086014531155

 and the opposite situation:

 {{{
 SELECT ST_3DDistance(
  'POLYGON((1 1 1, 5 1 1,5 5 1, 1 5 1,1 1 1))'::geometry,
  'LINESTRING(0 0 2, 0 0 0,5 5 0)'::geometry)
 }}}

 Where we should get 1 but gets 0.

 This affects the test of "if the linestring intersects the polygon".
 Not the distance-test if they don't intersect. That is why it doesn't
 always show.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2112#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-devel mailing list