[geos-commits] r3825 - in branches/3.3: . src/noding/snapround tests/unit/noding/snapround

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Jun 26 09:22:55 PDT 2013


Author: strk
Date: 2013-06-26 09:22:55 -0700 (Wed, 26 Jun 2013)
New Revision: 3825

Modified:
   branches/3.3/NEWS
   branches/3.3/src/noding/snapround/HotPixel.cpp
   branches/3.3/tests/unit/noding/snapround/HotPixelTest.cpp
Log:
Fix typo in HotPixel corners initializer

Patch by Mickael BORNE <mickael.borne at ign.fr>

Modified: branches/3.3/NEWS
===================================================================
--- branches/3.3/NEWS	2013-06-26 16:03:13 UTC (rev 3824)
+++ branches/3.3/NEWS	2013-06-26 16:22:55 UTC (rev 3825)
@@ -8,6 +8,7 @@
     - Reduce likelyhood of invalid output from snap operation (#629, #501)
     - Reduce memory fragmentation of prepared Polygon/Point intersection op
     - Fix mingw64 compile (#630)
+    - Fix bug in HotPixel constructor (#635)
 
 Changes in 3.3.8
 2013-02-28

Modified: branches/3.3/src/noding/snapround/HotPixel.cpp
===================================================================
--- branches/3.3/src/noding/snapround/HotPixel.cpp	2013-06-26 16:03:13 UTC (rev 3824)
+++ branches/3.3/src/noding/snapround/HotPixel.cpp	2013-06-26 16:22:55 UTC (rev 3825)
@@ -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);
 }
 
 bool

Modified: branches/3.3/tests/unit/noding/snapround/HotPixelTest.cpp
===================================================================
--- branches/3.3/tests/unit/noding/snapround/HotPixelTest.cpp	2013-06-26 16:03:13 UTC (rev 3824)
+++ branches/3.3/tests/unit/noding/snapround/HotPixelTest.cpp	2013-06-26 16:22:55 UTC (rev 3825)
@@ -7,6 +7,7 @@
 #include <geos/noding/snapround/HotPixel.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/Envelope.h>
+#include <geos/geom/PrecisionModel.h>
 // std
 #include <memory>
 
@@ -22,6 +23,7 @@
 
     typedef geos::geom::Coordinate Coordinate;
     typedef geos::geom::Envelope Envelope;
+    typedef geos::geom::PrecisionModel PrecisionModel;
     typedef geos::algorithm::LineIntersector LineIntersector;
     typedef geos::noding::snapround::HotPixel HotPixel;
 
@@ -89,6 +91,26 @@
 
   }
 
+  // Test intersects
+  // See http://trac.osgeo.org/geos/ticket/635
+  template<>
+  template<>
+  void object::test<3>()
+  {
+
+    double scale = 1.0;
+    Coordinate p1(0,0);
+    Coordinate p2(3,2);
+    Coordinate p3(1,1);
+
+    PrecisionModel pm(scale);
+    LineIntersector li(&pm);
+    HotPixel hp(p3, scale, li);
+
+    ensure(hp.intersects(p1,p2));
+
+  }
+
   // TODO: test addSnappedNode !
 
 



More information about the geos-commits mailing list