[geos-commits] [SCM] geos branch master updated. 16183469312aef329c096f1b8a5d95521575a9d8
git at osgeo.org
git at osgeo.org
Fri Sep 1 08:02:53 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 16183469312aef329c096f1b8a5d95521575a9d8 (commit)
via 7d44838732a17bc7267b73d7c7f23c7be1a72860 (commit)
from 64e823b26bc6a771571f39af245b0e0f4e256df8 (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 16183469312aef329c096f1b8a5d95521575a9d8
Author: nila <n_larsson at yahoo.com>
Date: Wed Apr 26 14:27:54 2017 +0200
Remove redundant code
Closes #832
diff --git a/src/linearref/LinearLocation.cpp b/src/linearref/LinearLocation.cpp
index e57e5a4..49de76f 100644
--- a/src/linearref/LinearLocation.cpp
+++ b/src/linearref/LinearLocation.cpp
@@ -89,17 +89,6 @@ LinearLocation::normalize()
segmentFraction = 1.0;
}
- if (componentIndex < 0)
- {
- componentIndex = 0;
- segmentIndex = 0;
- segmentFraction = 0.0;
- }
- if (segmentIndex < 0)
- {
- segmentIndex = 0;
- segmentFraction = 0.0;
- }
if (segmentFraction == 1.0)
{
segmentFraction = 0.0;
@@ -232,11 +221,11 @@ LinearLocation::getSegment(const Geometry* linearGeom) const
bool
LinearLocation::isValid(const Geometry* linearGeom) const
{
- if (componentIndex < 0 || componentIndex >= linearGeom->getNumGeometries())
+ if (componentIndex >= linearGeom->getNumGeometries())
return false;
const LineString* lineComp = dynamic_cast<const LineString*> (linearGeom->getGeometryN(componentIndex));
- if (segmentIndex < 0 || segmentIndex > lineComp->getNumPoints())
+ if (segmentIndex > lineComp->getNumPoints())
return false;
if (segmentIndex == lineComp->getNumPoints() && segmentFraction != 0.0)
return false;
commit 7d44838732a17bc7267b73d7c7f23c7be1a72860
Author: Sandro Santilli <strk at kbt.io>
Date: Thu Jul 27 20:05:54 2017 +0200
Fix debug print syntax
And add more debugging lines
diff --git a/include/geos/geom/BinaryOp.h b/include/geos/geom/BinaryOp.h
index eba5b8b..af5c74b 100644
--- a/include/geos/geom/BinaryOp.h
+++ b/include/geos/geom/BinaryOp.h
@@ -198,6 +198,7 @@ check_valid(const Geometry& g, const std::string& label, bool doThrow=false, boo
<< "<A>" << std::endl
<< g.toString()
<< std::endl
+ << "</A>" << std::endl
#endif
;
#endif
diff --git a/src/operation/union/CascadedPolygonUnion.cpp b/src/operation/union/CascadedPolygonUnion.cpp
index 4d20a06..95b53f3 100644
--- a/src/operation/union/CascadedPolygonUnion.cpp
+++ b/src/operation/union/CascadedPolygonUnion.cpp
@@ -75,9 +75,9 @@ check_valid(const geos::geom::Geometry& g, const std::string& label, bool doThro
<< err->getCoordinate() << ")"
<< std::endl
#ifdef GEOS_DEBUG_CASCADED_UNION_PRINT_INVALID
- << "<A>" << std::endl
- << g.toString()
- << std::endl
+ << "<a>" << std::endl
+ << g.toString() << std::endl
+ << "</a>" << std::endl
#endif
;
#endif // GEOS_DEBUG_CASCADED_UNION
@@ -263,7 +263,19 @@ CascadedPolygonUnion::unionUsingEnvelopeIntersection(geom::Geometry* g0,
std::auto_ptr<geom::Geometry> u(unionActual(g0Int.get(), g1Int.get()));
#if GEOS_DEBUG_CASCADED_UNION
- check_valid(*u, "unionUsingEnvelopeIntersection unionActual return");
+ if ( ! check_valid(*u, "unionUsingEnvelopeIntersection unionActual return") )
+ {
+#if GEOS_DEBUG_CASCADED_UNION_PRINT_INVALID
+ std::cerr << " union between the following is invalid"
+ << "<a>" << std::endl
+ << *g0Int << std::endl
+ << "</a>" << std::endl
+ << "<b>" << std::endl
+ << *g1Int << std::endl
+ << "</b>" << std::endl
+ ;
+#endif
+ }
#endif
if ( disjointPolys.empty() ) return u.release();
-----------------------------------------------------------------------
Summary of changes:
include/geos/geom/BinaryOp.h | 1 +
src/linearref/LinearLocation.cpp | 15 ++-------------
src/operation/union/CascadedPolygonUnion.cpp | 20 ++++++++++++++++----
3 files changed, 19 insertions(+), 17 deletions(-)
hooks/post-receive
--
geos
More information about the geos-commits
mailing list