[geos-devel] [ANN] Bug #87 - Strange result of isValid() for LinearRing

Mateusz Łoskot mateusz at loskot.net
Tue Apr 4 20:07:26 EDT 2006


Stephen Woodbridge wrote:
> Mateusz Łoskot wrote:
>>
>> I've reported new bug on the BT:
>>
>> http://postgis.refractions.net/bugs/bug.php?op=show&bugid=87&pos=4
>>
>> I think it may need some wider discussion.
>>
> 
> I think your test case is bad.
> 
> / 2. Add 4 points to get closed ring
> pseq->add(Coordinate(0, 0, 0));
> pseq->add(Coordinate(5, 5, 5));
> pseq->add(Coordinate(10, 10, 10));
> pseq->add(Coordinate(0, 0, 0)); // <--- [1]
> 
> The points (0,0,0), (5,5,5), (10,10,10) are all in a straight line (ie:
> they are co-linear) and then you return to the start point which falls
> on  top of the first two segments so you have a case of a collapsed ring
> where all the point of the ring fall on a single line in space.
> 
> This is indeed self intersecting. and isValid() should report it as false.

Yes, you're definitely right! It's my fault, shame on me.
It seems to be a copy-paste mistake, because I took this example from
test of LineString class and pasted to LinearRing test.
So, it's a bug in test ;-)

Thanks!
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the geos-devel mailing list