#2112 closed defect (fixed)
lw_dist3d_ptarray_poly error
Reported by: | pramsey | Owned by: | nicklas |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.2 |
Component: | postgis | Version: | 2.0.x |
Keywords: | Cc: |
Description
In measures3d.c:903, the assignment to move to the next point in the array looks to be reversed,
projp2=projp1; s2=s1; p2=p1;
should be
projp1=projp2; s1=s2; p1=p2;
Change History (5)
comment:1 by , 12 years ago
comment:3 by , 12 years ago
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.
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Indeed, but I wouldn't touch it before having found and added a failing test to the suite.