summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/is_valid/ring.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:33:54 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:36:09 +0900
commitd9ec475d945d3035377a0d89ed42e382d8988891 (patch)
tree34aff2cee4b209906243ab5499d61f3edee2982f /boost/geometry/algorithms/detail/is_valid/ring.hpp
parent71d216b90256936a9638f325af9bc69d720e75de (diff)
downloadboost-d9ec475d945d3035377a0d89ed42e382d8988891.tar.gz
boost-d9ec475d945d3035377a0d89ed42e382d8988891.tar.bz2
boost-d9ec475d945d3035377a0d89ed42e382d8988891.zip
Imported Upstream version 1.60.0
Change-Id: Ie709530d6d5841088ceaba025cbe175a4ef43050 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/geometry/algorithms/detail/is_valid/ring.hpp')
-rw-r--r--boost/geometry/algorithms/detail/is_valid/ring.hpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/boost/geometry/algorithms/detail/is_valid/ring.hpp b/boost/geometry/algorithms/detail/is_valid/ring.hpp
index c35e843418..925c03a472 100644
--- a/boost/geometry/algorithms/detail/is_valid/ring.hpp
+++ b/boost/geometry/algorithms/detail/is_valid/ring.hpp
@@ -30,8 +30,9 @@
#include <boost/geometry/algorithms/intersects.hpp>
#include <boost/geometry/algorithms/validity_failure_type.hpp>
#include <boost/geometry/algorithms/detail/num_distinct_consecutive_points.hpp>
-#include <boost/geometry/algorithms/detail/is_valid/has_spikes.hpp>
#include <boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp>
+#include <boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp>
+#include <boost/geometry/algorithms/detail/is_valid/has_spikes.hpp>
#include <boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp>
#include <boost/geometry/strategies/area.hpp>
@@ -153,17 +154,23 @@ struct is_valid_ring
static inline bool apply(Ring const& ring, VisitPolicy& visitor)
{
// return invalid if any of the following condition holds:
- // (a) the ring's size is below the minimal one
- // (b) the ring consists of at most two distinct points
- // (c) the ring is not topologically closed
- // (d) the ring has spikes
- // (e) the ring has duplicate points (if AllowDuplicates is false)
- // (f) the boundary of the ring has self-intersections
- // (g) the order of the points is inconsistent with the defined order
+ // (a) the ring's point coordinates are not invalid (e.g., NaN)
+ // (b) the ring's size is below the minimal one
+ // (c) the ring consists of at most two distinct points
+ // (d) the ring is not topologically closed
+ // (e) the ring has spikes
+ // (f) the ring has duplicate points (if AllowDuplicates is false)
+ // (g) the boundary of the ring has self-intersections
+ // (h) the order of the points is inconsistent with the defined order
//
// Note: no need to check if the area is zero. If this is the
// case, then the ring must have at least two spikes, which is
- // checked by condition (c).
+ // checked by condition (d).
+
+ if (has_invalid_coordinate<Ring>::apply(ring, visitor))
+ {
+ return false;
+ }
closure_selector const closure = geometry::closure<Ring>::value;
typedef typename closeable_view<Ring const, closure>::type view_type;