[geos-commits] [SCM] geos branch master updated. 3818e56d78dde30c1849341eabe67a5b809b74e2

git at osgeo.org git at osgeo.org
Wed Oct 4 04:10:24 PDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "geos".

The branch, master has been updated
       via  3818e56d78dde30c1849341eabe67a5b809b74e2 (commit)
      from  312ef8a895c81dce85e386500e6938fe9470810e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3818e56d78dde30c1849341eabe67a5b809b74e2
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Oct 4 13:09:05 2017 +0200

    Remove line feeds from left-over files
    
    This is a style only change.
    The line feed matched th [[:space:]] character class, which
    is why it was spotted.
    
    Hopefully these are the last LF that'll ever enter the codebase

diff --git a/include/geos/noding/OrientedCoordinateArray.h b/include/geos/noding/OrientedCoordinateArray.h
index a25d85c..d8061aa 100644
--- a/include/geos/noding/OrientedCoordinateArray.h
+++ b/include/geos/noding/OrientedCoordinateArray.h
@@ -1,115 +1,115 @@
-/**********************************************************************
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.osgeo.org
- *
- * Copyright (C) 2009    Sandro Santilli <strk at kbt.io>
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Public Licence as published
- * by the Free Software Foundation. 
- * See the COPYING file for more information.
- *
- **********************************************************************
- *
- * Last port: noding/OrientedCoordinateArray.java rev. 1.1 (JTS-1.9)
- *
- **********************************************************************/
-
-#ifndef GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
-#define GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
-
-#include <geos/export.h>
-
-//#include <vector>
-//#include <iostream>
-
-//#include <geos/inline.h>
-
-// Forward declarations
-namespace geos {
-	namespace geom {
-		class CoordinateSequence;
-	}
-	namespace noding {
-		//class SegmentString;
-	}
-}
-
-namespace geos {
-namespace noding { // geos.noding
-
-/** \brief
- * Allows comparing {@link geom::CoordinateSequence}s
- * in an orientation-independent way.
- */
-class GEOS_DLL OrientedCoordinateArray
-{
-public:
-
-	/**
-	 * Creates a new {@link OrientedCoordinateArray}
-	 * for the given {@link geom::CoordinateSequence}.
-	 *
-	 * @param pts the coordinates to orient
-	 */
-	OrientedCoordinateArray(const geom::CoordinateSequence& pts)
-		:
-		pts(&pts),
-		orientationVar(orientation(pts))
-	{
-	}
-
-	/** \brief
-	 * Compares two {@link OrientedCoordinateArray}s for their
-	 * relative order
-	 *
-	 * @return -1 this one is smaller
-	 * @return 0 the two objects are equal
-	 * @return 1 this one is greater
-	 *
-	 * In JTS, this is used automatically by ordered lists.
-	 * In C++, operator< would be used instead....
-	 */
-	int compareTo(const OrientedCoordinateArray& o1) const;
-
-
-private:
-
-	static int compareOriented(const geom::CoordinateSequence& pts1,
-                                     bool orientation1,
-                                     const geom::CoordinateSequence& pts2,
-                                     bool orientation2);
-
-
-	/**
-	 * Computes the canonical orientation for a coordinate array.
-	 *
-	 * @param pts the array to test
-	 * @return <code>true</code> if the points are oriented forwards
-	 * @return <code>false</code if the points are oriented in reverse
-	 */
-	static bool orientation(const geom::CoordinateSequence& pts);
-
-	/// Externally owned
-	const geom::CoordinateSequence* pts;
-
-	bool orientationVar;
-
-};
-
-/// Strict weak ordering operator for OrientedCoordinateArray
-//
-/// This is the C++ equivalent of JTS's compareTo
-inline bool operator< ( const OrientedCoordinateArray& oca1,
-                        const OrientedCoordinateArray& oca2 )
-{
-  return oca1.compareTo(oca2)<0;
-}
-
-} // namespace geos.noding
-} // namespace geos
-
-
-#endif // GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
-
+/**********************************************************************
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.osgeo.org
+ *
+ * Copyright (C) 2009    Sandro Santilli <strk at kbt.io>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: noding/OrientedCoordinateArray.java rev. 1.1 (JTS-1.9)
+ *
+ **********************************************************************/
+
+#ifndef GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
+#define GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
+
+#include <geos/export.h>
+
+//#include <vector>
+//#include <iostream>
+
+//#include <geos/inline.h>
+
+// Forward declarations
+namespace geos {
+	namespace geom {
+		class CoordinateSequence;
+	}
+	namespace noding {
+		//class SegmentString;
+	}
+}
+
+namespace geos {
+namespace noding { // geos.noding
+
+/** \brief
+ * Allows comparing {@link geom::CoordinateSequence}s
+ * in an orientation-independent way.
+ */
+class GEOS_DLL OrientedCoordinateArray
+{
+public:
+
+	/**
+	 * Creates a new {@link OrientedCoordinateArray}
+	 * for the given {@link geom::CoordinateSequence}.
+	 *
+	 * @param pts the coordinates to orient
+	 */
+	OrientedCoordinateArray(const geom::CoordinateSequence& pts)
+		:
+		pts(&pts),
+		orientationVar(orientation(pts))
+	{
+	}
+
+	/** \brief
+	 * Compares two {@link OrientedCoordinateArray}s for their
+	 * relative order
+	 *
+	 * @return -1 this one is smaller
+	 * @return 0 the two objects are equal
+	 * @return 1 this one is greater
+	 *
+	 * In JTS, this is used automatically by ordered lists.
+	 * In C++, operator< would be used instead....
+	 */
+	int compareTo(const OrientedCoordinateArray& o1) const;
+
+
+private:
+
+	static int compareOriented(const geom::CoordinateSequence& pts1,
+                                     bool orientation1,
+                                     const geom::CoordinateSequence& pts2,
+                                     bool orientation2);
+
+
+	/**
+	 * Computes the canonical orientation for a coordinate array.
+	 *
+	 * @param pts the array to test
+	 * @return <code>true</code> if the points are oriented forwards
+	 * @return <code>false</code if the points are oriented in reverse
+	 */
+	static bool orientation(const geom::CoordinateSequence& pts);
+
+	/// Externally owned
+	const geom::CoordinateSequence* pts;
+
+	bool orientationVar;
+
+};
+
+/// Strict weak ordering operator for OrientedCoordinateArray
+//
+/// This is the C++ equivalent of JTS's compareTo
+inline bool operator< ( const OrientedCoordinateArray& oca1,
+                        const OrientedCoordinateArray& oca2 )
+{
+  return oca1.compareTo(oca2)<0;
+}
+
+} // namespace geos.noding
+} // namespace geos
+
+
+#endif // GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
+
diff --git a/src/noding/OrientedCoordinateArray.cpp b/src/noding/OrientedCoordinateArray.cpp
index 88d5cc7..98fb474 100644
--- a/src/noding/OrientedCoordinateArray.cpp
+++ b/src/noding/OrientedCoordinateArray.cpp
@@ -1,98 +1,98 @@
-/**********************************************************************
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.osgeo.org
- *
- * Copyright (C) 2009    Sandro Santilli <strk at kbt.io>
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Public Licence as published
- * by the Free Software Foundation. 
- * See the COPYING file for more information.
- *
- **********************************************************************
- *
- * Last port: noding/OrientedCoordinateArray.java rev. 1.1 (JTS-1.9)
- *
- **********************************************************************/
-
-//#include <cmath>
-//#include <sstream>
-
-#include <geos/noding/OrientedCoordinateArray.h>
-
-//#include <geos/util/IllegalArgumentException.h>
-//#include <geos/noding/Octant.h>
-//#include <geos/geom/Coordinate.h>
-#include <geos/geom/CoordinateSequence.h>
-
-//using namespace std;
-using namespace geos::geom;
-
-#ifdef _MSC_VER
-#pragma warning(disable : 4127)
-#endif
-
-namespace geos {
-namespace noding { // geos.noding
-
-/* private static */
-bool
-OrientedCoordinateArray::orientation(const CoordinateSequence& pts)
-{
-	return CoordinateSequence::increasingDirection(pts) == 1;
-}
-
-int
-OrientedCoordinateArray::compareTo(const OrientedCoordinateArray& oca) const
-{
-	int comp = compareOriented(*pts, orientationVar,
-                               *oca.pts, oca.orientationVar);
-#if 0 // MD - testing only
-    int oldComp = SegmentStringDissolver.ptsComp.compare(pts, oca.pts);
-    if ((oldComp == 0 || comp == 0) && oldComp != comp) {
-      System.out.println("bidir mismatch");
-
-      boolean orient1 = orientation(pts);
-      boolean orient2 = orientation(oca.pts);
-      int comp2 = compareOriented(pts, orientation,
-                               oca.pts, oca.orientation);
-      int oldComp2 = SegmentStringDissolver.ptsComp.compare(pts, oca.pts);
-    }
-#endif
-
-	return comp;
-}
-
-/* private static */
-int
-OrientedCoordinateArray::compareOriented(const geom::CoordinateSequence& pts1,
-                                     bool orientation1,
-                                     const geom::CoordinateSequence& pts2,
-                                     bool orientation2)
-{
-    int dir1 = orientation1 ? 1 : -1;
-    int dir2 = orientation2 ? 1 : -1;
-    int limit1 = orientation1 ? pts1.size() : -1;
-    int limit2 = orientation2 ? pts2.size() : -1;
-
-    int i1 = orientation1 ? 0 : pts1.size() - 1;
-    int i2 = orientation2 ? 0 : pts2.size() - 1;
-    //int comp = 0; // unused, but is in JTS ...
-    while (true) {
-      int compPt = pts1[i1].compareTo(pts2[i2]);
-      if (compPt != 0)
-        return compPt;
-      i1 += dir1;
-      i2 += dir2;
-      bool done1 = i1 == limit1;
-      bool done2 = i2 == limit2;
-      if (done1 && ! done2) return -1;
-      if (! done1 && done2) return 1;
-      if (done1 && done2) return 0;
-    }
-}
-
-} // namespace geos.noding
-} // namespace geos
-
+/**********************************************************************
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.osgeo.org
+ *
+ * Copyright (C) 2009    Sandro Santilli <strk at kbt.io>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: noding/OrientedCoordinateArray.java rev. 1.1 (JTS-1.9)
+ *
+ **********************************************************************/
+
+//#include <cmath>
+//#include <sstream>
+
+#include <geos/noding/OrientedCoordinateArray.h>
+
+//#include <geos/util/IllegalArgumentException.h>
+//#include <geos/noding/Octant.h>
+//#include <geos/geom/Coordinate.h>
+#include <geos/geom/CoordinateSequence.h>
+
+//using namespace std;
+using namespace geos::geom;
+
+#ifdef _MSC_VER
+#pragma warning(disable : 4127)
+#endif
+
+namespace geos {
+namespace noding { // geos.noding
+
+/* private static */
+bool
+OrientedCoordinateArray::orientation(const CoordinateSequence& pts)
+{
+	return CoordinateSequence::increasingDirection(pts) == 1;
+}
+
+int
+OrientedCoordinateArray::compareTo(const OrientedCoordinateArray& oca) const
+{
+	int comp = compareOriented(*pts, orientationVar,
+                               *oca.pts, oca.orientationVar);
+#if 0 // MD - testing only
+    int oldComp = SegmentStringDissolver.ptsComp.compare(pts, oca.pts);
+    if ((oldComp == 0 || comp == 0) && oldComp != comp) {
+      System.out.println("bidir mismatch");
+
+      boolean orient1 = orientation(pts);
+      boolean orient2 = orientation(oca.pts);
+      int comp2 = compareOriented(pts, orientation,
+                               oca.pts, oca.orientation);
+      int oldComp2 = SegmentStringDissolver.ptsComp.compare(pts, oca.pts);
+    }
+#endif
+
+	return comp;
+}
+
+/* private static */
+int
+OrientedCoordinateArray::compareOriented(const geom::CoordinateSequence& pts1,
+                                     bool orientation1,
+                                     const geom::CoordinateSequence& pts2,
+                                     bool orientation2)
+{
+    int dir1 = orientation1 ? 1 : -1;
+    int dir2 = orientation2 ? 1 : -1;
+    int limit1 = orientation1 ? pts1.size() : -1;
+    int limit2 = orientation2 ? pts2.size() : -1;
+
+    int i1 = orientation1 ? 0 : pts1.size() - 1;
+    int i2 = orientation2 ? 0 : pts2.size() - 1;
+    //int comp = 0; // unused, but is in JTS ...
+    while (true) {
+      int compPt = pts1[i1].compareTo(pts2[i2]);
+      if (compPt != 0)
+        return compPt;
+      i1 += dir1;
+      i2 += dir2;
+      bool done1 = i1 == limit1;
+      bool done2 = i2 == limit2;
+      if (done1 && ! done2) return -1;
+      if (! done1 && done2) return 1;
+      if (done1 && done2) return 0;
+    }
+}
+
+} // namespace geos.noding
+} // namespace geos
+
diff --git a/tests/unit/capi/GEOSConvexHullTest.cpp b/tests/unit/capi/GEOSConvexHullTest.cpp
index d557ead..18b7fc3 100644
--- a/tests/unit/capi/GEOSConvexHullTest.cpp
+++ b/tests/unit/capi/GEOSConvexHullTest.cpp
@@ -1,81 +1,81 @@
-// 
-// Test Suite for C-API GEOSConvexHull
-
-#include <tut/tut.hpp>
-// geos
-#include <geos_c.h>
-// std
-#include <cstdarg>
-#include <cstdio>
-#include <cstdlib>
-
-namespace tut
-{
-    //
-    // Test Group
-    //
-
-    // Common data used in test cases.
-    struct test_capigeosconvexhull_data
-    {
-        GEOSGeometry* input_;
-        GEOSGeometry* expected_;
-
-        static void notice(const char *fmt, ...)
-        {
-            std::fprintf( stdout, "NOTICE: ");
-
-            va_list ap;
-            va_start(ap, fmt);
-            std::vfprintf(stdout, fmt, ap);
-            va_end(ap);
-        
-            std::fprintf(stdout, "\n");
-        }
-
-        test_capigeosconvexhull_data()
-            : input_(nullptr), expected_(nullptr)
-        {
-            initGEOS(notice, notice);
-        }       
-
-        ~test_capigeosconvexhull_data()
-        {
-            GEOSGeom_destroy(input_);
-            GEOSGeom_destroy(expected_);
-            input_ = nullptr;
-            expected_ = nullptr;
-            finishGEOS();
-        }
-
-    };
-
-    typedef test_group<test_capigeosconvexhull_data> group;
-    typedef group::object object;
-
-    group test_capigeosconvexhull_group("capi::GEOSConvexHull");
-
-    //
-    // Test Cases
-    //
-
-    template<>
-    template<>
-    void object::test<1>()
-    {
-        input_ = GEOSGeomFromWKT("MULTIPOINT (130 240, 130 240, 130 240, 570 240, 570 240, 570 240, 650 240)");
-        ensure( nullptr != input_ );
-
-        expected_ = GEOSGeomFromWKT("LINESTRING (130 240, 650 240, 130 240)");   
-        ensure( nullptr != expected_ );
-
-        GEOSGeometry* output = GEOSConvexHull(input_);
-        ensure( nullptr != output );
-        ensure( 0 == GEOSisEmpty(output) );
-        // TODO
-        //ensure( 0 != GEOSEquals(output, expected_));
-        GEOSGeom_destroy(output);
-    }
- 
-} // namespace tut
-
+//
+// Test Suite for C-API GEOSConvexHull
+
+#include <tut/tut.hpp>
+// geos
+#include <geos_c.h>
+// std
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+
+namespace tut
+{
+    //
+    // Test Group
+    //
+
+    // Common data used in test cases.
+    struct test_capigeosconvexhull_data
+    {
+        GEOSGeometry* input_;
+        GEOSGeometry* expected_;
+
+        static void notice(const char *fmt, ...)
+        {
+            std::fprintf( stdout, "NOTICE: ");
+
+            va_list ap;
+            va_start(ap, fmt);
+            std::vfprintf(stdout, fmt, ap);
+            va_end(ap);
+
+            std::fprintf(stdout, "\n");
+        }
+
+        test_capigeosconvexhull_data()
+            : input_(nullptr), expected_(nullptr)
+        {
+            initGEOS(notice, notice);
+        }
+
+        ~test_capigeosconvexhull_data()
+        {
+            GEOSGeom_destroy(input_);
+            GEOSGeom_destroy(expected_);
+            input_ = nullptr;
+            expected_ = nullptr;
+            finishGEOS();
+        }
+
+    };
+
+    typedef test_group<test_capigeosconvexhull_data> group;
+    typedef group::object object;
+
+    group test_capigeosconvexhull_group("capi::GEOSConvexHull");
+
+    //
+    // Test Cases
+    //
+
+    template<>
+    template<>
+    void object::test<1>()
+    {
+        input_ = GEOSGeomFromWKT("MULTIPOINT (130 240, 130 240, 130 240, 570 240, 570 240, 570 240, 650 240)");
+        ensure( nullptr != input_ );
+
+        expected_ = GEOSGeomFromWKT("LINESTRING (130 240, 650 240, 130 240)");
+        ensure( nullptr != expected_ );
+
+        GEOSGeometry* output = GEOSConvexHull(input_);
+        ensure( nullptr != output );
+        ensure( 0 == GEOSisEmpty(output) );
+        // TODO
+        //ensure( 0 != GEOSEquals(output, expected_));
+        GEOSGeom_destroy(output);
+    }
+
+} // namespace tut
+
diff --git a/tests/unit/capi/GEOSIntersectionTest.cpp b/tests/unit/capi/GEOSIntersectionTest.cpp
index 3d4a83e..6c51ab2 100644
--- a/tests/unit/capi/GEOSIntersectionTest.cpp
+++ b/tests/unit/capi/GEOSIntersectionTest.cpp
@@ -1,142 +1,142 @@
-// 
-// Test Suite for C-API GEOSintersection
-
-#include <tut/tut.hpp>
-// geos
-#include <geos_c.h>
-// std
-#include <cstdarg>
-#include <cstdio>
-#include <cstdlib>
-
-namespace tut
-{
-	//
-	// Test Group
-	//
-
-	// Common data used in test cases.
-	struct test_capigeosintersection_data
-	{
-		GEOSWKTWriter* wktw_;
-		GEOSGeometry* geom1_;
-		GEOSGeometry* geom2_;
-		GEOSGeometry* geom3_;
-
-		static void notice(const char *fmt, ...)
-		{
-			std::fprintf(stdout, "NOTICE: ");
-
-			va_list ap;
-			va_start(ap, fmt);
-			std::vfprintf(stdout, fmt, ap);
-			va_end(ap);
-
-			std::fprintf(stdout, "\n");
-		}
-
-		test_capigeosintersection_data()
-			: geom1_(nullptr), geom2_(nullptr), geom3_(nullptr)
-		{
-			initGEOS(notice, notice);
-			wktw_ = GEOSWKTWriter_create();
-			GEOSWKTWriter_setTrim(wktw_, 1);
-			GEOSWKTWriter_setOutputDimension(wktw_, 3);
-		}
-
-		std::string toWKT(GEOSGeometry* g)
-		{
-			char* wkt = GEOSWKTWriter_write(wktw_, g);
-			std::string ret(wkt);
-			GEOSFree(wkt);
-			return ret;
-		}
-
-		~test_capigeosintersection_data()
-		{
-			GEOSWKTWriter_destroy(wktw_);
-			GEOSGeom_destroy(geom1_);
-			GEOSGeom_destroy(geom2_);
-			GEOSGeom_destroy(geom3_);
-			geom1_ = nullptr;
-			geom2_ = nullptr;
-			geom3_ = nullptr;
-			finishGEOS();
-		}
-
-	};
-
-	typedef test_group<test_capigeosintersection_data> group;
-	typedef group::object object;
-
-	group test_capigeosintersection_group("capi::GEOSIntersection");
-
-	//
-	// Test Cases
-	//
-
-	template<>
-	template<>
-	void object::test<1>()
-	{
-		geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
-		geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
-
-		ensure(nullptr != geom1_);
-		ensure(nullptr != geom2_);
-
-		geom3_ = GEOSIntersection(geom1_, geom2_);
-		ensure(nullptr != geom3_);
-		ensure_equals(toWKT(geom3_), std::string("GEOMETRYCOLLECTION EMPTY"));
-	}
-
-	template<>
-	template<>
-	void object::test<2>()
-	{
-		geom1_ = GEOSGeomFromWKT("POLYGON((1 1,1 5,5 5,5 1,1 1))");
-		geom2_ = GEOSGeomFromWKT("POINT(2 2)");
-
-		ensure(nullptr != geom1_);
-		ensure(nullptr != geom2_);
-
-		geom3_ = GEOSIntersection(geom1_, geom2_);
-		ensure(nullptr != geom3_);
-		ensure_equals(toWKT(geom3_), std::string("POINT (2 2)"));
-	}
-
-	template<>
-	template<>
-	void object::test<3>()
-	{
-		geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
-		geom2_ = GEOSGeomFromWKT("POLYGON((-1 1,-1 2,2 2,2 1,-1 1))");
-
-		ensure(nullptr != geom1_);
-		ensure(nullptr != geom2_);
-
-		geom3_ = GEOSIntersection(geom1_, geom2_);
-
-		ensure(nullptr != geom3_);
-		ensure_equals(toWKT(geom3_), std::string("POLYGON ((0 1, 0 2, 2 2, 2 1, 0 1))"));
-	}
-
-  /* See http://trac.osgeo.org/geos/ticket/719 */
-	template<>
-	template<>
-	void object::test<4>()
-	{
-		geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,5 10,10 0,0 0),(1 1,1 2,2 2,2 1,1 1),(100 100,100 102,102 102,102 100,100 100)))");
-		geom2_ = GEOSGeomFromWKT("POLYGON((0 1,0 2,10 2,10 1,0 1))");
-
-		ensure(nullptr != geom1_);
-		ensure(nullptr != geom2_);
-
-		geom3_ = GEOSIntersection(geom1_, geom2_);
-
-		ensure(nullptr != geom3_);
-		ensure_equals(toWKT(geom3_), std::string("GEOMETRYCOLLECTION (LINESTRING (1 2, 2 2), LINESTRING (2 1, 1 1), POLYGON ((0.5 1, 1 2, 1 1, 0.5 1)), POLYGON ((9 2, 9.5 1, 2 1, 2 2, 9 2)))"));
-	}
-
-} // namespace tut
-
+//
+// Test Suite for C-API GEOSintersection
+
+#include <tut/tut.hpp>
+// geos
+#include <geos_c.h>
+// std
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+
+namespace tut
+{
+	//
+	// Test Group
+	//
+
+	// Common data used in test cases.
+	struct test_capigeosintersection_data
+	{
+		GEOSWKTWriter* wktw_;
+		GEOSGeometry* geom1_;
+		GEOSGeometry* geom2_;
+		GEOSGeometry* geom3_;
+
+		static void notice(const char *fmt, ...)
+		{
+			std::fprintf(stdout, "NOTICE: ");
+
+			va_list ap;
+			va_start(ap, fmt);
+			std::vfprintf(stdout, fmt, ap);
+			va_end(ap);
+
+			std::fprintf(stdout, "\n");
+		}
+
+		test_capigeosintersection_data()
+			: geom1_(nullptr), geom2_(nullptr), geom3_(nullptr)
+		{
+			initGEOS(notice, notice);
+			wktw_ = GEOSWKTWriter_create();
+			GEOSWKTWriter_setTrim(wktw_, 1);
+			GEOSWKTWriter_setOutputDimension(wktw_, 3);
+		}
+
+		std::string toWKT(GEOSGeometry* g)
+		{
+			char* wkt = GEOSWKTWriter_write(wktw_, g);
+			std::string ret(wkt);
+			GEOSFree(wkt);
+			return ret;
+		}
+
+		~test_capigeosintersection_data()
+		{
+			GEOSWKTWriter_destroy(wktw_);
+			GEOSGeom_destroy(geom1_);
+			GEOSGeom_destroy(geom2_);
+			GEOSGeom_destroy(geom3_);
+			geom1_ = nullptr;
+			geom2_ = nullptr;
+			geom3_ = nullptr;
+			finishGEOS();
+		}
+
+	};
+
+	typedef test_group<test_capigeosintersection_data> group;
+	typedef group::object object;
+
+	group test_capigeosintersection_group("capi::GEOSIntersection");
+
+	//
+	// Test Cases
+	//
+
+	template<>
+	template<>
+	void object::test<1>()
+	{
+		geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
+		geom2_ = GEOSGeomFromWKT("POLYGON EMPTY");
+
+		ensure(nullptr != geom1_);
+		ensure(nullptr != geom2_);
+
+		geom3_ = GEOSIntersection(geom1_, geom2_);
+		ensure(nullptr != geom3_);
+		ensure_equals(toWKT(geom3_), std::string("GEOMETRYCOLLECTION EMPTY"));
+	}
+
+	template<>
+	template<>
+	void object::test<2>()
+	{
+		geom1_ = GEOSGeomFromWKT("POLYGON((1 1,1 5,5 5,5 1,1 1))");
+		geom2_ = GEOSGeomFromWKT("POINT(2 2)");
+
+		ensure(nullptr != geom1_);
+		ensure(nullptr != geom2_);
+
+		geom3_ = GEOSIntersection(geom1_, geom2_);
+		ensure(nullptr != geom3_);
+		ensure_equals(toWKT(geom3_), std::string("POINT (2 2)"));
+	}
+
+	template<>
+	template<>
+	void object::test<3>()
+	{
+		geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
+		geom2_ = GEOSGeomFromWKT("POLYGON((-1 1,-1 2,2 2,2 1,-1 1))");
+
+		ensure(nullptr != geom1_);
+		ensure(nullptr != geom2_);
+
+		geom3_ = GEOSIntersection(geom1_, geom2_);
+
+		ensure(nullptr != geom3_);
+		ensure_equals(toWKT(geom3_), std::string("POLYGON ((0 1, 0 2, 2 2, 2 1, 0 1))"));
+	}
+
+  /* See http://trac.osgeo.org/geos/ticket/719 */
+	template<>
+	template<>
+	void object::test<4>()
+	{
+		geom1_ = GEOSGeomFromWKT("MULTIPOLYGON(((0 0,5 10,10 0,0 0),(1 1,1 2,2 2,2 1,1 1),(100 100,100 102,102 102,102 100,100 100)))");
+		geom2_ = GEOSGeomFromWKT("POLYGON((0 1,0 2,10 2,10 1,0 1))");
+
+		ensure(nullptr != geom1_);
+		ensure(nullptr != geom2_);
+
+		geom3_ = GEOSIntersection(geom1_, geom2_);
+
+		ensure(nullptr != geom3_);
+		ensure_equals(toWKT(geom3_), std::string("GEOMETRYCOLLECTION (LINESTRING (1 2, 2 2), LINESTRING (2 1, 1 1), POLYGON ((0.5 1, 1 2, 1 1, 0.5 1)), POLYGON ((9 2, 9.5 1, 2 1, 2 2, 9 2)))"));
+	}
+
+} // namespace tut
+
diff --git a/tests/unit/capi/GEOSisClosedTest.cpp b/tests/unit/capi/GEOSisClosedTest.cpp
index 9338688..1fcdf93 100644
--- a/tests/unit/capi/GEOSisClosedTest.cpp
+++ b/tests/unit/capi/GEOSisClosedTest.cpp
@@ -1,95 +1,95 @@
-// 
-// Test Suite for C-API GEOSisClosed
-
-#include <tut/tut.hpp>
-// geos
-#include <geos_c.h>
-// std
-#include <cctype>
-#include <cstdarg>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
-namespace tut
-{
-    //
-    // Test Group
-    //
-
-    // Common data used in test cases.
-    struct test_capiisclosed_data
-    {
-        GEOSGeometry* geom_;
-
-        static void notice(const char *fmt, ...)
-        {
-            std::fprintf( stdout, "NOTICE: ");
-
-            va_list ap;
-            va_start(ap, fmt);
-            std::vfprintf(stdout, fmt, ap);
-            va_end(ap);
-
-            std::fprintf(stdout, "\n");
-        }
-
-        test_capiisclosed_data() : geom_(nullptr)
-        {
-            initGEOS(notice, notice);
-        }
-
-        ~test_capiisclosed_data()
-        {
-            GEOSGeom_destroy(geom_);
-            finishGEOS();
-        }
-
-    };
-
-    typedef test_group<test_capiisclosed_data> group;
-    typedef group::object object;
-
-    group test_capiisclosed_group("capi::GEOSisClosed");
-
-    //
-    // Test Cases
-    //
-
-    template<>
-    template<>
-    void object::test<1>()
-    {
-        geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 1 0, 1 1)");
-        int r = GEOSisClosed(geom_);
-        ensure_equals(r, 0);
-    }
-
-    template<>
-    template<>
-    void object::test<2>()
-    {
-        geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 0 1, 1 1, 0 0)");
-        int r = GEOSisClosed(geom_);
-        ensure_equals(r, 1);
-    }
-
-    template<>
-    template<>
-    void object::test<3>()
-    {
-        geom_ = GEOSGeomFromWKT("MULTILINESTRING ((1 1, 1 2, 2 2, 1 1), (0 0, 0 1, 1 1))");
-        int r = GEOSisClosed(geom_);
-        ensure_equals(r, 0);
-    }
-
-    template<>
-    template<>
-    void object::test<4>()
-    {
-        geom_ = GEOSGeomFromWKT("MULTILINESTRING ((1 1, 1 2, 2 2, 1 1), (0 0, 0 1, 1 1, 0 0))");
-        int r = GEOSisClosed(geom_);
-        ensure_equals(r, 1);
-    }
-
-} // namespace tut
+//
+// Test Suite for C-API GEOSisClosed
+
+#include <tut/tut.hpp>
+// geos
+#include <geos_c.h>
+// std
+#include <cctype>
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+namespace tut
+{
+    //
+    // Test Group
+    //
+
+    // Common data used in test cases.
+    struct test_capiisclosed_data
+    {
+        GEOSGeometry* geom_;
+
+        static void notice(const char *fmt, ...)
+        {
+            std::fprintf( stdout, "NOTICE: ");
+
+            va_list ap;
+            va_start(ap, fmt);
+            std::vfprintf(stdout, fmt, ap);
+            va_end(ap);
+
+            std::fprintf(stdout, "\n");
+        }
+
+        test_capiisclosed_data() : geom_(nullptr)
+        {
+            initGEOS(notice, notice);
+        }
+
+        ~test_capiisclosed_data()
+        {
+            GEOSGeom_destroy(geom_);
+            finishGEOS();
+        }
+
+    };
+
+    typedef test_group<test_capiisclosed_data> group;
+    typedef group::object object;
+
+    group test_capiisclosed_group("capi::GEOSisClosed");
+
+    //
+    // Test Cases
+    //
+
+    template<>
+    template<>
+    void object::test<1>()
+    {
+        geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 1 0, 1 1)");
+        int r = GEOSisClosed(geom_);
+        ensure_equals(r, 0);
+    }
+
+    template<>
+    template<>
+    void object::test<2>()
+    {
+        geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 0 1, 1 1, 0 0)");
+        int r = GEOSisClosed(geom_);
+        ensure_equals(r, 1);
+    }
+
+    template<>
+    template<>
+    void object::test<3>()
+    {
+        geom_ = GEOSGeomFromWKT("MULTILINESTRING ((1 1, 1 2, 2 2, 1 1), (0 0, 0 1, 1 1))");
+        int r = GEOSisClosed(geom_);
+        ensure_equals(r, 0);
+    }
+
+    template<>
+    template<>
+    void object::test<4>()
+    {
+        geom_ = GEOSGeomFromWKT("MULTILINESTRING ((1 1, 1 2, 2 2, 1 1), (0 0, 0 1, 1 1, 0 0))");
+        int r = GEOSisClosed(geom_);
+        ensure_equals(r, 1);
+    }
+
+} // namespace tut
diff --git a/tests/unit/geom/Geometry/touchesTest.cpp b/tests/unit/geom/Geometry/touchesTest.cpp
index ee65382..3e23c4a 100644
--- a/tests/unit/geom/Geometry/touchesTest.cpp
+++ b/tests/unit/geom/Geometry/touchesTest.cpp
@@ -1,166 +1,166 @@
-//
-// Test Suite for Geometry's touches() functions
-
-// tut
-#include <tut/tut.hpp>
-// geos
-#include <geos/geom/GeometryFactory.h>
-#include <geos/geom/Geometry.h>
-#include <geos/io/WKTReader.h>
-#include <geos/io/WKBReader.h>
-// std
-#include <sstream>
-#include <memory>
-
-namespace tut {
-
-//
-// Test Group
-//
-
-struct test_touches_data
-{
-    typedef std::unique_ptr<geos::geom::Geometry> GeomPtr;
-    typedef geos::geom::GeometryFactory GeometryFactory;
-
-    geos::geom::GeometryFactory::Ptr factory;
-    geos::io::WKTReader reader;
-    geos::io::WKBReader breader;
-
-    test_touches_data()
-        : factory(GeometryFactory::create())
-        , reader(factory.get())
-        , breader(*factory.get())
-    {}
-};
-
-typedef test_group<test_touches_data> group;
-typedef group::object object;
-
-group test_touches_data("geos::geom::Geometry::touches");
-
-//
-// Test Cases
-//
-
-// 1 - Point/Point do not touch
-template<>
-template<>
-void object::test<1>()
-{
-    GeomPtr g1(reader.read(
-        "POINT (0 0)"
-        ));
-
-    GeomPtr g2(reader.read(
-        "POINT (0 0)"
-        ));
-
-    ensure(!g1->touches(g2.get()));
-    ensure(!g2->touches(g1.get()));
-}
-
-// 2 - Line/Point do not touch if point is not on boundary
-template<>
-template<>
-void object::test<2>()
-{
-    GeomPtr g1(reader.read(
-        "LINESTRING(0 0, 1 1, 0 2)"
-        ));
-
-    GeomPtr g2(reader.read(
-        "POINT (1 1)"
-        ));
-
-    ensure(!g1->touches(g2.get()));
-    ensure(!g2->touches(g1.get()));
-}
-
-// 3 - Line/Point touch
-template<>
-template<>
-void object::test<3>()
-{
-    GeomPtr g1(reader.read(
-        "LINESTRING(0 0, 1 1, 0 2)"
-        ));
-
-    GeomPtr g2(reader.read(
-        "POINT (0 2)"
-        ));
-
-    ensure(g1->touches(g2.get()));
-    ensure(g2->touches(g1.get()));
-}
-
-// 4 - Line/Point touch (FP coordinates)
-template<>
-template<>
-void object::test<4>()
-{
-    GeomPtr g1(reader.read(
-        "LINESTRING (-612844.96290006 279079.117329031,-257704.820935236 574364.179187424)"
-        ));
-
-    GeomPtr g2(reader.read(
-        "POINT (-257704.820935236 574364.179187424)"
-        ));
-
-    ensure(g1->touches(g2.get()));
-    ensure(g2->touches(g1.get()));
-}
-
-template<>
-template<>
-void object::test<5>()
-{
-    // Two T-like segments, A (horizontal), B (vertical)
-    // A: LINESTRING(-3511.75501903694 4257.47493284327,-877.546556856658 4257.47493284327)
-    // B: LINESTRING(-2119.81532027122 4257.47493284327,-2119.81532027122 2326.7198668134)
-    std::stringstream wkbA("01020000000200000010efda91826fabc0a8e5329579a1b040008633595f6c8bc0a8e5329579a1b040");
-    std::stringstream wkbB("0102000000020000005999a871a18fa0c0a8e5329579a1b0405999a871a18fa0c0180a6292702da240");
-    GeomPtr a(breader.readHEX(wkbA));
-    GeomPtr b(breader.readHEX(wkbB));
-
-    ensure(a->touches(b.get()));
-    ensure(!a->disjoint(b.get()));
-    ensure(a->intersects(b.get()));
-}
-
-template<>
-template<>
-void object::test<6>()
-{
-    // Two Y-like segments, A (V-part), B (|-part)
-    // A: LINESTRING(-428.533750803201 4467.01424233489,1098.10978977856 4137.73818456235,1621.95806350759 5544.64497686319)
-    // B: LINESTRING(1098.10978977856 4137.73818456235,1921.2999342099 2177.04893146225)
-    std::stringstream wkbA("010200000003000000603f483e8ac87ac092ba62a50373b1405851bb6c70289140b6d9a9f9bc29b04060a2990ed55799401226341da5a8b540");
-    std::stringstream wkbB("0102000000020000005851bb6c70289140b6d9a9f9bc29b040d019f42133059e40406c8b0d1902a140");
-    GeomPtr a(breader.readHEX(wkbA));
-    GeomPtr b(breader.readHEX(wkbB));
-
-    ensure(a->touches(b.get()));
-    ensure(!a->disjoint(b.get()));
-    ensure(a->intersects(b.get()));
-}
-
-template<>
-template<>
-void object::test<7>()
-{
-    // Two T-like two segments rotated ~55 degrees counter-clockwise; A (horizontal), B (vertical)
-    // A: LINESTRING(3343.17382004585 2521.2920827699,4959.61992183829 5125.56635787996)
-    // B: LINESTRING(4151.39687094207 3823.42922032493,6112.08612404217 2461.42370862944)
-    std::stringstream wkbA("01020000000200000098e8f0fe581eaa40ea70df8b95b2a3408c9532b39e5fb340417cd4fc9005b440");
-    std::stringstream wkbB("010200000002000000ec8455996537b040b834c4c2dbdead4086a8390c16e0b740f86456f0d83aa340");
-    GeomPtr a(breader.readHEX(wkbA));
-    GeomPtr b(breader.readHEX(wkbB));
-
-    // segments do not just touch, but intersect (float-point robustness issue likely)
-    ensure(!a->touches(b.get()));
-    ensure(!a->disjoint(b.get()));
-    ensure(a->intersects(b.get()));
-}
-
-} // namespace tut
+//
+// Test Suite for Geometry's touches() functions
+
+// tut
+#include <tut/tut.hpp>
+// geos
+#include <geos/geom/GeometryFactory.h>
+#include <geos/geom/Geometry.h>
+#include <geos/io/WKTReader.h>
+#include <geos/io/WKBReader.h>
+// std
+#include <sstream>
+#include <memory>
+
+namespace tut {
+
+//
+// Test Group
+//
+
+struct test_touches_data
+{
+    typedef std::unique_ptr<geos::geom::Geometry> GeomPtr;
+    typedef geos::geom::GeometryFactory GeometryFactory;
+
+    geos::geom::GeometryFactory::Ptr factory;
+    geos::io::WKTReader reader;
+    geos::io::WKBReader breader;
+
+    test_touches_data()
+        : factory(GeometryFactory::create())
+        , reader(factory.get())
+        , breader(*factory.get())
+    {}
+};
+
+typedef test_group<test_touches_data> group;
+typedef group::object object;
+
+group test_touches_data("geos::geom::Geometry::touches");
+
+//
+// Test Cases
+//
+
+// 1 - Point/Point do not touch
+template<>
+template<>
+void object::test<1>()
+{
+    GeomPtr g1(reader.read(
+        "POINT (0 0)"
+        ));
+
+    GeomPtr g2(reader.read(
+        "POINT (0 0)"
+        ));
+
+    ensure(!g1->touches(g2.get()));
+    ensure(!g2->touches(g1.get()));
+}
+
+// 2 - Line/Point do not touch if point is not on boundary
+template<>
+template<>
+void object::test<2>()
+{
+    GeomPtr g1(reader.read(
+        "LINESTRING(0 0, 1 1, 0 2)"
+        ));
+
+    GeomPtr g2(reader.read(
+        "POINT (1 1)"
+        ));
+
+    ensure(!g1->touches(g2.get()));
+    ensure(!g2->touches(g1.get()));
+}
+
+// 3 - Line/Point touch
+template<>
+template<>
+void object::test<3>()
+{
+    GeomPtr g1(reader.read(
+        "LINESTRING(0 0, 1 1, 0 2)"
+        ));
+
+    GeomPtr g2(reader.read(
+        "POINT (0 2)"
+        ));
+
+    ensure(g1->touches(g2.get()));
+    ensure(g2->touches(g1.get()));
+}
+
+// 4 - Line/Point touch (FP coordinates)
+template<>
+template<>
+void object::test<4>()
+{
+    GeomPtr g1(reader.read(
+        "LINESTRING (-612844.96290006 279079.117329031,-257704.820935236 574364.179187424)"
+        ));
+
+    GeomPtr g2(reader.read(
+        "POINT (-257704.820935236 574364.179187424)"
+        ));
+
+    ensure(g1->touches(g2.get()));
+    ensure(g2->touches(g1.get()));
+}
+
+template<>
+template<>
+void object::test<5>()
+{
+    // Two T-like segments, A (horizontal), B (vertical)
+    // A: LINESTRING(-3511.75501903694 4257.47493284327,-877.546556856658 4257.47493284327)
+    // B: LINESTRING(-2119.81532027122 4257.47493284327,-2119.81532027122 2326.7198668134)
+    std::stringstream wkbA("01020000000200000010efda91826fabc0a8e5329579a1b040008633595f6c8bc0a8e5329579a1b040");
+    std::stringstream wkbB("0102000000020000005999a871a18fa0c0a8e5329579a1b0405999a871a18fa0c0180a6292702da240");
+    GeomPtr a(breader.readHEX(wkbA));
+    GeomPtr b(breader.readHEX(wkbB));
+
+    ensure(a->touches(b.get()));
+    ensure(!a->disjoint(b.get()));
+    ensure(a->intersects(b.get()));
+}
+
+template<>
+template<>
+void object::test<6>()
+{
+    // Two Y-like segments, A (V-part), B (|-part)
+    // A: LINESTRING(-428.533750803201 4467.01424233489,1098.10978977856 4137.73818456235,1621.95806350759 5544.64497686319)
+    // B: LINESTRING(1098.10978977856 4137.73818456235,1921.2999342099 2177.04893146225)
+    std::stringstream wkbA("010200000003000000603f483e8ac87ac092ba62a50373b1405851bb6c70289140b6d9a9f9bc29b04060a2990ed55799401226341da5a8b540");
+    std::stringstream wkbB("0102000000020000005851bb6c70289140b6d9a9f9bc29b040d019f42133059e40406c8b0d1902a140");
+    GeomPtr a(breader.readHEX(wkbA));
+    GeomPtr b(breader.readHEX(wkbB));
+
+    ensure(a->touches(b.get()));
+    ensure(!a->disjoint(b.get()));
+    ensure(a->intersects(b.get()));
+}
+
+template<>
+template<>
+void object::test<7>()
+{
+    // Two T-like two segments rotated ~55 degrees counter-clockwise; A (horizontal), B (vertical)
+    // A: LINESTRING(3343.17382004585 2521.2920827699,4959.61992183829 5125.56635787996)
+    // B: LINESTRING(4151.39687094207 3823.42922032493,6112.08612404217 2461.42370862944)
+    std::stringstream wkbA("01020000000200000098e8f0fe581eaa40ea70df8b95b2a3408c9532b39e5fb340417cd4fc9005b440");
+    std::stringstream wkbB("010200000002000000ec8455996537b040b834c4c2dbdead4086a8390c16e0b740f86456f0d83aa340");
+    GeomPtr a(breader.readHEX(wkbA));
+    GeomPtr b(breader.readHEX(wkbB));
+
+    // segments do not just touch, but intersect (float-point robustness issue likely)
+    ensure(!a->touches(b.get()));
+    ensure(!a->disjoint(b.get()));
+    ensure(a->intersects(b.get()));
+}
+
+} // namespace tut
diff --git a/tests/unit/geom/GeometryComponentFilterTest.cpp b/tests/unit/geom/GeometryComponentFilterTest.cpp
index 9f6a220..0aa7eb4 100644
--- a/tests/unit/geom/GeometryComponentFilterTest.cpp
+++ b/tests/unit/geom/GeometryComponentFilterTest.cpp
@@ -1,95 +1,95 @@
-//
-// Test Suite for geos::geom::GeometryComponentFilter class.
-
-#include <tut/tut.hpp>
-// geos
-#include <geos/geom/Geometry.h>
-#include <geos/geom/GeometryFactory.h>
-#include <geos/geom/GeometryComponentFilter.h>
-#include <geos/io/WKTReader.h>
-// std
-#include <memory>
-#include <vector>
-
-namespace tut
-{
-
-struct test_geometrycomponentfilter_data
-{
-    typedef geos::geom::Geometry::Ptr GeometryPtr; // owner
-    typedef std::vector<geos::geom::Geometry const*> GeometryRefArray; // observer
-
-    geos::geom::GeometryFactory::Ptr gf;
-    geos::io::WKTReader reader;
-    test_geometrycomponentfilter_data()
-        : gf(geos::geom::GeometryFactory::create())
-        , reader(gf.get())
-    {
-    }
-};
-
-typedef test_group<test_geometrycomponentfilter_data> group;
-typedef group::object object;
-
-group test_geometrycomponentfilter_group("geos::geom::GeometryComponentFilter");
-
-//
-// Test Cases
-//
-
-// Split components into two categories: Lineal and all other types
-template<>
-template<>
-void object::test<1>()
-{
-    // collection of 4 geometries
-    GeometryPtr g(reader.read("GEOMETRYCOLLECTION("
-        "POINT(0 0),"
-        "LINESTRING(0 0,1 1,1 2),"
-        "POLYGON((0 0,4 0,4 4,0 4,0 0)),"
-        "MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4)))"));
-
-    struct GeometryComponentSplitter : public geos::geom::GeometryComponentFilter
-    {
-        GeometryRefArray& lineal;
-        GeometryRefArray& nonlineal;
-        GeometryComponentSplitter(GeometryRefArray& lineal, GeometryRefArray& nonlineal)
-            : lineal(lineal), nonlineal(nonlineal)
-        {
-            ensure(lineal.empty());
-            ensure(nonlineal.empty());
-        }
-        void filter_ro(geos::geom::Geometry const* g) override
-        {
-            if (dynamic_cast<geos::geom::Lineal const*>(g))
-                lineal.push_back(g);
-            else
-                nonlineal.push_back(g);
-        }
-        void filter_rw(geos::geom::Geometry*) override {}
-    };
-
-    GeometryRefArray lineal;
-    GeometryRefArray nonlineal;
-    GeometryComponentSplitter splitter(lineal, nonlineal);
-    g->apply_ro(&splitter);
-
-    // TODO: Verify the actual results
-    // lineal:
-    //   0: LineString
-    //   1: LinearRing
-    //   2: MultiLineString
-    //   3: LineString
-    //   4: LineString
-    // nonlineal:
-    //   0: GeometryCollection
-    //   1: Point
-    //   2: Polygon
-    ensure_equals(lineal.size(), 5); // TODO: Why MultiLineString is in?
-    // TODO: shouldn't be 1 for POLYGON?
-    ensure_equals(nonlineal.size(), 3);
-    // TODO: is 8 right?
-    ensure_equals(lineal.size() + nonlineal.size(), 8);
-}
-
-} // namespace tut
+//
+// Test Suite for geos::geom::GeometryComponentFilter class.
+
+#include <tut/tut.hpp>
+// geos
+#include <geos/geom/Geometry.h>
+#include <geos/geom/GeometryFactory.h>
+#include <geos/geom/GeometryComponentFilter.h>
+#include <geos/io/WKTReader.h>
+// std
+#include <memory>
+#include <vector>
+
+namespace tut
+{
+
+struct test_geometrycomponentfilter_data
+{
+    typedef geos::geom::Geometry::Ptr GeometryPtr; // owner
+    typedef std::vector<geos::geom::Geometry const*> GeometryRefArray; // observer
+
+    geos::geom::GeometryFactory::Ptr gf;
+    geos::io::WKTReader reader;
+    test_geometrycomponentfilter_data()
+        : gf(geos::geom::GeometryFactory::create())
+        , reader(gf.get())
+    {
+    }
+};
+
+typedef test_group<test_geometrycomponentfilter_data> group;
+typedef group::object object;
+
+group test_geometrycomponentfilter_group("geos::geom::GeometryComponentFilter");
+
+//
+// Test Cases
+//
+
+// Split components into two categories: Lineal and all other types
+template<>
+template<>
+void object::test<1>()
+{
+    // collection of 4 geometries
+    GeometryPtr g(reader.read("GEOMETRYCOLLECTION("
+        "POINT(0 0),"
+        "LINESTRING(0 0,1 1,1 2),"
+        "POLYGON((0 0,4 0,4 4,0 4,0 0)),"
+        "MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4)))"));
+
+    struct GeometryComponentSplitter : public geos::geom::GeometryComponentFilter
+    {
+        GeometryRefArray& lineal;
+        GeometryRefArray& nonlineal;
+        GeometryComponentSplitter(GeometryRefArray& lineal, GeometryRefArray& nonlineal)
+            : lineal(lineal), nonlineal(nonlineal)
+        {
+            ensure(lineal.empty());
+            ensure(nonlineal.empty());
+        }
+        void filter_ro(geos::geom::Geometry const* g) override
+        {
+            if (dynamic_cast<geos::geom::Lineal const*>(g))
+                lineal.push_back(g);
+            else
+                nonlineal.push_back(g);
+        }
+        void filter_rw(geos::geom::Geometry*) override {}
+    };
+
+    GeometryRefArray lineal;
+    GeometryRefArray nonlineal;
+    GeometryComponentSplitter splitter(lineal, nonlineal);
+    g->apply_ro(&splitter);
+
+    // TODO: Verify the actual results
+    // lineal:
+    //   0: LineString
+    //   1: LinearRing
+    //   2: MultiLineString
+    //   3: LineString
+    //   4: LineString
+    // nonlineal:
+    //   0: GeometryCollection
+    //   1: Point
+    //   2: Polygon
+    ensure_equals(lineal.size(), 5); // TODO: Why MultiLineString is in?
+    // TODO: shouldn't be 1 for POLYGON?
+    ensure_equals(nonlineal.size(), 3);
+    // TODO: is 8 right?
+    ensure_equals(lineal.size() + nonlineal.size(), 8);
+}
+
+} // namespace tut
diff --git a/tests/unit/geom/GeometryFilterTest.cpp b/tests/unit/geom/GeometryFilterTest.cpp
index 99afe5e..8f048bd 100644
--- a/tests/unit/geom/GeometryFilterTest.cpp
+++ b/tests/unit/geom/GeometryFilterTest.cpp
@@ -1,96 +1,96 @@
-//
-// Test Suite for geos::geom::GeometryFilter class.
-
-#include <tut/tut.hpp>
-// geos
-#include <geos/geom/Geometry.h>
-#include <geos/geom/GeometryFactory.h>
-#include <geos/geom/GeometryFilter.h>
-#include <geos/io/WKTReader.h>
-// std
-#include <memory>
-#include <vector>
-
-namespace tut
-{
-
-struct test_geometryfilter_data
-{
-    typedef geos::geom::Geometry::Ptr GeometryPtr; // owner
-    typedef std::vector<geos::geom::Geometry const*> GeometryRefArray; // observer
-
-    geos::geom::GeometryFactory::Ptr gf;
-    geos::io::WKTReader reader;
-    test_geometryfilter_data()
-        : gf(geos::geom::GeometryFactory::create())
-        , reader(gf.get())
-    {
-    }
-};
-
-typedef test_group<test_geometryfilter_data> group;
-typedef group::object object;
-
-group test_geometryfilter_group("geos::geom::GeometryFilter");
-
-//
-// Test Cases
-//
-
-// Split geometries into two categories: Lineal and all other types
-template<>
-template<>
-void object::test<1>()
-{
-    // collection of 4 geometries
-    GeometryPtr g(reader.read("GEOMETRYCOLLECTION("
-        "POINT(0 0),"
-        "LINESTRING(0 0,1 1,1 2),"
-        "POLYGON((0 0,4 0,4 4,0 4,0 0)),"
-        "MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4)))"));
-
-    struct GeometrySplitter : public geos::geom::GeometryFilter
-    {
-        GeometryRefArray& lineal;
-        GeometryRefArray& nonlineal;
-        GeometrySplitter(GeometryRefArray& lineal, GeometryRefArray& nonlineal)
-            : lineal(lineal), nonlineal(nonlineal)
-        {
-            ensure(lineal.empty());
-            ensure(nonlineal.empty());
-        }
-        void filter_ro(geos::geom::Geometry const* g) override
-        {
-            if (dynamic_cast<geos::geom::Lineal const*>(g))
-                lineal.push_back(g);
-            else
-                nonlineal.push_back(g);
-        }
-        void filter_rw(geos::geom::Geometry*) override {}
-    };
-
-    GeometryRefArray lineal;
-    GeometryRefArray nonlineal;
-    GeometrySplitter splitter(lineal, nonlineal);
-    g->apply_ro(&splitter);
-
-    // TODO: Verify the actual results
-    // lineal:
-    //   0: LineString
-    //   1: MultiLineString
-    //   2: LineString
-    //   3: LineString
-    // nonlineal:
-    //   0: GeometryCollection
-    //   1: Point
-    //   2: Polygon
-    ensure_equals(lineal.size(), 4);
-    // TODO: shouldn't be 1 for POLYGON?
-    ensure_equals(nonlineal.size(), 3);
-    // TODO: is 7, shouldn't be not 4?
-    //ensure_equals(lineal.size() + nonlineal.size(), g->getNumGeometries());
-    ensure_equals(g->getNumGeometries(), 4);
-    ensure_equals(lineal.size() + nonlineal.size(), 7);
-}
-
-} // namespace tut
+//
+// Test Suite for geos::geom::GeometryFilter class.
+
+#include <tut/tut.hpp>
+// geos
+#include <geos/geom/Geometry.h>
+#include <geos/geom/GeometryFactory.h>
+#include <geos/geom/GeometryFilter.h>
+#include <geos/io/WKTReader.h>
+// std
+#include <memory>
+#include <vector>
+
+namespace tut
+{
+
+struct test_geometryfilter_data
+{
+    typedef geos::geom::Geometry::Ptr GeometryPtr; // owner
+    typedef std::vector<geos::geom::Geometry const*> GeometryRefArray; // observer
+
+    geos::geom::GeometryFactory::Ptr gf;
+    geos::io::WKTReader reader;
+    test_geometryfilter_data()
+        : gf(geos::geom::GeometryFactory::create())
+        , reader(gf.get())
+    {
+    }
+};
+
+typedef test_group<test_geometryfilter_data> group;
+typedef group::object object;
+
+group test_geometryfilter_group("geos::geom::GeometryFilter");
+
+//
+// Test Cases
+//
+
+// Split geometries into two categories: Lineal and all other types
+template<>
+template<>
+void object::test<1>()
+{
+    // collection of 4 geometries
+    GeometryPtr g(reader.read("GEOMETRYCOLLECTION("
+        "POINT(0 0),"
+        "LINESTRING(0 0,1 1,1 2),"
+        "POLYGON((0 0,4 0,4 4,0 4,0 0)),"
+        "MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4)))"));
+
+    struct GeometrySplitter : public geos::geom::GeometryFilter
+    {
+        GeometryRefArray& lineal;
+        GeometryRefArray& nonlineal;
+        GeometrySplitter(GeometryRefArray& lineal, GeometryRefArray& nonlineal)
+            : lineal(lineal), nonlineal(nonlineal)
+        {
+            ensure(lineal.empty());
+            ensure(nonlineal.empty());
+        }
+        void filter_ro(geos::geom::Geometry const* g) override
+        {
+            if (dynamic_cast<geos::geom::Lineal const*>(g))
+                lineal.push_back(g);
+            else
+                nonlineal.push_back(g);
+        }
+        void filter_rw(geos::geom::Geometry*) override {}
+    };
+
+    GeometryRefArray lineal;
+    GeometryRefArray nonlineal;
+    GeometrySplitter splitter(lineal, nonlineal);
+    g->apply_ro(&splitter);
+
+    // TODO: Verify the actual results
+    // lineal:
+    //   0: LineString
+    //   1: MultiLineString
+    //   2: LineString
+    //   3: LineString
+    // nonlineal:
+    //   0: GeometryCollection
+    //   1: Point
+    //   2: Polygon
+    ensure_equals(lineal.size(), 4);
+    // TODO: shouldn't be 1 for POLYGON?
+    ensure_equals(nonlineal.size(), 3);
+    // TODO: is 7, shouldn't be not 4?
+    //ensure_equals(lineal.size() + nonlineal.size(), g->getNumGeometries());
+    ensure_equals(g->getNumGeometries(), 4);
+    ensure_equals(lineal.size() + nonlineal.size(), 7);
+}
+
+} // namespace tut
diff --git a/tests/unit/geom/prep/PreparedGeometry/touchesTest.cpp b/tests/unit/geom/prep/PreparedGeometry/touchesTest.cpp
index d6589ed..97c2c3b 100644
--- a/tests/unit/geom/prep/PreparedGeometry/touchesTest.cpp
+++ b/tests/unit/geom/prep/PreparedGeometry/touchesTest.cpp
@@ -1,134 +1,134 @@
-//
-// Test Suite for PreparedGeometry's touches() functions
-
-// tut
-#include <tut/tut.hpp>
-#include <utility.h>
-// geos
-#include <geos/geom/prep/PreparedGeometryFactory.h>
-#include <geos/geom/prep/PreparedGeometry.h>
-#include <geos/geom/GeometryFactory.h>
-#include <geos/geom/Geometry.h>
-#include <geos/io/WKTReader.h>
-// std
-#include <memory>
-
-using namespace geos::geom;
-
-namespace tut {
-
-//
-// Test Group
-//
-
-struct test_preparedgeometrytouches_data
-{
-    typedef std::unique_ptr<geos::geom::prep::PreparedGeometry> PrepGeomAutoPtr;
-    typedef geos::geom::GeometryFactory GeometryFactory;
-
-    geos::geom::GeometryFactory::Ptr factory;
-    geos::io::WKTReader reader;
-    GeometryPtr g1;
-    GeometryPtr g2;
-    PreparedGeometryPtr pg1;
-    PreparedGeometryPtr pg2;
-
-    test_preparedgeometrytouches_data()
-        : factory(GeometryFactory::create())
-        , reader(factory.get())
-        , g1(nullptr)
-        , g2(nullptr)
-        , pg1(nullptr)
-        , pg2(nullptr)
-    {}
-    ~test_preparedgeometrytouches_data()
-    {
-        prep::PreparedGeometryFactory::destroy(pg1);
-        prep::PreparedGeometryFactory::destroy(pg2);
-        factory->destroyGeometry(g1);
-        factory->destroyGeometry(g2);
-    }
-};
-
-typedef test_group<test_preparedgeometrytouches_data> group;
-typedef group::object object;
-
-group test_preparedgeometrytouches_data("geos::geom::prep::PreparedGeometry::touches");
-
-//
-// Test Cases
-//
-
-// 1 - Point/Point do not touch
-template<>
-template<>
-void object::test<1>()
-{
-    g1 = reader.read(
-        "POINT (0 0)"
-        );
-    g2 = reader.read(
-        "POINT (0 0)"
-        );
-    pg1 = prep::PreparedGeometryFactory::prepare(g1);
-    pg2 = prep::PreparedGeometryFactory::prepare(g2);
-
-    ensure(!pg1->touches(g2));
-    ensure(!pg2->touches(g1));
-}
-
-// 2 - Line/Point do not touch if point is not on boundary
-template<>
-template<>
-void object::test<2>()
-{
-    g1 = reader.read(
-        "LINESTRING(0 0, 1 1, 0 2)"
-        );
-    g2 = reader.read(
-        "POINT (1 1)"
-        );
-    pg1 = prep::PreparedGeometryFactory::prepare(g1);
-    pg2 = prep::PreparedGeometryFactory::prepare(g2);
-
-    ensure(!pg1->touches(g2));
-    ensure(!pg2->touches(g1));
-}
-
-// 3 - Line/Point touch
-template<>
-template<>
-void object::test<3>()
-{
-    g1 = reader.read(
-        "LINESTRING(0 0, 1 1, 0 2)"
-        );
-    g2 = reader.read(
-        "POINT (0 2)"
-        );
-    pg1 = prep::PreparedGeometryFactory::prepare(g1);
-    pg2 = prep::PreparedGeometryFactory::prepare(g2);
-
-    ensure(pg1->touches(g2));
-    ensure(pg2->touches(g1));
-}
-
-// 4 - Line/Point touch (FP coordinates)
-template<>
-template<>
-void object::test<4>()
-{
-    g1 = reader.read(
-        "LINESTRING (-612844.96290006 279079.117329031,-257704.820935236 574364.179187424)"
-        );
-    g2 = reader.read(
-        "POINT (-257704.820935236 574364.179187424)"
-        );
-    pg1 = prep::PreparedGeometryFactory::prepare(g1);
-    pg2 = prep::PreparedGeometryFactory::prepare(g2);
-
-    ensure(pg1->touches(g2));
-    ensure(pg2->touches(g1));
-}
-
-} // namespace tut
+//
+// Test Suite for PreparedGeometry's touches() functions
+
+// tut
+#include <tut/tut.hpp>
+#include <utility.h>
+// geos
+#include <geos/geom/prep/PreparedGeometryFactory.h>
+#include <geos/geom/prep/PreparedGeometry.h>
+#include <geos/geom/GeometryFactory.h>
+#include <geos/geom/Geometry.h>
+#include <geos/io/WKTReader.h>
+// std
+#include <memory>
+
+using namespace geos::geom;
+
+namespace tut {
+
+//
+// Test Group
+//
+
+struct test_preparedgeometrytouches_data
+{
+    typedef std::unique_ptr<geos::geom::prep::PreparedGeometry> PrepGeomAutoPtr;
+    typedef geos::geom::GeometryFactory GeometryFactory;
+
+    geos::geom::GeometryFactory::Ptr factory;
+    geos::io::WKTReader reader;
+    GeometryPtr g1;
+    GeometryPtr g2;
+    PreparedGeometryPtr pg1;
+    PreparedGeometryPtr pg2;
+
+    test_preparedgeometrytouches_data()
+        : factory(GeometryFactory::create())
+        , reader(factory.get())
+        , g1(nullptr)
+        , g2(nullptr)
+        , pg1(nullptr)
+        , pg2(nullptr)
+    {}
+    ~test_preparedgeometrytouches_data()
+    {
+        prep::PreparedGeometryFactory::destroy(pg1);
+        prep::PreparedGeometryFactory::destroy(pg2);
+        factory->destroyGeometry(g1);
+        factory->destroyGeometry(g2);
+    }
+};
+
+typedef test_group<test_preparedgeometrytouches_data> group;
+typedef group::object object;
+
+group test_preparedgeometrytouches_data("geos::geom::prep::PreparedGeometry::touches");
+
+//
+// Test Cases
+//
+
+// 1 - Point/Point do not touch
+template<>
+template<>
+void object::test<1>()
+{
+    g1 = reader.read(
+        "POINT (0 0)"
+        );
+    g2 = reader.read(
+        "POINT (0 0)"
+        );
+    pg1 = prep::PreparedGeometryFactory::prepare(g1);
+    pg2 = prep::PreparedGeometryFactory::prepare(g2);
+
+    ensure(!pg1->touches(g2));
+    ensure(!pg2->touches(g1));
+}
+
+// 2 - Line/Point do not touch if point is not on boundary
+template<>
+template<>
+void object::test<2>()
+{
+    g1 = reader.read(
+        "LINESTRING(0 0, 1 1, 0 2)"
+        );
+    g2 = reader.read(
+        "POINT (1 1)"
+        );
+    pg1 = prep::PreparedGeometryFactory::prepare(g1);
+    pg2 = prep::PreparedGeometryFactory::prepare(g2);
+
+    ensure(!pg1->touches(g2));
+    ensure(!pg2->touches(g1));
+}
+
+// 3 - Line/Point touch
+template<>
+template<>
+void object::test<3>()
+{
+    g1 = reader.read(
+        "LINESTRING(0 0, 1 1, 0 2)"
+        );
+    g2 = reader.read(
+        "POINT (0 2)"
+        );
+    pg1 = prep::PreparedGeometryFactory::prepare(g1);
+    pg2 = prep::PreparedGeometryFactory::prepare(g2);
+
+    ensure(pg1->touches(g2));
+    ensure(pg2->touches(g1));
+}
+
+// 4 - Line/Point touch (FP coordinates)
+template<>
+template<>
+void object::test<4>()
+{
+    g1 = reader.read(
+        "LINESTRING (-612844.96290006 279079.117329031,-257704.820935236 574364.179187424)"
+        );
+    g2 = reader.read(
+        "POINT (-257704.820935236 574364.179187424)"
+        );
+    pg1 = prep::PreparedGeometryFactory::prepare(g1);
+    pg2 = prep::PreparedGeometryFactory::prepare(g2);
+
+    ensure(pg1->touches(g2));
+    ensure(pg2->touches(g1));
+}
+
+} // namespace tut
diff --git a/tests/unit/operation/buffer/BufferBuilderTest.cpp b/tests/unit/operation/buffer/BufferBuilderTest.cpp
index 6e44d8b..dc65453 100644
--- a/tests/unit/operation/buffer/BufferBuilderTest.cpp
+++ b/tests/unit/operation/buffer/BufferBuilderTest.cpp
@@ -1,130 +1,130 @@
-// 
-// Test Suite for geos::operation::buffer::BufferBuilder class.
-
-// tut
-#include <tut/tut.hpp>
-// geos
-#include <geos/operation/buffer/BufferBuilder.h>
-#include <geos/operation/buffer/BufferParameters.h>
-#include <geos/platform.h>
-#include <geos/geom/Coordinate.h>
-#include <geos/geom/GeometryFactory.h>
-#include <geos/geom/Geometry.h>
-#include <geos/geom/LineString.h>
-#include <geos/algorithm/PointLocator.h>
-#include <geos/algorithm/CGAlgorithms.h>
-#include <geos/io/WKTReader.h>
-#include <geos/geom/CoordinateSequence.h>
-// std
-#include <memory>
-#include <string>
-#include <vector>
-
-namespace tut
-{
-    //
-    // Test Group
-    //
-
-    // Common data used by tests
-    struct test_bufferbuilder_data
-    {
-        const geos::geom::GeometryFactory &gf;
-        geos::io::WKTReader wktreader;
-        int const default_quadrant_segments;
-
-        typedef geos::geom::Geometry::Ptr GeomPtr;
-        typedef std::unique_ptr<geos::geom::CoordinateSequence> CSPtr;
-
-        test_bufferbuilder_data()
-            : gf(*geos::geom::GeometryFactory::getDefaultInstance())
-            , wktreader(&gf)
-            , default_quadrant_segments(geos::operation::buffer::BufferParameters::DEFAULT_QUADRANT_SEGMENTS)
-        {
-            ensure_equals(default_quadrant_segments, int(8));
-        }
-    private:
-        // noncopyable
-        test_bufferbuilder_data(test_bufferbuilder_data const& other);
-        test_bufferbuilder_data& operator=(test_bufferbuilder_data const& rhs);
-    };
-
-    typedef test_group<test_bufferbuilder_data> group;
-    typedef group::object object;
-
-    group test_bufferbuilder_group("geos::operation::buffer::BufferBuilder");
-
-    //
-    // Test Cases
-    //
-
-    // Left-side and right-side offset curve
-    // See http://trac.osgeo.org/geos/ticket/633
-    template<>
-    template<>
-    void object::test<1>()
-    {
-        using geos::operation::buffer::BufferBuilder;
-        using geos::operation::buffer::BufferParameters;
-        using geos::algorithm::CGAlgorithms;
-        using geos::geom::LineString;
-
-        // Original input from test in ticket #633
-        //std::string wkt0("LINESTRING ("
-        //    "665.7317504882812500 133.0762634277343700,"
-        //    "1774.4752197265625000 19.9391822814941410,"
-        //    "756.2413940429687500 466.8306579589843700,"
-        //    "626.1337890625000000 1898.0147705078125000,"
-        //    "433.8007202148437500 404.6052856445312500)");
-        //double const distance = 57.164000837203;
-
-        // Simplified equivalent input
-        std::string wkt0("LINESTRING(0 0, 50 -10, 10 10, 0 50, -10 10)");
-        double const distance = 5;
-
-        GeomPtr g0(wktreader.read(wkt0));
-        ensure(nullptr != g0.get());
-        ensure_equals(g0->getNumPoints(), std::size_t(5));
-
-        BufferParameters params;
-        params.setEndCapStyle(BufferParameters::CAP_FLAT);
-        params.setQuadrantSegments(8);
-        params.setJoinStyle(BufferParameters::JOIN_MITRE);
-        params.setMitreLimit(5.57F);
-        //params.setSingleSided(true); // DO NOT switch for non-areal input, see ticket #633
-        BufferBuilder builder(params);
-        ensure(distance > 0);
-
-        // left-side
-        {
-            GeomPtr gB(builder.bufferLineSingleSided(g0.get(), distance, true));
-            ensure(nullptr != gB.get());
-            ensure_equals(gB->getGeometryTypeId(), geos::geom::GEOS_LINESTRING);
-            // Left-side offset curve expected with 5+ vertices
-            ensure(gB->getNumPoints() >= g0->getNumPoints());
-
-            // For left-side offset curve, the offset will be at the left side of the input line
-            // and retain the same direction.
-            ensure_equals(
-                CGAlgorithms::isCCW(dynamic_cast<LineString*>(g0.get())->getCoordinatesRO()),
-                CGAlgorithms::isCCW(dynamic_cast<LineString*>(gB.get())->getCoordinatesRO()));
-        }
-
-        // right-side
-        {
-            GeomPtr gB(builder.bufferLineSingleSided(g0.get(), distance, false));
-            ensure(nullptr != gB.get());
-            ensure_equals(gB->getGeometryTypeId(), geos::geom::GEOS_LINESTRING);
-            // Right-side offset curve expected with 5+ vertices
-            ensure(gB->getNumPoints() >= g0->getNumPoints());
-
-            // For right-side offset curve, it'll be at the right side
-            // and in the opposite direction.
-            ensure_equals(
-                CGAlgorithms::isCCW(dynamic_cast<LineString*>(g0.get())->getCoordinatesRO()),
-                !CGAlgorithms::isCCW(dynamic_cast<LineString*>(gB.get())->getCoordinatesRO()));
-        }
-    }
-
-} // namespace tut
-
+//
+// Test Suite for geos::operation::buffer::BufferBuilder class.
+
+// tut
+#include <tut/tut.hpp>
+// geos
+#include <geos/operation/buffer/BufferBuilder.h>
+#include <geos/operation/buffer/BufferParameters.h>
+#include <geos/platform.h>
+#include <geos/geom/Coordinate.h>
+#include <geos/geom/GeometryFactory.h>
+#include <geos/geom/Geometry.h>
+#include <geos/geom/LineString.h>
+#include <geos/algorithm/PointLocator.h>
+#include <geos/algorithm/CGAlgorithms.h>
+#include <geos/io/WKTReader.h>
+#include <geos/geom/CoordinateSequence.h>
+// std
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace tut
+{
+    //
+    // Test Group
+    //
+
+    // Common data used by tests
+    struct test_bufferbuilder_data
+    {
+        const geos::geom::GeometryFactory &gf;
+        geos::io::WKTReader wktreader;
+        int const default_quadrant_segments;
+
+        typedef geos::geom::Geometry::Ptr GeomPtr;
+        typedef std::unique_ptr<geos::geom::CoordinateSequence> CSPtr;
+
+        test_bufferbuilder_data()
+            : gf(*geos::geom::GeometryFactory::getDefaultInstance())
+            , wktreader(&gf)
+            , default_quadrant_segments(geos::operation::buffer::BufferParameters::DEFAULT_QUADRANT_SEGMENTS)
+        {
+            ensure_equals(default_quadrant_segments, int(8));
+        }
+    private:
+        // noncopyable
+        test_bufferbuilder_data(test_bufferbuilder_data const& other);
+        test_bufferbuilder_data& operator=(test_bufferbuilder_data const& rhs);
+    };
+
+    typedef test_group<test_bufferbuilder_data> group;
+    typedef group::object object;
+
+    group test_bufferbuilder_group("geos::operation::buffer::BufferBuilder");
+
+    //
+    // Test Cases
+    //
+
+    // Left-side and right-side offset curve
+    // See http://trac.osgeo.org/geos/ticket/633
+    template<>
+    template<>
+    void object::test<1>()
+    {
+        using geos::operation::buffer::BufferBuilder;
+        using geos::operation::buffer::BufferParameters;
+        using geos::algorithm::CGAlgorithms;
+        using geos::geom::LineString;
+
+        // Original input from test in ticket #633
+        //std::string wkt0("LINESTRING ("
+        //    "665.7317504882812500 133.0762634277343700,"
+        //    "1774.4752197265625000 19.9391822814941410,"
+        //    "756.2413940429687500 466.8306579589843700,"
+        //    "626.1337890625000000 1898.0147705078125000,"
+        //    "433.8007202148437500 404.6052856445312500)");
+        //double const distance = 57.164000837203;
+
+        // Simplified equivalent input
+        std::string wkt0("LINESTRING(0 0, 50 -10, 10 10, 0 50, -10 10)");
+        double const distance = 5;
+
+        GeomPtr g0(wktreader.read(wkt0));
+        ensure(nullptr != g0.get());
+        ensure_equals(g0->getNumPoints(), std::size_t(5));
+
+        BufferParameters params;
+        params.setEndCapStyle(BufferParameters::CAP_FLAT);
+        params.setQuadrantSegments(8);
+        params.setJoinStyle(BufferParameters::JOIN_MITRE);
+        params.setMitreLimit(5.57F);
+        //params.setSingleSided(true); // DO NOT switch for non-areal input, see ticket #633
+        BufferBuilder builder(params);
+        ensure(distance > 0);
+
+        // left-side
+        {
+            GeomPtr gB(builder.bufferLineSingleSided(g0.get(), distance, true));
+            ensure(nullptr != gB.get());
+            ensure_equals(gB->getGeometryTypeId(), geos::geom::GEOS_LINESTRING);
+            // Left-side offset curve expected with 5+ vertices
+            ensure(gB->getNumPoints() >= g0->getNumPoints());
+
+            // For left-side offset curve, the offset will be at the left side of the input line
+            // and retain the same direction.
+            ensure_equals(
+                CGAlgorithms::isCCW(dynamic_cast<LineString*>(g0.get())->getCoordinatesRO()),
+                CGAlgorithms::isCCW(dynamic_cast<LineString*>(gB.get())->getCoordinatesRO()));
+        }
+
+        // right-side
+        {
+            GeomPtr gB(builder.bufferLineSingleSided(g0.get(), distance, false));
+            ensure(nullptr != gB.get());
+            ensure_equals(gB->getGeometryTypeId(), geos::geom::GEOS_LINESTRING);
+            // Right-side offset curve expected with 5+ vertices
+            ensure(gB->getNumPoints() >= g0->getNumPoints());
+
+            // For right-side offset curve, it'll be at the right side
+            // and in the opposite direction.
+            ensure_equals(
+                CGAlgorithms::isCCW(dynamic_cast<LineString*>(g0.get())->getCoordinatesRO()),
+                !CGAlgorithms::isCCW(dynamic_cast<LineString*>(gB.get())->getCoordinatesRO()));
+        }
+    }
+
+} // namespace tut
+

-----------------------------------------------------------------------

Summary of changes:
 include/geos/noding/OrientedCoordinateArray.h      |  230 +++++++-------
 src/noding/OrientedCoordinateArray.cpp             |  196 ++++++------
 tests/unit/capi/GEOSConvexHullTest.cpp             |  162 +++++-----
 tests/unit/capi/GEOSIntersectionTest.cpp           |  284 ++++++++---------
 tests/unit/capi/GEOSisClosedTest.cpp               |  190 +++++------
 tests/unit/geom/Geometry/touchesTest.cpp           |  332 ++++++++++----------
 tests/unit/geom/GeometryComponentFilterTest.cpp    |  190 +++++------
 tests/unit/geom/GeometryFilterTest.cpp             |  192 +++++------
 .../geom/prep/PreparedGeometry/touchesTest.cpp     |  268 ++++++++--------
 tests/unit/operation/buffer/BufferBuilderTest.cpp  |  260 +++++++--------
 10 files changed, 1152 insertions(+), 1152 deletions(-)


hooks/post-receive
-- 
geos


More information about the geos-commits mailing list