[geos-commits] [SCM] GEOS branch master updated. 6f960a291b0fe91bcd2f7dae2551cffc7875b3c9

git at osgeo.org git at osgeo.org
Wed Dec 12 10:29:45 PST 2018


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  6f960a291b0fe91bcd2f7dae2551cffc7875b3c9 (commit)
      from  f2278c485d191afd7219a3877b9eb97a6d52e438 (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 6f960a291b0fe91bcd2f7dae2551cffc7875b3c9
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Dec 12 10:29:38 2018 -0800

    Reformat IsValidOp

diff --git a/include/geos/operation/valid/IsValidOp.h b/include/geos/operation/valid/IsValidOp.h
index 9bcd639..09bb588 100644
--- a/include/geos/operation/valid/IsValidOp.h
+++ b/include/geos/operation/valid/IsValidOp.h
@@ -27,27 +27,27 @@
 
 // Forward declarations
 namespace geos {
-	namespace util {
-		class TopologyValidationError;
-	}
-	namespace geom {
-		class CoordinateSequence;
-		class GeometryFactory;
-		class Geometry;
-		class Point;
-		class LinearRing;
-		class LineString;
-		class Polygon;
-		class GeometryCollection;
-		class MultiPolygon;
-		class MultiLineString;
-	}
-	namespace geomgraph {
-		class DirectedEdge;
-		class EdgeIntersectionList;
-		class PlanarGraph;
-		class GeometryGraph;
-	}
+namespace util {
+class TopologyValidationError;
+}
+namespace geom {
+class CoordinateSequence;
+class GeometryFactory;
+class Geometry;
+class Point;
+class LinearRing;
+class LineString;
+class Polygon;
+class GeometryCollection;
+class MultiPolygon;
+class MultiLineString;
+}
+namespace geomgraph {
+class DirectedEdge;
+class EdgeIntersectionList;
+class PlanarGraph;
+class GeometryGraph;
+}
 }
 
 namespace geos {
@@ -59,215 +59,216 @@ namespace valid { // geos::operation::valid
  * method for {@link Geometry}s.
  */
 class GEOS_DLL IsValidOp {
-friend class Unload;
+    friend class Unload;
 private:
-	/// the base Geometry to be validated
-	const geom::Geometry *parentGeometry;
-
-	bool isChecked;
-
-	// CHECKME: should this really be a pointer ?
-	TopologyValidationError* validErr;
-
-	// This is the version using 'isChecked' flag
-	void checkValid();
-
-	void checkValid(const geom::Geometry *g);
-	void checkValid(const geom::Point *g);
-	void checkValid(const geom::LinearRing *g);
-	void checkValid(const geom::LineString *g);
-	void checkValid(const geom::Polygon *g);
-	void checkValid(const geom::MultiPolygon *g);
-	void checkValid(const geom::GeometryCollection *gc);
-	void checkConsistentArea(geomgraph::GeometryGraph *graph);
-
-
-	/**
-	 * Check that there is no ring which self-intersects
-	 * (except of course at its endpoints).
-	 * This is required by OGC topology rules (but not by other models
-	 * such as ESRI SDE, which allow inverted shells and exverted holes).
-	 *
-	 * @param graph the topology graph of the geometry
-	 */
-	void checkNoSelfIntersectingRings(geomgraph::GeometryGraph *graph);
-
-	/**
-	 * check that a ring does not self-intersect, except at its endpoints.
-	 * Algorithm is to count the number of times each node along edge
-	 * occurs.
-	 * If any occur more than once, that must be a self-intersection.
-	 */
-	void checkNoSelfIntersectingRing(
-			geomgraph::EdgeIntersectionList &eiList);
-
-	void checkTooFewPoints(geomgraph::GeometryGraph *graph);
-
-	/**
-	 * Test that each hole is inside the polygon shell.
-	 * This routine assumes that the holes have previously been tested
-	 * to ensure that all vertices lie on the shell or inside it.
-	 * A simple test of a single point in the hole can be used,
-	 * provide the point is chosen such that it does not lie on the
-	 * boundary of the shell.
-	 *
-	 * @param p the polygon to be tested for hole inclusion
-	 * @param graph a geomgraph::GeometryGraph incorporating the polygon
-	 */
-	void checkHolesInShell(const geom::Polygon *p,
-			geomgraph::GeometryGraph *graph);
-
-	/**
-	 * Tests that no hole is nested inside another hole.
-	 * This routine assumes that the holes are disjoint.
-	 * To ensure this, holes have previously been tested
-	 * to ensure that:
-	 *
-	 *  - they do not partially overlap
-	 *    (checked by <code>checkRelateConsistency</code>)
-	 *  - they are not identical
-	 *    (checked by <code>checkRelateConsistency</code>)
-	 *
-	 */
-	void checkHolesNotNested(const geom::Polygon *p,
-			geomgraph::GeometryGraph *graph);
-
-	/**
-	 * Tests that no element polygon is wholly in the interior of another
-	 * element polygon.
-	 *
-	 * Preconditions:
-	 *
-	 * - shells do not partially overlap
-	 * - shells do not touch along an edge
-	 * - no duplicate rings exist
-	 *
-	 * This routine relies on the fact that while polygon shells
-	 * may touch at one or more vertices, they cannot touch at
-	 * ALL vertices.
-	 */
-	void checkShellsNotNested(const geom::MultiPolygon *mp,
-			geomgraph::GeometryGraph *graph);
-
-	/**
-	 * Check if a shell is incorrectly nested within a polygon.
-	 * This is the case if the shell is inside the polygon shell,
-	 * but not inside a polygon hole.
-	 * (If the shell is inside a polygon hole, the nesting is valid.)
-	 *
-	 * The algorithm used relies on the fact that the rings must be
-	 * properly contained.
-	 * E.g. they cannot partially overlap (this has been previously
-	 * checked by <code>checkRelateConsistency</code>
-	 */
-	void checkShellNotNested(const geom::LinearRing *shell,
-			const geom::Polygon *p,
-			geomgraph::GeometryGraph *graph);
-
-	/**
-	 * This routine checks to see if a shell is properly contained
-	 * in a hole.
-	 * It assumes that the edges of the shell and hole do not
-	 * properly intersect.
-	 *
-	 * @return <code>null</code> if the shell is properly contained, or
-	 *   a Coordinate which is not inside the hole if it is not
-	 *
-	 */
-	const geom::Coordinate *checkShellInsideHole(
-			const geom::LinearRing *shell,
-			const geom::LinearRing *hole,
-			geomgraph::GeometryGraph *graph);
-
-	void checkConnectedInteriors(geomgraph::GeometryGraph &graph);
-
-	void checkInvalidCoordinates(const geom::CoordinateSequence *cs);
-
-	void checkInvalidCoordinates(const geom::Polygon *poly);
-
-	void checkClosedRings(const geom::Polygon *poly);
-
-	void checkClosedRing(const geom::LinearRing *ring);
-
-	bool isSelfTouchingRingFormingHoleValid;
+    /// the base Geometry to be validated
+    const geom::Geometry *parentGeometry;
+
+    bool isChecked;
+
+    // CHECKME: should this really be a pointer ?
+    TopologyValidationError* validErr;
+
+    // This is the version using 'isChecked' flag
+    void checkValid();
+
+    void checkValid(const geom::Geometry *g);
+    void checkValid(const geom::Point *g);
+    void checkValid(const geom::LinearRing *g);
+    void checkValid(const geom::LineString *g);
+    void checkValid(const geom::Polygon *g);
+    void checkValid(const geom::MultiPolygon *g);
+    void checkValid(const geom::GeometryCollection *gc);
+    void checkConsistentArea(geomgraph::GeometryGraph *graph);
+
+
+    /**
+     * Check that there is no ring which self-intersects
+     * (except of course at its endpoints).
+     * This is required by OGC topology rules (but not by other models
+     * such as ESRI SDE, which allow inverted shells and exverted holes).
+     *
+     * @param graph the topology graph of the geometry
+     */
+    void checkNoSelfIntersectingRings(geomgraph::GeometryGraph *graph);
+
+    /**
+     * check that a ring does not self-intersect, except at its endpoints.
+     * Algorithm is to count the number of times each node along edge
+     * occurs.
+     * If any occur more than once, that must be a self-intersection.
+     */
+    void checkNoSelfIntersectingRing(
+        geomgraph::EdgeIntersectionList &eiList);
+
+    void checkTooFewPoints(geomgraph::GeometryGraph *graph);
+
+    /**
+     * Test that each hole is inside the polygon shell.
+     * This routine assumes that the holes have previously been tested
+     * to ensure that all vertices lie on the shell or inside it.
+     * A simple test of a single point in the hole can be used,
+     * provide the point is chosen such that it does not lie on the
+     * boundary of the shell.
+     *
+     * @param p the polygon to be tested for hole inclusion
+     * @param graph a geomgraph::GeometryGraph incorporating the polygon
+     */
+    void checkHolesInShell(const geom::Polygon *p,
+                           geomgraph::GeometryGraph *graph);
+
+    /**
+     * Tests that no hole is nested inside another hole.
+     * This routine assumes that the holes are disjoint.
+     * To ensure this, holes have previously been tested
+     * to ensure that:
+     *
+     *  - they do not partially overlap
+     *    (checked by <code>checkRelateConsistency</code>)
+     *  - they are not identical
+     *    (checked by <code>checkRelateConsistency</code>)
+     *
+     */
+    void checkHolesNotNested(const geom::Polygon *p,
+                             geomgraph::GeometryGraph *graph);
+
+    /**
+     * Tests that no element polygon is wholly in the interior of another
+     * element polygon.
+     *
+     * Preconditions:
+     *
+     * - shells do not partially overlap
+     * - shells do not touch along an edge
+     * - no duplicate rings exist
+     *
+     * This routine relies on the fact that while polygon shells
+     * may touch at one or more vertices, they cannot touch at
+     * ALL vertices.
+     */
+    void checkShellsNotNested(const geom::MultiPolygon *mp,
+                              geomgraph::GeometryGraph *graph);
+
+    /**
+     * Check if a shell is incorrectly nested within a polygon.
+     * This is the case if the shell is inside the polygon shell,
+     * but not inside a polygon hole.
+     * (If the shell is inside a polygon hole, the nesting is valid.)
+     *
+     * The algorithm used relies on the fact that the rings must be
+     * properly contained.
+     * E.g. they cannot partially overlap (this has been previously
+     * checked by <code>checkRelateConsistency</code>
+     */
+    void checkShellNotNested(const geom::LinearRing *shell,
+                             const geom::Polygon *p,
+                             geomgraph::GeometryGraph *graph);
+
+    /**
+     * This routine checks to see if a shell is properly contained
+     * in a hole.
+     * It assumes that the edges of the shell and hole do not
+     * properly intersect.
+     *
+     * @return <code>null</code> if the shell is properly contained, or
+     *   a Coordinate which is not inside the hole if it is not
+     *
+     */
+    const geom::Coordinate *checkShellInsideHole(
+        const geom::LinearRing *shell,
+        const geom::LinearRing *hole,
+        geomgraph::GeometryGraph *graph);
+
+    void checkConnectedInteriors(geomgraph::GeometryGraph &graph);
+
+    void checkInvalidCoordinates(const geom::CoordinateSequence *cs);
+
+    void checkInvalidCoordinates(const geom::Polygon *poly);
+
+    void checkClosedRings(const geom::Polygon *poly);
+
+    void checkClosedRing(const geom::LinearRing *ring);
+
+    bool isSelfTouchingRingFormingHoleValid;
 
 public:
-	/**
-	 * Find a point from the list of testCoords
-	 * that is NOT a node in the edge for the list of searchCoords
-	 *
-	 * @return the point found, or NULL if none found
-	 */
-	static const geom::Coordinate *findPtNotNode(
-			const geom::CoordinateSequence *testCoords,
-			const geom::LinearRing *searchRing,
-			geomgraph::GeometryGraph *graph);
-
-	/**
-	 * Checks whether a coordinate is valid for processing.
-	 * Coordinates are valid iff their x and y coordinates are in the
-	 * range of the floating point representation.
-	 *
-	 * @param coord the coordinate to validate
-	 * @return <code>true</code> if the coordinate is valid
-	 */
-	static bool isValid(const geom::Coordinate &coord);
-
-	/**
-	 * Tests whether a {@link Geometry} is valid.
-	 *
-	 * @param geom the Geometry to test
-	 * @return true if the geometry is valid
-	 */
-	static bool isValid(const geom::Geometry &geom);
-
-	IsValidOp(const geom::Geometry *geom)
-		:
-		parentGeometry(geom),
-		isChecked(false),
-		validErr(nullptr),
-		isSelfTouchingRingFormingHoleValid(false)
-	{}
-
-	/// TODO: validErr can't be a pointer!
-	virtual ~IsValidOp() {
-		delete validErr;
-	}
-
-	bool isValid();
-
-	TopologyValidationError* getValidationError();
-
-	/** \brief
-	 * Sets whether polygons using <b>Self-Touching Rings</b> to form
-	 * holes are reported as valid.
-	 *
-	 * If this flag is set, the following Self-Touching conditions
-	 * are treated as being valid:
-	 * <ul>
-	 * <li>the shell ring self-touches to create a hole touching the shell
-	 * <li>a hole ring self-touches to create two holes touching at a point
-	 * </ul>
-	 * <p>
-	 * The default (following the OGC SFS standard)
-	 * is that this condition is <b>not</b> valid (<code>false</code>).
-	 * <p>
-	 * This does not affect whether Self-Touching Rings
-	 * disconnecting the polygon interior are considered valid
-	 * (these are considered to be <b>invalid</b> under the SFS,
-	 * and many other spatial models as well).
-	 * This includes "bow-tie" shells,
-	 * which self-touch at a single point causing the interior to
-	 * be disconnected,
-	 * and "C-shaped" holes which self-touch at a single point causing
-	 * an island to be formed.
-	 *
-	 * @param isValid states whether geometry with this condition is valid
-	 */
-	void setSelfTouchingRingFormingHoleValid(bool p_isValid)
-	{
-		isSelfTouchingRingFormingHoleValid = p_isValid;
-	}
+    /**
+     * Find a point from the list of testCoords
+     * that is NOT a node in the edge for the list of searchCoords
+     *
+     * @return the point found, or NULL if none found
+     */
+    static const geom::Coordinate *findPtNotNode(
+        const geom::CoordinateSequence *testCoords,
+        const geom::LinearRing *searchRing,
+        geomgraph::GeometryGraph *graph);
+
+    /**
+     * Checks whether a coordinate is valid for processing.
+     * Coordinates are valid iff their x and y coordinates are in the
+     * range of the floating point representation.
+     *
+     * @param coord the coordinate to validate
+     * @return <code>true</code> if the coordinate is valid
+     */
+    static bool isValid(const geom::Coordinate &coord);
+
+    /**
+     * Tests whether a {@link Geometry} is valid.
+     *
+     * @param geom the Geometry to test
+     * @return true if the geometry is valid
+     */
+    static bool isValid(const geom::Geometry &geom);
+
+    IsValidOp(const geom::Geometry *geom)
+        :
+        parentGeometry(geom),
+        isChecked(false),
+        validErr(nullptr),
+        isSelfTouchingRingFormingHoleValid(false)
+    {}
+
+    /// TODO: validErr can't be a pointer!
+    virtual ~IsValidOp()
+    {
+        delete validErr;
+    }
+
+    bool isValid();
+
+    TopologyValidationError* getValidationError();
+
+    /** \brief
+     * Sets whether polygons using <b>Self-Touching Rings</b> to form
+     * holes are reported as valid.
+     *
+     * If this flag is set, the following Self-Touching conditions
+     * are treated as being valid:
+     * <ul>
+     * <li>the shell ring self-touches to create a hole touching the shell
+     * <li>a hole ring self-touches to create two holes touching at a point
+     * </ul>
+     * <p>
+     * The default (following the OGC SFS standard)
+     * is that this condition is <b>not</b> valid (<code>false</code>).
+     * <p>
+     * This does not affect whether Self-Touching Rings
+     * disconnecting the polygon interior are considered valid
+     * (these are considered to be <b>invalid</b> under the SFS,
+     * and many other spatial models as well).
+     * This includes "bow-tie" shells,
+     * which self-touch at a single point causing the interior to
+     * be disconnected,
+     * and "C-shaped" holes which self-touch at a single point causing
+     * an island to be formed.
+     *
+     * @param isValid states whether geometry with this condition is valid
+     */
+    void setSelfTouchingRingFormingHoleValid(bool p_isValid)
+    {
+        isSelfTouchingRingFormingHoleValid = p_isValid;
+    }
 
 };
 
diff --git a/src/operation/valid/IsValidOp.cpp b/src/operation/valid/IsValidOp.cpp
index 54a7a39..08b3149 100644
--- a/src/operation/valid/IsValidOp.cpp
+++ b/src/operation/valid/IsValidOp.cpp
@@ -64,92 +64,90 @@ namespace valid { // geos.operation.valid
  */
 const Coordinate *
 IsValidOp::findPtNotNode(const CoordinateSequence *testCoords,
-	const LinearRing *searchRing, GeometryGraph *graph)
+                         const LinearRing *searchRing, GeometryGraph *graph)
 {
-	// find edge corresponding to searchRing.
-	Edge *searchEdge=graph->findEdge(searchRing);
-	// find a point in the testCoords which is not a node of the searchRing
-	EdgeIntersectionList &eiList=searchEdge->getEdgeIntersectionList();
-	// somewhat inefficient - is there a better way? (Use a node map, for instance?)
-	auto npts = testCoords->getSize();
-	for(unsigned int i=0; i<npts; ++i)
-	{
-		const Coordinate& pt=testCoords->getAt(i);
-		if (!eiList.isIntersection(pt)) {
-			return &pt;
-		}
-	}
-	return nullptr;
+    // find edge corresponding to searchRing.
+    Edge *searchEdge=graph->findEdge(searchRing);
+    // find a point in the testCoords which is not a node of the searchRing
+    EdgeIntersectionList &eiList=searchEdge->getEdgeIntersectionList();
+    // somewhat inefficient - is there a better way? (Use a node map, for instance?)
+    auto npts = testCoords->getSize();
+    for(unsigned int i=0; i<npts; ++i) {
+        const Coordinate& pt=testCoords->getAt(i);
+        if (!eiList.isIntersection(pt)) {
+            return &pt;
+        }
+    }
+    return nullptr;
 }
 
 
 bool
 IsValidOp::isValid()
 {
-	checkValid();
-	return validErr==nullptr;
+    checkValid();
+    return validErr==nullptr;
 }
 
 /* static public */
 bool
 IsValidOp::isValid(const Coordinate &coord)
 {
-	if (! FINITE(coord.x) ) return false;
-	if (! FINITE(coord.y) ) return false;
-	return true;
+    if (! FINITE(coord.x) ) return false;
+    if (! FINITE(coord.y) ) return false;
+    return true;
 }
 
 /* static public */
 bool
 IsValidOp::isValid(const Geometry &g)
 {
-  IsValidOp op(&g);
-	return op.isValid();
+    IsValidOp op(&g);
+    return op.isValid();
 }
 
 TopologyValidationError *
 IsValidOp::getValidationError()
 {
-	checkValid();
-	return validErr;
+    checkValid();
+    return validErr;
 }
 
 void
 IsValidOp::checkValid()
 {
-	if (isChecked) return;
-	checkValid(parentGeometry);
-        isChecked=true;
+    if (isChecked) return;
+    checkValid(parentGeometry);
+    isChecked=true;
 }
 
 void
 IsValidOp::checkValid(const Geometry *g)
 {
-	assert( validErr == nullptr );
-
-	if (nullptr == g)
-		return;
-
-	// empty geometries are always valid!
-	if (g->isEmpty()) return;
-
-	if ( const Point* x1 = dynamic_cast<const Point*>(g) )
-    checkValid(x1);
-  // LineString also handles LinearRings, so we check LinearRing first
-	else if ( const LinearRing* x2 = dynamic_cast<const LinearRing*>(g) )
-    checkValid(x2);
-	else if ( const LineString* x3 = dynamic_cast<const LineString*>(g) )
-    checkValid(x3);
-	else if ( const Polygon* x4 = dynamic_cast<const Polygon*>(g) )
-    checkValid(x4);
-	else if ( const MultiPolygon* x5 = dynamic_cast<const MultiPolygon*>(g) )
-    checkValid(x5);
-	else if ( const GeometryCollection* x6 =
-        dynamic_cast<const GeometryCollection*>(g) )
-  {
-		checkValid(x6);
-  }
-	else throw util::UnsupportedOperationException();
+    assert( validErr == nullptr );
+
+    if (nullptr == g)
+        return;
+
+    // empty geometries are always valid!
+    if (g->isEmpty()) return;
+
+    if ( const Point* x1 = dynamic_cast<const Point*>(g) )
+        checkValid(x1);
+    // LineString also handles LinearRings, so we check LinearRing first
+    else if ( const LinearRing* x2 = dynamic_cast<const LinearRing*>(g) )
+        checkValid(x2);
+    else if ( const LineString* x3 = dynamic_cast<const LineString*>(g) )
+        checkValid(x3);
+    else if ( const Polygon* x4 = dynamic_cast<const Polygon*>(g) )
+        checkValid(x4);
+    else if ( const MultiPolygon* x5 = dynamic_cast<const MultiPolygon*>(g) )
+        checkValid(x5);
+    else if ( const GeometryCollection* x6 =
+                  dynamic_cast<const GeometryCollection*>(g) ) {
+        checkValid(x6);
+    }
+    else throw util::UnsupportedOperationException();
 }
 
 /*
@@ -158,7 +156,7 @@ IsValidOp::checkValid(const Geometry *g)
 void
 IsValidOp::checkValid(const Point *g)
 {
-	checkInvalidCoordinates(g->getCoordinatesRO());
+    checkInvalidCoordinates(g->getCoordinatesRO());
 }
 
 /*
@@ -167,31 +165,32 @@ IsValidOp::checkValid(const Point *g)
 void
 IsValidOp::checkValid(const LineString *g)
 {
-	checkInvalidCoordinates(g->getCoordinatesRO());
-	if (validErr != nullptr) return;
+    checkInvalidCoordinates(g->getCoordinatesRO());
+    if (validErr != nullptr) return;
 
-	GeometryGraph graph(0,g);
-	checkTooFewPoints(&graph);
+    GeometryGraph graph(0, g);
+    checkTooFewPoints(&graph);
 }
 
 /**
  * Checks validity of a LinearRing.
  */
 void
-IsValidOp::checkValid(const LinearRing *g){
-	checkInvalidCoordinates(g->getCoordinatesRO());
-	if (validErr != nullptr) return;
+IsValidOp::checkValid(const LinearRing *g)
+{
+    checkInvalidCoordinates(g->getCoordinatesRO());
+    if (validErr != nullptr) return;
 
-	checkClosedRing(g);
-	if (validErr != nullptr) return;
+    checkClosedRing(g);
+    if (validErr != nullptr) return;
 
-	GeometryGraph graph(0, g);
-	checkTooFewPoints(&graph);
-	if (validErr!=nullptr) return;
+    GeometryGraph graph(0, g);
+    checkTooFewPoints(&graph);
+    if (validErr!=nullptr) return;
 
-	LineIntersector li;
-	delete graph.computeSelfNodes(&li, true, true);
-	checkNoSelfIntersectingRings(&graph);
+    LineIntersector li;
+    delete graph.computeSelfNodes(&li, true, true);
+    checkNoSelfIntersectingRings(&graph);
 }
 
 /**
@@ -201,107 +200,102 @@ IsValidOp::checkValid(const LinearRing *g){
 void
 IsValidOp::checkValid(const Polygon *g)
 {
-	checkInvalidCoordinates(g);
-	if (validErr != nullptr) return;
+    checkInvalidCoordinates(g);
+    if (validErr != nullptr) return;
 
-	checkClosedRings(g);
-	if (validErr != nullptr) return;
+    checkClosedRings(g);
+    if (validErr != nullptr) return;
 
-	GeometryGraph graph(0,g);
+    GeometryGraph graph(0, g);
 
-	checkTooFewPoints(&graph);
-	if (validErr!=nullptr) return;
+    checkTooFewPoints(&graph);
+    if (validErr!=nullptr) return;
 
-	checkConsistentArea(&graph);
-	if (validErr!=nullptr) return;
+    checkConsistentArea(&graph);
+    if (validErr!=nullptr) return;
 
-	if (!isSelfTouchingRingFormingHoleValid) {
-		checkNoSelfIntersectingRings(&graph);
-		if (validErr!=nullptr) return;
-	}
+    if (!isSelfTouchingRingFormingHoleValid) {
+        checkNoSelfIntersectingRings(&graph);
+        if (validErr!=nullptr) return;
+    }
 
-	checkHolesInShell(g,&graph);
-	if (validErr!=nullptr) return;
+    checkHolesInShell(g, &graph);
+    if (validErr!=nullptr) return;
 
-	checkHolesNotNested(g,&graph);
-	if (validErr!=nullptr) return;
+    checkHolesNotNested(g, &graph);
+    if (validErr!=nullptr) return;
 
-	checkConnectedInteriors(graph);
+    checkConnectedInteriors(graph);
 }
 
 void
 IsValidOp::checkValid(const MultiPolygon *g)
 {
-	auto ngeoms = g->getNumGeometries();
-	vector<const Polygon *>polys(ngeoms);
+    auto ngeoms = g->getNumGeometries();
+    vector<const Polygon *>polys(ngeoms);
 
-	for (size_t i=0; i < ngeoms; ++i)
-	{
-		const Polygon *p = dynamic_cast<const Polygon *>(g->getGeometryN(i));
+    for (size_t i=0; i < ngeoms; ++i) {
+        const Polygon *p = dynamic_cast<const Polygon *>(g->getGeometryN(i));
 
-		checkInvalidCoordinates(p);
-		if (validErr != nullptr) return;
+        checkInvalidCoordinates(p);
+        if (validErr != nullptr) return;
 
-		checkClosedRings(p);
-		if (validErr != nullptr) return;
+        checkClosedRings(p);
+        if (validErr != nullptr) return;
 
-		polys[i]=p;
-	}
+        polys[i]=p;
+    }
 
-	GeometryGraph graph(0,g);
+    GeometryGraph graph(0, g);
 
-	checkTooFewPoints(&graph);
-	if (validErr!=nullptr) return;
+    checkTooFewPoints(&graph);
+    if (validErr!=nullptr) return;
 
-	checkConsistentArea(&graph);
-	if (validErr!=nullptr) return;
+    checkConsistentArea(&graph);
+    if (validErr!=nullptr) return;
 
-	if (!isSelfTouchingRingFormingHoleValid)
-	{
-		checkNoSelfIntersectingRings(&graph);
-		if (validErr!=nullptr) return;
-	}
+    if (!isSelfTouchingRingFormingHoleValid) {
+        checkNoSelfIntersectingRings(&graph);
+        if (validErr!=nullptr) return;
+    }
 
-	for(unsigned int i=0; i<ngeoms; ++i)
-	{
-		const Polygon *p=polys[i];
-		checkHolesInShell(p, &graph);
-		if (validErr!=nullptr) return;
-	}
+    for(unsigned int i=0; i<ngeoms; ++i) {
+        const Polygon *p=polys[i];
+        checkHolesInShell(p, &graph);
+        if (validErr!=nullptr) return;
+    }
 
-	for(unsigned int i=0; i<ngeoms; ++i)
-	{
-		const Polygon *p=polys[i];
-		checkHolesNotNested(p, &graph);
-		if (validErr!=nullptr) return;
-	}
+    for(unsigned int i=0; i<ngeoms; ++i) {
+        const Polygon *p=polys[i];
+        checkHolesNotNested(p, &graph);
+        if (validErr!=nullptr) return;
+    }
 
-	checkShellsNotNested(g,&graph);
-	if (validErr!=nullptr) return;
+    checkShellsNotNested(g, &graph);
+    if (validErr!=nullptr) return;
 
-	checkConnectedInteriors(graph);
+    checkConnectedInteriors(graph);
 }
 
 void
 IsValidOp::checkValid(const GeometryCollection *gc)
 {
-	for(size_t i = 0, ngeoms=gc->getNumGeometries(); i < ngeoms; ++i)
-	{
-		const Geometry *g=gc->getGeometryN(i);
-		checkValid(g);
-		if (validErr!=nullptr) return;
-	}
+    for(size_t i = 0, ngeoms=gc->getNumGeometries(); i < ngeoms; ++i) {
+        const Geometry *g=gc->getGeometryN(i);
+        checkValid(g);
+        if (validErr!=nullptr) return;
+    }
 }
 
 void
 IsValidOp::checkTooFewPoints(GeometryGraph *graph)
 {
-	if (graph->hasTooFewPoints()) {
-		validErr=new TopologyValidationError(
-			TopologyValidationError::eTooFewPoints,
-			graph->getInvalidPoint());
-		return;
-	}
+    if (graph->hasTooFewPoints()) {
+        validErr=new TopologyValidationError(
+            TopologyValidationError::eTooFewPoints,
+            graph->getInvalidPoint());
+        return;
+    }
 }
 
 /**
@@ -315,23 +309,21 @@ IsValidOp::checkTooFewPoints(GeometryGraph *graph)
 void
 IsValidOp::checkConsistentArea(GeometryGraph *graph)
 {
-	ConsistentAreaTester cat(graph);
-	bool isValidArea=cat.isNodeConsistentArea();
-
-	if (!isValidArea)
-	{
-		validErr=new TopologyValidationError(
-			TopologyValidationError::eSelfIntersection,
-			cat.getInvalidPoint());
-		return;
-	}
-
-	if (cat.hasDuplicateRings())
-	{
-		validErr=new TopologyValidationError(
-			TopologyValidationError::eDuplicatedRings,
-			cat.getInvalidPoint());
-	}
+    ConsistentAreaTester cat(graph);
+    bool isValidArea=cat.isNodeConsistentArea();
+
+    if (!isValidArea) {
+        validErr=new TopologyValidationError(
+            TopologyValidationError::eSelfIntersection,
+            cat.getInvalidPoint());
+        return;
+    }
+
+    if (cat.hasDuplicateRings()) {
+        validErr=new TopologyValidationError(
+            TopologyValidationError::eDuplicatedRings,
+            cat.getInvalidPoint());
+    }
 }
 
 
@@ -339,268 +331,258 @@ IsValidOp::checkConsistentArea(GeometryGraph *graph)
 void
 IsValidOp::checkNoSelfIntersectingRings(GeometryGraph *graph)
 {
-	vector<Edge*> *edges=graph->getEdges();
-	for(unsigned int i=0; i<edges->size(); ++i)
-	{
-		Edge *e=(*edges)[i];
-		checkNoSelfIntersectingRing(e->getEdgeIntersectionList());
-		if(validErr!=nullptr) return;
-	}
+    vector<Edge*> *edges=graph->getEdges();
+    for(unsigned int i=0; i<edges->size(); ++i) {
+        Edge *e=(*edges)[i];
+        checkNoSelfIntersectingRing(e->getEdgeIntersectionList());
+        if(validErr!=nullptr) return;
+    }
 }
 
 /*private*/
 void
 IsValidOp::checkNoSelfIntersectingRing(EdgeIntersectionList &eiList)
 {
-	set<const Coordinate*,CoordinateLessThen>nodeSet;
-	bool isFirst=true;
-	EdgeIntersectionList::iterator it=eiList.begin();
-	EdgeIntersectionList::iterator end=eiList.end();
-	for(; it!=end; ++it)
-	{
-		EdgeIntersection *ei=*it;
-		if (isFirst) {
-			isFirst=false;
-			continue;
-		}
-		if (nodeSet.find(&ei->coord)!=nodeSet.end()) {
-			validErr=new TopologyValidationError(
-				TopologyValidationError::eRingSelfIntersection,
-				ei->coord);
-			return;
-		} else {
-			nodeSet.insert(&ei->coord);
-		}
-	}
+    set<const Coordinate*, CoordinateLessThen>nodeSet;
+    bool isFirst=true;
+    EdgeIntersectionList::iterator it=eiList.begin();
+    EdgeIntersectionList::iterator end=eiList.end();
+    for(; it!=end; ++it) {
+        EdgeIntersection *ei=*it;
+        if (isFirst) {
+            isFirst=false;
+            continue;
+        }
+        if (nodeSet.find(&ei->coord)!=nodeSet.end()) {
+            validErr=new TopologyValidationError(
+                TopologyValidationError::eRingSelfIntersection,
+                ei->coord);
+            return;
+        }
+        else {
+            nodeSet.insert(&ei->coord);
+        }
+    }
 }
 
 /*private*/
 void
 IsValidOp::checkHolesInShell(const Polygon *p, GeometryGraph *graph)
 {
-	assert(dynamic_cast<const LinearRing*>(p->getExteriorRing()));
+    assert(dynamic_cast<const LinearRing*>(p->getExteriorRing()));
 
-	const LinearRing *shell = static_cast<const LinearRing*>(
-			p->getExteriorRing());
+    const LinearRing *shell = static_cast<const LinearRing*>(
+                                  p->getExteriorRing());
 
     const Geometry *shellgeom = static_cast<const Geometry*>(shell);
 
-	auto nholes = p->getNumInteriorRing();
-
-	if(shell->isEmpty())
-	{
-		for(size_t i = 0; i < nholes; ++i)
-		{
-			assert(dynamic_cast<const LinearRing*>(
-				p->getInteriorRingN(i)));
-
-			const LinearRing *hole=static_cast<const LinearRing*>(
-				p->getInteriorRingN(i));
-
-			if(!hole->isEmpty())
-			{
-				validErr=new TopologyValidationError(
-					TopologyValidationError::eHoleOutsideShell);
-				return;
-			}
-		}
-		// all interiors also empty or none exist
-		return;
-	}
-
-	//SimplePointInRing pir(shell);
-	//SIRtreePointInRing pir(shell);
-	// MCPointInRing pir(shell);
+    auto nholes = p->getNumInteriorRing();
+
+    if(shell->isEmpty()) {
+        for(size_t i = 0; i < nholes; ++i) {
+            assert(dynamic_cast<const LinearRing*>(
+                       p->getInteriorRingN(i)));
+
+            const LinearRing *hole=static_cast<const LinearRing*>(
+                                       p->getInteriorRingN(i));
+
+            if(!hole->isEmpty()) {
+                validErr=new TopologyValidationError(
+                    TopologyValidationError::eHoleOutsideShell);
+                return;
+            }
+        }
+        // all interiors also empty or none exist
+        return;
+    }
+
+    //SimplePointInRing pir(shell);
+    //SIRtreePointInRing pir(shell);
+    // MCPointInRing pir(shell);
     locate::IndexedPointInAreaLocator ipial(*shellgeom);
 
-	for(size_t i = 0; i < nholes; ++i)
-	{
-		assert(dynamic_cast<const LinearRing*>(
-				p->getInteriorRingN(i)));
-
-		const LinearRing *hole=static_cast<const LinearRing*>(
-				p->getInteriorRingN(i));
-
-		const Coordinate *holePt=findPtNotNode(
-				hole->getCoordinatesRO(), shell, graph);
-
-		/**
-		 * If no non-node hole vertex can be found, the hole must
-		 * split the polygon into disconnected interiors.
-		 * This will be caught by a subsequent check.
-		 */
-		if (holePt == nullptr) return;
-
-		bool outside = (geom::Location::EXTERIOR == ipial.locate(holePt));
-		if (outside) {
-			validErr=new TopologyValidationError(
-				TopologyValidationError::eHoleOutsideShell,
-				*holePt);
-			return;
-		}
-	}
+    for(size_t i = 0; i < nholes; ++i) {
+        assert(dynamic_cast<const LinearRing*>(
+                   p->getInteriorRingN(i)));
+
+        const LinearRing *hole=static_cast<const LinearRing*>(
+                                   p->getInteriorRingN(i));
+
+        const Coordinate *holePt=findPtNotNode(
+                                     hole->getCoordinatesRO(), shell, graph);
+
+        /**
+         * If no non-node hole vertex can be found, the hole must
+         * split the polygon into disconnected interiors.
+         * This will be caught by a subsequent check.
+         */
+        if (holePt == nullptr) return;
+
+        bool outside = (geom::Location::EXTERIOR == ipial.locate(holePt));
+        if (outside) {
+            validErr=new TopologyValidationError(
+                TopologyValidationError::eHoleOutsideShell,
+                *holePt);
+            return;
+        }
+    }
 }
 
 /*private*/
 void
 IsValidOp::checkHolesNotNested(const Polygon *p, GeometryGraph *graph)
 {
-	//SimpleNestedRingTester nestedTester(graph);
-	//SweeplineNestedRingTester nestedTester(graph);
-	//QuadtreeNestedRingTester nestedTester(graph);
-	IndexedNestedRingTester nestedTester(graph);
-
-	auto nholes = p->getNumInteriorRing();
-	for(size_t i = 0; i < nholes; ++i)
-	{
-		assert(dynamic_cast<const LinearRing*>(
-				p->getInteriorRingN(i)));
-
-		const LinearRing *innerHole=static_cast<const LinearRing*>(
-				p->getInteriorRingN(i));
-
-		//empty holes always pass
-		if(innerHole->isEmpty()) continue;
-
-		nestedTester.add(innerHole);
-	}
-
-	bool isNonNested=nestedTester.isNonNested();
-	if (!isNonNested)
-	{
-		validErr=new TopologyValidationError(
-			TopologyValidationError::eNestedHoles,
-			*(nestedTester.getNestedPoint()));
-	}
+    //SimpleNestedRingTester nestedTester(graph);
+    //SweeplineNestedRingTester nestedTester(graph);
+    //QuadtreeNestedRingTester nestedTester(graph);
+    IndexedNestedRingTester nestedTester(graph);
+
+    auto nholes = p->getNumInteriorRing();
+    for(size_t i = 0; i < nholes; ++i) {
+        assert(dynamic_cast<const LinearRing*>(
+                   p->getInteriorRingN(i)));
+
+        const LinearRing *innerHole=static_cast<const LinearRing*>(
+                                        p->getInteriorRingN(i));
+
+        //empty holes always pass
+        if(innerHole->isEmpty()) continue;
+
+        nestedTester.add(innerHole);
+    }
+
+    bool isNonNested=nestedTester.isNonNested();
+    if (!isNonNested) {
+        validErr=new TopologyValidationError(
+            TopologyValidationError::eNestedHoles,
+            *(nestedTester.getNestedPoint()));
+    }
 }
 
 /*private*/
 void
 IsValidOp::checkShellsNotNested(const MultiPolygon *mp, GeometryGraph *graph)
 {
-	for(size_t i = 0, ngeoms = mp->getNumGeometries(); i < ngeoms; ++i)
-	{
-		const Polygon *p=dynamic_cast<const Polygon *>(
-				mp->getGeometryN(i));
-		assert(p);
+    for(size_t i = 0, ngeoms = mp->getNumGeometries(); i < ngeoms; ++i) {
+        const Polygon *p=dynamic_cast<const Polygon *>(
+                             mp->getGeometryN(i));
+        assert(p);
 
-		const LinearRing *shell=dynamic_cast<const LinearRing*>(
-				p->getExteriorRing());
-		assert(shell);
+        const LinearRing *shell=dynamic_cast<const LinearRing*>(
+                                    p->getExteriorRing());
+        assert(shell);
 
-		for(size_t j = 0; j < ngeoms; ++j)
-		{
-			if (i==j) continue;
+        for(size_t j = 0; j < ngeoms; ++j) {
+            if (i==j) continue;
 
-			const Polygon *p2 = dynamic_cast<const Polygon *>(
-					mp->getGeometryN(j));
-			assert(p2);
+            const Polygon *p2 = dynamic_cast<const Polygon *>(
+                                    mp->getGeometryN(j));
+            assert(p2);
 
-			if (shell->isEmpty() || p2->isEmpty()) continue;
+            if (shell->isEmpty() || p2->isEmpty()) continue;
 
-			checkShellNotNested(shell, p2, graph);
+            checkShellNotNested(shell, p2, graph);
 
-			if (validErr!=nullptr) return;
-		}
-	}
+            if (validErr!=nullptr) return;
+        }
+    }
 }
 
 /*private*/
 void
 IsValidOp::checkShellNotNested(const LinearRing *shell, const Polygon *p,
-	GeometryGraph *graph)
+                               GeometryGraph *graph)
 {
-	const CoordinateSequence *shellPts=shell->getCoordinatesRO();
-
-	// test if shell is inside polygon shell
-	assert(dynamic_cast<const LinearRing*>(
-			p->getExteriorRing()));
-	const LinearRing *polyShell=static_cast<const LinearRing*>(
-			p->getExteriorRing());
-	const CoordinateSequence *polyPts=polyShell->getCoordinatesRO();
-	const Coordinate *shellPt=findPtNotNode(shellPts,polyShell,graph);
-
-	// if no point could be found, we can assume that the shell
-	// is outside the polygon
-	if (shellPt==nullptr) return;
-
-	bool insidePolyShell=CGAlgorithms::isPointInRing(*shellPt, polyPts);
-	if (!insidePolyShell) return;
-
-	// if no holes, this is an error!
-	auto nholes = p->getNumInteriorRing();
-	if (nholes<=0) {
-		validErr=new TopologyValidationError(
-			TopologyValidationError::eNestedShells,
-			*shellPt);
-		return;
-	}
-
-	/**
-	 * Check if the shell is inside one of the holes.
-	 * This is the case if one of the calls to checkShellInsideHole
-	 * returns a null coordinate.
-	 * Otherwise, the shell is not properly contained in a hole, which is
-	 * an error.
-	 */
-	const Coordinate *badNestedPt=nullptr;
-	for(size_t i = 0; i < nholes; ++i) {
-		assert(dynamic_cast<const LinearRing*>(
-				p->getInteriorRingN(i)));
-		const LinearRing *hole=static_cast<const LinearRing*>(
-				p->getInteriorRingN(i));
-		badNestedPt = checkShellInsideHole(shell, hole, graph);
-		if (badNestedPt==nullptr) return;
-	}
-	validErr=new TopologyValidationError(
-		TopologyValidationError::eNestedShells, *badNestedPt
-	);
+    const CoordinateSequence *shellPts=shell->getCoordinatesRO();
+
+    // test if shell is inside polygon shell
+    assert(dynamic_cast<const LinearRing*>(
+               p->getExteriorRing()));
+    const LinearRing *polyShell=static_cast<const LinearRing*>(
+                                    p->getExteriorRing());
+    const CoordinateSequence *polyPts=polyShell->getCoordinatesRO();
+    const Coordinate *shellPt=findPtNotNode(shellPts, polyShell, graph);
+
+    // if no point could be found, we can assume that the shell
+    // is outside the polygon
+    if (shellPt==nullptr) return;
+
+    bool insidePolyShell=CGAlgorithms::isPointInRing(*shellPt, polyPts);
+    if (!insidePolyShell) return;
+
+    // if no holes, this is an error!
+    auto nholes = p->getNumInteriorRing();
+    if (nholes<=0) {
+        validErr=new TopologyValidationError(
+            TopologyValidationError::eNestedShells,
+            *shellPt);
+        return;
+    }
+
+    /**
+     * Check if the shell is inside one of the holes.
+     * This is the case if one of the calls to checkShellInsideHole
+     * returns a null coordinate.
+     * Otherwise, the shell is not properly contained in a hole, which is
+     * an error.
+     */
+    const Coordinate *badNestedPt=nullptr;
+    for(size_t i = 0; i < nholes; ++i) {
+        assert(dynamic_cast<const LinearRing*>(
+                   p->getInteriorRingN(i)));
+        const LinearRing *hole=static_cast<const LinearRing*>(
+                                   p->getInteriorRingN(i));
+        badNestedPt = checkShellInsideHole(shell, hole, graph);
+        if (badNestedPt==nullptr) return;
+    }
+    validErr=new TopologyValidationError(
+        TopologyValidationError::eNestedShells, *badNestedPt
+    );
 }
 
 /*private*/
 const Coordinate *
 IsValidOp::checkShellInsideHole(const LinearRing *shell,
-		const LinearRing *hole,
-		GeometryGraph *graph)
+                                const LinearRing *hole,
+                                GeometryGraph *graph)
 {
-	const CoordinateSequence *shellPts=shell->getCoordinatesRO();
-	const CoordinateSequence *holePts=hole->getCoordinatesRO();
-
-	// TODO: improve performance of this - by sorting pointlists
-	// for instance?
-	const Coordinate *shellPt=findPtNotNode(shellPts, hole, graph);
-
-	// if point is on shell but not hole, check that the shell is
-	// inside the hole
-	if (shellPt) {
-		bool insideHole=CGAlgorithms::isPointInRing(*shellPt, holePts);
-		if (!insideHole) return shellPt;
-	}
-
-	const Coordinate *holePt=findPtNotNode(holePts, shell, graph);
-
-	// if point is on hole but not shell, check that the hole is
-	// outside the shell
-	if (holePt) {
-		bool insideShell=CGAlgorithms::isPointInRing(*holePt, shellPts);
-		if (insideShell) return holePt;
-		return nullptr;
-	}
-	assert(0); // points in shell and hole appear to be equal
-	return nullptr;
+    const CoordinateSequence *shellPts=shell->getCoordinatesRO();
+    const CoordinateSequence *holePts=hole->getCoordinatesRO();
+
+    // TODO: improve performance of this - by sorting pointlists
+    // for instance?
+    const Coordinate *shellPt=findPtNotNode(shellPts, hole, graph);
+
+    // if point is on shell but not hole, check that the shell is
+    // inside the hole
+    if (shellPt) {
+        bool insideHole=CGAlgorithms::isPointInRing(*shellPt, holePts);
+        if (!insideHole) return shellPt;
+    }
+
+    const Coordinate *holePt=findPtNotNode(holePts, shell, graph);
+
+    // if point is on hole but not shell, check that the hole is
+    // outside the shell
+    if (holePt) {
+        bool insideShell=CGAlgorithms::isPointInRing(*holePt, shellPts);
+        if (insideShell) return holePt;
+        return nullptr;
+    }
+    assert(0); // points in shell and hole appear to be equal
+    return nullptr;
 }
 
 /*private*/
 void
 IsValidOp::checkConnectedInteriors(GeometryGraph &graph)
 {
-	ConnectedInteriorTester cit(graph);
-	if (!cit.isInteriorsConnected())
-	{
-		validErr=new TopologyValidationError(
-			TopologyValidationError::eDisconnectedInterior,
-			cit.getCoordinate());
-	}
+    ConnectedInteriorTester cit(graph);
+    if (!cit.isInteriorsConnected()) {
+        validErr=new TopologyValidationError(
+            TopologyValidationError::eDisconnectedInterior,
+            cit.getCoordinate());
+    }
 }
 
 
@@ -608,64 +590,59 @@ IsValidOp::checkConnectedInteriors(GeometryGraph &graph)
 void
 IsValidOp::checkInvalidCoordinates(const CoordinateSequence *cs)
 {
-	auto size = cs->size();
-	for (size_t i = 0; i < size; ++i)
-	{
-		if (! isValid(cs->getAt(i)) )
-		{
-			validErr = new TopologyValidationError(
-				TopologyValidationError::eInvalidCoordinate,
-				cs->getAt(i));
-			return;
-
-		}
-	}
+    auto size = cs->size();
+    for (size_t i = 0; i < size; ++i) {
+        if (! isValid(cs->getAt(i)) ) {
+            validErr = new TopologyValidationError(
+                TopologyValidationError::eInvalidCoordinate,
+                cs->getAt(i));
+            return;
+
+        }
+    }
 }
 
 /*private*/
 void
 IsValidOp::checkInvalidCoordinates(const Polygon *poly)
 {
-	checkInvalidCoordinates(poly->getExteriorRing()->getCoordinatesRO());
-	if (validErr != nullptr) return;
-
-	auto nholes = poly->getNumInteriorRing();
-	for (size_t i = 0; i < nholes; ++i)
-	{
-		checkInvalidCoordinates(
-			poly->getInteriorRingN(i)->getCoordinatesRO()
-		);
-		if (validErr != nullptr) return;
-	}
+    checkInvalidCoordinates(poly->getExteriorRing()->getCoordinatesRO());
+    if (validErr != nullptr) return;
+
+    auto nholes = poly->getNumInteriorRing();
+    for (size_t i = 0; i < nholes; ++i) {
+        checkInvalidCoordinates(
+            poly->getInteriorRingN(i)->getCoordinatesRO()
+        );
+        if (validErr != nullptr) return;
+    }
 }
 
 /*private*/
 void
 IsValidOp::checkClosedRings(const Polygon *poly)
 {
-	const LinearRing *lr=(const LinearRing *)poly->getExteriorRing();
-	checkClosedRing(lr);
-	if (validErr) return;
-
-	auto nholes = poly->getNumInteriorRing();
-	for (size_t i = 0; i < nholes; ++i)
-	{
-		lr=(const LinearRing *)poly->getInteriorRingN(i);
-		checkClosedRing(lr);
-		if (validErr) return;
-	}
+    const LinearRing *lr=(const LinearRing *)poly->getExteriorRing();
+    checkClosedRing(lr);
+    if (validErr) return;
+
+    auto nholes = poly->getNumInteriorRing();
+    for (size_t i = 0; i < nholes; ++i) {
+        lr=(const LinearRing *)poly->getInteriorRingN(i);
+        checkClosedRing(lr);
+        if (validErr) return;
+    }
 }
 
 /*private*/
 void
 IsValidOp::checkClosedRing(const LinearRing *ring)
 {
-	if ( ! ring->isClosed() && ! ring->isEmpty() )
-	{
-		validErr = new TopologyValidationError(
-			TopologyValidationError::eRingNotClosed,
-				ring->getCoordinateN(0));
-	}
+    if ( ! ring->isClosed() && ! ring->isEmpty() ) {
+        validErr = new TopologyValidationError(
+            TopologyValidationError::eRingNotClosed,
+            ring->getCoordinateN(0));
+    }
 }
 
 } // namespace geos.operation.valid

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

Summary of changes:
 include/geos/operation/valid/IsValidOp.h | 455 +++++++++---------
 src/operation/valid/IsValidOp.cpp        | 775 +++++++++++++++----------------
 2 files changed, 604 insertions(+), 626 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list