[geos-devel] Bug in src/noding/snapround/HotPixel.cpp?

Mickael BORNE mickael.borne at ign.fr
Mon Jun 24 09:23:11 PDT 2013


Here is a test case fixed by this change :

BOOST_AUTO_TEST_CASE( test_geos_HotPixel )
{
    double scale = 1.0 ;

    geos::geom::PrecisionModel pm(scale);
    geos::algorithm::LineIntersector lineIntersector(&pm) ;

    geos::geom::Coordinate p1(0.6,1.4) ;
    geos::geom::Coordinate p2(3.6, 3.4) ;
    geos::geom::Coordinate p3(2.0, 3.0) ;

    geos::noding::snapround::HotPixel hotPix1(
        p3, scale, lineIntersector
    )  ;
    BOOST_CHECK( hotPix1.intersects( p1, p2 ) ) ;
}


>> Hey Mickael, confirmed !
>> This clearly shows how the snaprounding code is in need of
>> testcases. How did you find out ? Any code we can put under
>> testsuite ?
>
>
> A member of my team (Pierre) works on a SnapRouding based on
> boost::graph and GEOS and he faced the following case :
>
> +---+
> +  /
> + / +
> +/   \
>        \
>         \
>          +
>
> I'll look for the corresponding test.
>
>>
>> --strk;
>>
>> On Fri, Jun 21, 2013 at 06:29:40PM +0200, Mickael BORNE wrote:
>>> Hi geos-devel!
>>>
>>> Could you confirm and patch the following bug in :
>>>
>>> void HotPixel::initCorners(const Coordinate& pt)
>>>
>>>
>>> A triangle is represented instead of a square :
>>>
>>>
>>> Index: src/noding/snapround/HotPixel.cpp
>>> ===================================================================
>>> --- src/noding/snapround/HotPixel.cpp    (révision 3823)
>>> +++ src/noding/snapround/HotPixel.cpp    (copie de travail)
>>> @@ -83,7 +83,7 @@
>>>       corner[0] = Coordinate(maxx, maxy);
>>>       corner[1] = Coordinate(minx, maxy);
>>>       corner[2] = Coordinate(minx, miny);
>>> -    corner[3] = Coordinate(maxx, maxy);
>>> +    corner[3] = Coordinate(maxx, miny);
>>>   }
>>>
>> _______________________________________________
>> geos-devel mailing list
>> geos-devel at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/geos-devel
>>
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>



More information about the geos-devel mailing list