[geos-commits] r3826 - in trunk: src/noding/snapround tests/unit/noding/snapround

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Jun 26 09:27:20 PDT 2013


Author: strk
Date: 2013-06-26 09:27:20 -0700 (Wed, 26 Jun 2013)
New Revision: 3826

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

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

Modified: trunk/src/noding/snapround/HotPixel.cpp
===================================================================
--- trunk/src/noding/snapround/HotPixel.cpp	2013-06-26 16:22:55 UTC (rev 3825)
+++ trunk/src/noding/snapround/HotPixel.cpp	2013-06-26 16:27:20 UTC (rev 3826)
@@ -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: trunk/tests/unit/noding/snapround/HotPixelTest.cpp
===================================================================
--- trunk/tests/unit/noding/snapround/HotPixelTest.cpp	2013-06-26 16:22:55 UTC (rev 3825)
+++ trunk/tests/unit/noding/snapround/HotPixelTest.cpp	2013-06-26 16:27:20 UTC (rev 3826)
@@ -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