Merge branch 'develop' of https://github.com/boostorg/geometry into feature/num_segments

This commit is contained in:
Menelaos Karavelas 2014-08-06 14:02:26 +03:00
commit be586b5947
12 changed files with 64 additions and 34 deletions

View File

@ -1,10 +1,10 @@
[/============================================================================
Boost.Geometry (aka GGL, Generic Geometry Library)
Copyright (c) 2009-2013 Barend Gehrels, Geodan, Amsterdam, the Netherlands.
Copyright (c) 2009-2013 Bruno Lalande, Paris, France.
Copyright (c) 2009-2013 Mateusz Loskot <mateusz@loskot.net>, London, UK
Copyright (c) 2011-2013 Adam Wulkiewicz
Copyright (c) 2009-2014 Barend Gehrels, Geodan, Amsterdam, the Netherlands.
Copyright (c) 2009-2014 Bruno Lalande, Paris, France.
Copyright (c) 2009-2014 Mateusz Loskot <mateusz@loskot.net>, London, UK
Copyright (c) 2011-2014 Adam Wulkiewicz
Use, modification and distribution is subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -25,7 +25,7 @@
* New algorithm is_simple, returning true if a geometry is simple according to the OGC standard
* New algorithm is_valid, returning true if a geometry is valid according to the OGC standard
* New algorithm crosses for checking this spatial relation according to the OGC standard
* The set operation algorithms (difference, intersection, sym_difference and union) now support as input pairs of pointlike or linear geometries
* The set operation algorithms (difference, intersection, sym_difference and union_) now support as input pairs of pointlike or linear geometries
* The distance and comparable_distance algorithms now support all pairs of geometry combinations
* The spatial relations which didn't support it (covered_by, touches, within, etc.) now support as input linear and/or areal geometries
* The support for boost::variants as input geometries in various algorithms
@ -39,14 +39,18 @@
[*Solved tickets]
* [@https://svn.boost.org/trac/boost/ticket/8310 8310] Wrong results with overlapping polygons (fixed using point_on_surface for disjoint)
* [@https://svn.boost.org/trac/boost/ticket/8375 8375] sym_difference of non-closed polygons returns closed polygon
* [@https://svn.boost.org/trac/boost/ticket/8376 8376] difference of non-closed polygons returns closed polygon
* [@https://svn.boost.org/trac/boost/ticket/9081 9081] Booleans create self-intersecting polygons from non-self-intersecting polygons
* [@https://svn.boost.org/trac/boost/ticket/9245 9245] Check for process errors in make_qbk.py
* [@https://svn.boost.org/trac/boost/ticket/9563 9563] (Sym)difference not successful, fixed by rescaling to robust type
* [@https://svn.boost.org/trac/boost/ticket/9628 9628] Wrong result of within() due to the winding strategy not working correctly for nearly-horizontal segments
* [@https://svn.boost.org/trac/boost/ticket/9828 9828] boost::geometry::union_(...) creates redundant closing point
* [@https://svn.boost.org/trac/boost/ticket/9871 9871] Remove spike in polygon with only a spike
* [@https://svn.boost.org/trac/boost/ticket/9947 9947] Missing info about WKT in documentation
* [@https://svn.boost.org/trac/boost/ticket/10019 10019] Difference of Linestring and Box returns their intersection
* [@https://svn.boost.org/trac/boost/ticket/10077 10077] Wrong types in concept checks in boost/geometry/arithmetic/arithmetic.hpp
* [@https://svn.boost.org/trac/boost/ticket/10234 10234] Wrong results of covered_by() for nearly-horizontal segments
[*Bugfixes]

View File

@ -160,7 +160,7 @@ struct range_to_range
// point for open output.
view_type view(rview);
int n = boost::size(view);
boost::range_size<Range1>::type n = boost::size(view);
if (geometry::closure<Range2>::value == geometry::open)
{
n--;

View File

@ -14,9 +14,10 @@
#include <vector>
#include <boost/assert.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/if.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
@ -103,7 +104,7 @@ public:
<
Strategy
>::apply(strategy);
boost::ignore_unused_variable_warning(cstrategy);
boost::ignore_unused(cstrategy);
// get segment points
segment_point p[2];
@ -181,7 +182,7 @@ public:
<
Strategy
>::apply(strategy);
boost::ignore_unused_variable_warning(cstrategy);
boost::ignore_unused(cstrategy);
// get segment points
segment_point p[2];
@ -199,7 +200,7 @@ public:
}
point_box_comparable_strategy pb_cstrategy;
boost::ignore_unused_variable_warning(pb_cstrategy);
boost::ignore_unused(pb_cstrategy);
cd[4] = pb_cstrategy.apply(p[0], box);
cd[5] = pb_cstrategy.apply(p[1], box);
@ -281,6 +282,8 @@ private:
PPStrategy const& pp_strategy,
PSStrategy const& ps_strategy)
{
boost::ignore_unused(pp_strategy, ps_strategy);
// the implementation below is written for non-negative slope
// segments
//
@ -325,6 +328,8 @@ private:
BoxPoint const& top_left,
PSStrategy const& ps_strategy)
{
boost::ignore_unused(ps_strategy);
// the segment lies above the box
typedef cast_to_result<ReturnType> cast;

View File

@ -280,7 +280,7 @@ struct extreme_points_on_ring
template <typename Iterator>
static inline bool right_turn(Ring const& ring, Iterator it)
{
int const index = std::distance(boost::begin(ring), it);
std::iterator_traits<Iterator>::difference_type const index = std::distance(boost::begin(ring), it);
geometry::ever_circling_range_iterator<Ring const> left(ring);
geometry::ever_circling_range_iterator<Ring const> right(ring);
left += index;
@ -328,7 +328,7 @@ struct extreme_points_on_ring
return false;
}
int const index = std::distance(boost::begin(ring), max_it);
std::iterator_traits<range_iterator>::difference_type const index = std::distance(boost::begin(ring), max_it);
//std::cout << "Extreme point lies at " << index << " having " << geometry::wkt(*max_it) << std::endl;
geometry::ever_circling_range_iterator<Ring const> left(ring);

View File

@ -654,12 +654,13 @@ private :
template
<
int Index,
typename Point,
typename Point1,
typename Point2,
typename IntersectionInfo
>
static inline bool set_tp(Point const& , Point const& , Point const& , int side_rk_r,
static inline bool set_tp(Point1 const& , Point1 const& , Point1 const& , int side_rk_r,
bool const handle_robustness,
Point const& , Point const& , int side_rk_s,
Point2 const& , Point2 const& , int side_rk_s,
TurnInfo& tp, IntersectionInfo const& intersection_info)
{
boost::ignore_unused_variable_warning(handle_robustness);

View File

@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2011-2014 Barend Gehrels, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -10,6 +10,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_PARTITION_HPP
#include <vector>
#include <boost/assert.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
@ -79,7 +80,7 @@ inline void divide_into_subsets(Box const& lower_box,
else
{
// Is nowhere! Should not occur!
BOOST_ASSERT(true);
BOOST_ASSERT(false);
}
}
}

View File

@ -1,8 +1,13 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2013-2014.
// Modifications copyright (c) 2013-2014, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -21,8 +26,8 @@
#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
#include <boost/geometry/algorithms/disjoint.hpp>
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
namespace boost { namespace geometry
@ -47,8 +52,7 @@ inline bool intersects(Geometry const& geometry)
concept::check<Geometry const>();
typedef typename geometry::point_type<Geometry>::type point_type;
typedef typename rescale_policy_type<point_type>::type
rescale_policy_type;
typedef detail::no_rescale_policy rescale_policy_type;
typedef detail::overlay::turn_info
<
@ -63,8 +67,7 @@ inline bool intersects(Geometry const& geometry)
detail::overlay::assign_null_policy
> turn_policy;
rescale_policy_type robust_policy
= geometry::get_rescale_policy<rescale_policy_type>(geometry);
rescale_policy_type robust_policy;
detail::disjoint::disjoint_interrupt_policy policy;
detail::self_get_turn_points::get_turns

View File

@ -19,6 +19,8 @@
#define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POLY_WINDING_HPP
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/util/select_calculation_type.hpp>

View File

@ -105,7 +105,7 @@ class points_view
}
Point const* m_points;
int m_index;
difference_type m_index;
};
public :

View File

@ -16,13 +16,13 @@
test-suite boost-geometry-algorithms
:
[ run append.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run area.cpp ]
[ run area.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run assign.cpp ]
[ run buffer.cpp ]
[ run centroid.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run comparable_distance.cpp ]
[ run comparable_distance.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run convex_hull.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run correct.cpp ]
[ run correct.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run convert.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run covered_by.cpp ]
[ run crosses.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
@ -30,10 +30,10 @@ test-suite boost-geometry-algorithms
[ run difference_linear_linear.cpp ]
[ run difference_pl_pl.cpp ]
[ run disjoint.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run disjoint_coverage.cpp ]
[ run disjoint_coverage.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run distance.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run distance_areal_areal.cpp ]
[ run distance_linear_areal.cpp ]
[ run distance_areal_areal.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run distance_linear_areal.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run distance_linear_linear.cpp ]
[ run distance_pointlike_areal.cpp ]
[ run distance_pointlike_linear.cpp ]
@ -46,8 +46,8 @@ test-suite boost-geometry-algorithms
[ run intersection_linear_linear.cpp ]
[ run intersection_pl_pl.cpp ]
[ run intersects.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run is_simple.cpp ]
[ run is_valid.cpp ]
[ run is_simple.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run is_valid.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
[ run length.cpp ]
[ run make.cpp ]
[ run num_points.cpp ]

View File

@ -13,6 +13,8 @@
#ifndef BOOST_GEOMETRY_TEST_FROM_WKT_HPP
#define BOOST_GEOMETRY_TEST_FROM_WKT_HPP
#include <string>
#include <boost/geometry/io/wkt/read.hpp>
#include <boost/geometry/multi/io/wkt/read.hpp>

View File

@ -219,6 +219,18 @@ void test_tickets()
bool within = boost::geometry::within(p, r);
BOOST_CHECK_EQUAL(within, false);
}
// https://svn.boost.org/trac/boost/ticket/10234
{
pt p;
ring r;
bg::read_wkt("POINT(0.1377 5.00)", p);
bg::read_wkt("POLYGON((0.1277 4.97, 0.1277 5.00, 0.1278 4.9999999999999982, 0.1278 4.97, 0.1277 4.97))", r);
bool within = boost::geometry::within(p, r);
BOOST_CHECK_EQUAL(within, false);
bool covered_by = boost::geometry::covered_by(p, r);
BOOST_CHECK_EQUAL(covered_by, false);
}
}
int test_main( int , char* [] )