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

Sandro Santilli strk at keybit.net
Wed Jun 26 09:33:12 PDT 2013


Thank you. Slightly modified test added to the suite
(to use all integers) and fix committed.
See http://trac.osgeo.org/geos/ticket/635

--strk;

On Mon, Jun 24, 2013 at 06:23:11PM +0200, Mickael BORNE wrote:
> 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);
> >>>  }


More information about the geos-devel mailing list