Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69086 - in trunk: boost/geometry boost/geometry/algorithms boost/geometry/algorithms/detail/overlay boost/geometry/extensions/algorithms boost/geometry/extensions/algorithms/detail boost/geometry/extensions/algorithms/detail/overlay boost/geometry/extensions/multi boost/geometry/extensions/multi/algorithms boost/geometry/multi boost/geometry/multi/algorithms boost/geometry/strategies libs/geometry/doc libs/geometry/doc/reference libs/geometry/test/algorithms libs/geometry/test/extensions libs/geometry/test/extensions/algorithms libs/geometry/test/multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-02-20 13:18:18


Author: barendgehrels
Date: 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
New Revision: 69086
URL: http://svn.boost.org/trac/boost/changeset/69086

Log:
Moved dissolve to extension
Fixed extensions connect/offset tests for gcc

Added:
   trunk/boost/geometry/extensions/algorithms/detail/
   trunk/boost/geometry/extensions/algorithms/detail/overlay/
   trunk/boost/geometry/extensions/algorithms/detail/overlay/dissolver.hpp
      - copied, changed from r68727, /trunk/boost/geometry/algorithms/detail/overlay/dissolver.hpp
   trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp
      - copied, changed from r68727, /trunk/boost/geometry/algorithms/detail/overlay/split_rings.hpp
   trunk/boost/geometry/extensions/algorithms/dissolve.hpp
      - copied, changed from r68727, /trunk/boost/geometry/algorithms/dissolve.hpp
   trunk/boost/geometry/extensions/multi/
   trunk/boost/geometry/extensions/multi/algorithms/
   trunk/boost/geometry/extensions/multi/algorithms/dissolve.hpp
      - copied, changed from r68727, /trunk/boost/geometry/multi/algorithms/dissolve.hpp
   trunk/libs/geometry/test/extensions/algorithms/Jamfile.v2 (contents, props changed)
   trunk/libs/geometry/test/extensions/algorithms/dissolve.cpp
      - copied, changed from r69075, /trunk/libs/geometry/test/algorithms/dissolve.cpp
   trunk/libs/geometry/test/extensions/algorithms/dissolve.vcproj
      - copied, changed from r68727, /trunk/libs/geometry/test/algorithms/dissolve.vcproj
Removed:
   trunk/boost/geometry/algorithms/detail/overlay/dissolver.hpp
   trunk/boost/geometry/algorithms/detail/overlay/split_rings.hpp
   trunk/boost/geometry/algorithms/dissolve.hpp
   trunk/boost/geometry/multi/algorithms/dissolve.hpp
   trunk/libs/geometry/doc/reference/dissolve.qbk
   trunk/libs/geometry/test/algorithms/dissolve.cpp
   trunk/libs/geometry/test/algorithms/dissolve.vcproj
   trunk/libs/geometry/test/algorithms/test_dissolve.hpp
   trunk/libs/geometry/test/multi/algorithms/multi_dissolve.cpp
   trunk/libs/geometry/test/multi/algorithms/multi_dissolve.vcproj
Text files modified:
   trunk/boost/geometry/extensions/algorithms/connect.hpp | 37 +++---
   trunk/boost/geometry/extensions/algorithms/detail/overlay/dissolver.hpp | 6
   trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp | 6
   trunk/boost/geometry/extensions/algorithms/dissolve.hpp | 6
   trunk/boost/geometry/extensions/multi/algorithms/dissolve.hpp | 10
   trunk/boost/geometry/geometry.hpp | 1
   trunk/boost/geometry/multi/multi.hpp | 1
   trunk/boost/geometry/strategies/buffer.hpp | 2
   trunk/libs/geometry/doc/make_qbk.py | 2
   trunk/libs/geometry/doc/quickref.xml | 4
   trunk/libs/geometry/doc/reference.qbk | 4
   trunk/libs/geometry/test/algorithms/algorithms_tests.sln | 6 -
   trunk/libs/geometry/test/extensions/Jamfile.v2 | 1
   trunk/libs/geometry/test/extensions/algorithms/connect.cpp | 5
   trunk/libs/geometry/test/extensions/algorithms/dissolve.cpp | 220 +++++++++++++++++++++++++++++++++++++++
   trunk/libs/geometry/test/extensions/algorithms/dissolve.vcproj | 8
   trunk/libs/geometry/test/extensions/algorithms/extension_algorithms.sln | 6 +
   trunk/libs/geometry/test/extensions/algorithms/offset.cpp | 20 +-
   18 files changed, 275 insertions(+), 70 deletions(-)

Deleted: trunk/boost/geometry/algorithms/detail/overlay/dissolver.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/dissolver.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,638 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2010, Geodan, 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP
-
-
-#include <deque>
-#include <vector>
-
-#include <boost/range.hpp>
-
-#include <boost/geometry/core/tag.hpp>
-#include <boost/geometry/core/tags.hpp>
-#include <boost/geometry/core/point_type.hpp>
-#include <boost/geometry/core/ring_type.hpp>
-#include <boost/geometry/core/exterior_ring.hpp>
-#include <boost/geometry/core/interior_rings.hpp>
-
-#include <boost/geometry/algorithms/disjoint.hpp>
-#include <boost/geometry/algorithms/detail/disjoint.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
-#include <boost/geometry/algorithms/intersection.hpp>
-#include <boost/geometry/algorithms/union.hpp>
-#include <boost/geometry/algorithms/reverse.hpp>
-
-
-#include <boost/geometry/geometries/concepts/check.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DETAIL
-
-namespace detail { namespace inserter
-{
-
-
-template<typename Tag1, typename Tag2>
-struct insert_geometry
-{};
-
-template<>
-struct insert_geometry<ring_tag, polygon_tag>
-{
- template<typename Ring, typename Collection>
- static inline void apply(Ring const& ring, Collection& collection)
- {
- collection.resize(collection.size() + 1);
- geometry::exterior_ring(collection.back()) = ring;
- }
-};
-
-
-
-
-template<>
-struct insert_geometry<polygon_tag, polygon_tag>
-{
- template<typename Geometry, typename Collection>
- static inline void apply(Geometry const& geometry, Collection& collection)
- {
- collection.push_back(geometry);
- }
-};
-
-template<typename Geometry, typename Collection>
-inline void insert(Geometry const& geometry, Collection& collection)
-{
- insert_geometry
- <
- typename geometry::tag<Geometry>::type,
- typename geometry::tag
- <
- typename boost::range_value<Collection>::type
- >::type
- >::apply(geometry, collection);
-}
-
-}} // namespace detail::inserter
-
-
-
-namespace detail { namespace dissolver
-{
-
-class plusmin_policy
-{
- template
- <
- typename Geometry1,
- typename Geometry2,
- typename OutputCollection
- >
- static inline bool check_negative(Geometry1 a, Geometry2 b,
- OutputCollection& output_collection)
- {
- // Precondition: a = positive, b = negative
-
- // 1: make b positive to get proper intersection
- geometry::reverse(b);
- {
- // 2: Check if there is overlap
- OutputCollection difference;
- geometry::intersection(a, b, difference);
- if(difference.size() <= 0)
- {
- return false;
- }
- }
-
- // There is overlap and we want to remove it, by subtracting it from b
-
- //negative = true;
-
- typedef typename geometry::point_type<Geometry2>::type point_type;
- typedef overlay::turn_info<point_type> turn_info;
- std::deque<turn_info> turns;
-
- // Get (and stop on) any intersection
- detail::disjoint::disjoint_interrupt_policy policy;
- geometry::get_turns
- <
- false, false,
- overlay::assign_null_policy
- >(a, b, turns, policy);
-
- if (! policy.has_intersections)
- {
- // There is overlap but no intersections -> b is inside a.
- // So keep A and keep B, do not change anything
- return false;
- }
-
- // There are intersections.
- // 3: make a negative
- geometry::reverse(a); // now negative
-
- // This will calculate B minus A, result is then positive
- OutputCollection difference;
- geometry::intersection(a, b, difference);
-
- // Add original a to output (NOT necessary! TODO avoid this)
- {
- geometry::reverse(a); // positive again
- detail::inserter::insert(a, output_collection);
- }
-
-
- // Make negative output negative again
- typedef typename boost::range_iterator<OutputCollection>::type iterator_type;
- for(iterator_type it = boost::begin(difference);
- it != boost::end(difference);
- ++it)
- {
- geometry::reverse(*it);
- detail::inserter::insert(*it, output_collection);
- }
- return true;
- }
-
-
-public :
-
- template
- <
- typename Geometry1,
- typename Geometry2,
- typename OutputCollection
- >
- static inline bool apply(Geometry1 const& a, Geometry2 const& b,
- OutputCollection& output_collection)
- {
- typedef typename geometry::coordinate_type<Geometry2>::type coordinate_type;
- coordinate_type area_a = geometry::area(a);
- coordinate_type area_b = geometry::area(b);
-
- // DEBUG
- /*
- int n = boost::size(output_collection);
- typedef typename geometry::point_type<Geometry2>::type point_type;
- std::cout << "Combine "
- << area_a << " with " << " " << area_b
- << " { " << geometry::wkt(geometry::make_centroid<point_type>(a))
- << geometry::wkt(geometry::make_centroid<point_type>(b)) << " }"
- << std::endl;
- */
- // END DEBUG
-
- coordinate_type zero = coordinate_type();
- if (area_a > zero && area_b > zero)
- {
- geometry::union_(a, b, output_collection);
- return true;
- }
- else if (area_a > zero && area_b < zero)
- {
- return check_negative(a, b, output_collection);
- }
- else if (area_a < zero && area_b > zero)
- {
- return check_negative(b, a, output_collection);
- }
-
- // both negative (?) TODO
- // DEBUG
- /*
- for (int i = n; i < boost::size(output_collection); i++)
- {
- typedef typename geometry::point_type<Geometry2>::type point_type;
- std::cout << "Result "
- << geometry::area(output_collection[i])
- << " " << geometry::wkt(geometry::make_centroid<point_type>(output_collection[i]))
- << std::endl;
- }
- */
- // END DEBUG
- return false;
-
- }
-
-};
-
-
-template <typename CombinePolicy>
-struct dissolver_generic
-{
-
-
- // Small structure to access elements by index;
- // this avoids copying or accessing elements by address (pointer)
- template <typename Box>
- struct dissolve_helper
- {
- int source; // 0,1
- int index; // index in the original array
- bool dissolved;
- Box box;
- double area;
-
- dissolve_helper()
- {}
-
- dissolve_helper(int i, Box b, double a, int s)
- : source(s)
- , index(i)
- , dissolved(false)
- , box(b)
- , area(a)
- {}
- };
-
-
- struct get_geometry
- {
- template <typename Range>
- inline static typename boost::range_value<Range>::type const& apply(
- Range const& range, int index)
- {
- return range[index];
- }
- };
-
- template
- <
- typename Vector,
- typename HelperVector
- >
- static inline void init_helper(Vector const& v, HelperVector& helper,
- int index = 0, int source = 0)
- {
- typedef typename boost::range_value<Vector>::type value_type;
- typedef typename geometry::point_type<value_type>::type point_type;
- typedef model::box<point_type> box_type;
- for(typename boost::range_iterator<Vector const>::type
- it = boost::begin(v);
- it != boost::end(v);
- ++it, ++index)
- {
- helper.push_back(dissolve_helper<box_type>(index,
- geometry::make_envelope<box_type>(*it),
- geometry::area(*it),
- source));
- }
- }
-
- template
- <
- typename Element,
- typename Geometry1, typename Geometry2,
- typename OutputCollection
- >
- static inline bool call_policy(
- Element const& element1, Element const& element2,
- Geometry1 const& geometry1, Geometry2 const& geometry2
- , OutputCollection& output_collection)
- {
- if (! geometry::disjoint(geometry1, geometry2))
- {
- /*std::cout << "Process " << element1.source << "/" << element1.index
- << " and " << element2.source << "/" << element2.index
- << " (" << element2.dissolved << "," << element2.dissolved << ")"
- << std::endl;
- */
- return CombinePolicy::apply(geometry1, geometry2,
- output_collection);
- }
- return false;
- }
-
-
- template
- <
- int Dimension,
- typename HelperVector,
- typename IndexVector,
- typename InputRange,
- typename OutputCollection,
- typename Box
- >
- static inline bool divide_and_conquer(HelperVector& helper_vector
- , IndexVector& index_vector
- , InputRange const& input_range
- , OutputCollection& output_collection
- , Box const& total_box
- , bool& changed
- , int iteration = 0
- )
- {
- //std::cout << "divide_and_conquer " << iteration << std::endl;
- typedef typename geometry::coordinate_type<Box>::type coordinate_type;
- typedef typename boost::range_value<HelperVector>::type helper_type;
- typedef typename boost::range_iterator<IndexVector const>::type iterator_type;
-
- //if (boost::size(index_vector) >= 16 && iteration < 100)
- // Not yet using divide and conquer
- if (false)
- {
- // 1: separate box into 2 (either horizontally or vertically)
- Box lower_box = total_box, upper_box = total_box;
- coordinate_type two = 2.0;
- coordinate_type mid
- = (geometry::get<min_corner, Dimension>(total_box)
- + geometry::get<max_corner, Dimension>(total_box)) / two;
-
- geometry::set<max_corner, Dimension>(lower_box, mid);
- geometry::set<min_corner, Dimension>(upper_box, mid);
-
- // 2: divide indices into two sublists
- IndexVector lower_list, upper_list;
- for(iterator_type it = boost::begin(index_vector);
- it != boost::end(index_vector);
- ++it)
- {
- helper_type const& element = helper_vector[*it];
- if (! geometry::disjoint(lower_box, element.box))
- {
- lower_list.push_back(*it);
- }
- if (! geometry::disjoint(upper_box, element.box))
- {
- upper_list.push_back(*it);
- }
- }
-
- //std::cout << lower_list.size() << ", " << upper_list.size()<< std::endl;
-
- // 3: recursively call function (possibly divide in other dimension)
- divide_and_conquer<1 - Dimension>(helper_vector,
- lower_list, input_range, output_collection, lower_box, changed, iteration + 1);
- divide_and_conquer<1 - Dimension>(helper_vector,
- upper_list, input_range, output_collection, upper_box, changed, iteration + 1);
- return changed;
- }
-
- // There are less then 16 elements, handle them quadraticly
-
- int n = boost::size(output_collection);
-
- for(iterator_type it1 = boost::begin(index_vector);
- it1 != boost::end(index_vector);
- ++it1)
- {
- helper_type& element1 = helper_vector[*it1];
-
- bool unioned = false;
- for(iterator_type it2 = boost::begin(index_vector);
- ! unioned && it2 != it1;
- ++it2)
- {
- helper_type& element2 = helper_vector[*it2];
-
- // If they are NOT disjoint, union them
- if (! element1.dissolved
- && ! element2.dissolved
- && ! geometry::disjoint(element1.box, element2.box))
- {
- // Runtime type check here...
- if ((element1.source == 0 && element2.source == 0
- && call_policy
- (
- element1, element2,
- get_geometry::apply(input_range, element1.index),
- get_geometry::apply(input_range, element2.index),
- output_collection
- )
- )
- || (element1.source == 0 && element2.source == 1
- && call_policy
- (
- element1, element2,
- get_geometry::apply(input_range, element1.index),
- get_geometry::apply(output_collection, element2.index),
- output_collection
- )
- )
- || (element1.source == 1 && element2.source == 0
- && call_policy
- (
- element1, element2,
- get_geometry::apply(output_collection, element1.index),
- get_geometry::apply(input_range, element2.index),
- output_collection
- )
- )
- || (element1.source == 1 && element2.source == 1
- && call_policy
- (
- element1, element2,
- get_geometry::apply(output_collection, element1.index),
- get_geometry::apply(output_collection, element2.index),
- output_collection
- )
- )
- )
- {
- changed = true;
- element1.dissolved = true;
- element2.dissolved = true;
-
- unioned = true;
-/*std::cout << "Assign " << element1.source << "/" << element1.index
-<< " and " << element2.source << "/" << element2.index
-<< " (" << element2.dissolved << "," << element2.dissolved << ")"
-<< std::endl;
-*/
- }
- }
- }
- }
-
- // Append new records in output collection to helper class
- init_helper(std::make_pair(boost::begin(output_collection) + n,
- boost::end(output_collection)), helper_vector, n, 1);
-
- return changed;
- }
-
- template <typename T>
- static inline bool helper_dissolved(T const& t)
- {
- return t.dissolved;
- }
-
-
-
- template
- <
- typename InputRange,
- typename OutputCollection
- >
- static inline void apply(InputRange const& input_range
- , OutputCollection& output_collection
- )
- {
- typedef typename boost::range_value<OutputCollection>::type output_type;
-
- typedef typename geometry::point_type<output_type>::type point_type;
- typedef model::box<point_type> box_type;
- typedef dissolve_helper<box_type> dissolve_helper_type;
- typedef std::vector<dissolve_helper_type> helper_vector_type;
-
- // Vector with indices to both input_range (source 0) and output_collection (source 1)
- helper_vector_type helper_vector;
-
- // Vector with indices to helper-vector, for divide and conquer
- std::vector<int> index_vector;
-
-
- init_helper(input_range, helper_vector);
-
- // Fill intrusive list with copies, and determine bounding box
- box_type total_box;
- geometry::assign_inverse(total_box);
- int index = 0;
- for(typename boost::range_iterator<helper_vector_type const>::type
- it = boost::begin(helper_vector);
- it != boost::end(helper_vector);
- ++it, ++index)
- {
- index_vector.push_back(index);
- geometry::combine(total_box, it->box);
- }
-
- std::vector<output_type> unioned_collection;
-
- int size = 0, previous_size = 0;
- int n = 0;
-
- bool changed = false;
- while(divide_and_conquer<1>
- (helper_vector, index_vector, input_range, unioned_collection, total_box, changed) && n < 5)
- {
- // Remove everything which is already dissolved.
- helper_vector.erase
- (
- std::remove_if
- (
- helper_vector.begin(),
- helper_vector.end(),
- helper_dissolved<dissolve_helper_type>
- ),
- helper_vector.end()
- );
-
- previous_size = size;
- size = helper_vector.size();
- n = previous_size == size ? n + 1 : 0;
-
- // Re-initialize the list
- index_vector.clear();
- int index = 0;
- for(typename boost::range_iterator<helper_vector_type const>::type
- it = boost::begin(helper_vector);
- it != boost::end(helper_vector);
- ++it, ++index)
- {
- index_vector.push_back(index);
- }
-
- changed = false;
-
- //std::cout << " " << size;
- }
-
- // Add input+output to real output
- typedef typename boost::range_iterator<helper_vector_type>::type iterator_type;
- for(iterator_type it = boost::begin(helper_vector);
- it != boost::end(helper_vector);
- ++it)
- {
- if (! it->dissolved)
- {
- switch(it->source)
- {
- case 0 :
- detail::inserter::insert(
- get_geometry::apply(input_range, it->index),
- output_collection);
- break;
- case 1 :
- detail::inserter::insert(
- get_geometry::apply(unioned_collection, it->index),
- output_collection);
- break;
- }
- }
- }
- }
-};
-
-
-}} // namespace detail::dissolver
-#endif // DOXYGEN_NO_DETAIL
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-template
-<
- typename GeometryTag1,
- typename GeometryTag2,
- typename Policy
->
-struct dissolver
-{};
-
-
-template<typename Policy>
-struct dissolver<ring_tag, polygon_tag, Policy>
- : detail::dissolver::dissolver_generic<Policy>
-{};
-
-template<typename Policy>
-struct dissolver<polygon_tag, polygon_tag, Policy>
- : detail::dissolver::dissolver_generic<Policy>
-{};
-
-
-
-} // namespace dispatch
-#endif // DOXYGEN_NO_DISPATCH
-
-
-template
-<
- typename InputRange,
- typename OutputCollection
->
-inline void dissolver(InputRange const& input_range,
- OutputCollection& output_collection)
-{
- typedef typename boost::range_value<InputRange>::type geometry_in;
- typedef typename boost::range_value<OutputCollection>::type geometry_out;
- concept::check<geometry_in const>();
- concept::check<geometry_out>();
-
- dispatch::dissolver
- <
- typename tag<geometry_in>::type,
- typename tag<geometry_out>::type,
- detail::dissolver::plusmin_policy
- >::apply(input_range, output_collection);
-}
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP

Deleted: trunk/boost/geometry/algorithms/detail/overlay/split_rings.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/split_rings.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,562 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2010, Geodan, 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP
-
-#define BOOST_GEOMETRY_CHECK_SPLIT_RINGS
-
-
-#include <deque>
-#include <string>
-
-#include <boost/range.hpp>
-#include <boost/typeof/typeof.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
-
-#include <boost/geometry/core/point_type.hpp>
-#include <boost/geometry/core/ring_type.hpp>
-#include <boost/geometry/core/exterior_ring.hpp>
-#include <boost/geometry/core/interior_rings.hpp>
-#include <boost/geometry/util/math.hpp>
-
-#include <boost/geometry/algorithms/intersects.hpp>
-#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
-#include <boost/geometry/geometries/concepts/check.hpp>
-
-
-#if defined(BOOST_GEOMETRY_DEBUG_SPLIT_RINGS) || defined(BOOST_GEOMETRY_CHECK_SPLIT_RINGS)
-# include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
-#endif
-
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace split_rings
-{
-
-
-template <typename Range>
-struct split_range
-{
-/*
-
- 1 2
- +-------------+
- | 4 /
- | |\ /
- | | \/____ IP
- | | /\
- | |/ \
- | 3 \
- +-------------+
- 0,6 5
-
- - we want to split the range at the IP into two rings
- - At the IP: we have segment_indices 2,4 (result of get_turns_in_sections)
- - We want to copy and remove vertices 3,4
- --> count=4-2
- --> copy [3,5) -> copy(begin()+id1+1, begin()+id1+count+1)
- --> erase: idem
- --> insert(begin()+id1+1)
-
- --> we use id1+1
-
- After that, we need to update all indices AFTER IP.
- We removed two vertices here (4-2), and added one (the IP)
-
-*/
- static inline void apply(Range& range, Range& output
- , segment_identifier const& id1
- , segment_identifier const& id2
- , typename geometry::point_type<Range>::type const& point
- )
- {
- if (id1.ring_index == id2.ring_index
- && id1.multi_index == id2.multi_index)
- {
- int mn = (std::min)(id1.segment_index, id2.segment_index);
- mn++;
-
- typename boost::range_iterator<Range>::type first = range.begin();
- first += mn;
-
- typename boost::range_iterator<Range>::type last = first;
- last += geometry::math::abs(id2.segment_index - id1.segment_index);
-
- // Create splitted ring
- output.push_back(point);
- std::copy(first, last, std::back_inserter(output));
- output.push_back(point);
-
- // Remove the loop from the range
- range.erase(first, last);
-
- // Iterator is invalid because of erasure, construct again
- range.insert(range.begin() + mn, point);
- }
- }
-};
-
-
-/*template <typename Polygon>
-struct split_polygon
-{
- typedef typename geometry::ring_type<Polygon>::type ring_type;
-
- static inline void apply(Polygon& polygon, ring_type& splitted
- , segment_identifier const& id1
- , segment_identifier const& id2
- , typename geometry::point_type<Polygon>::type const& point
- )
- {
- if (id1.ring_index == id2.ring_index
- && id1.multi_index == id2.multi_index)
- {
- ring_type& ring = id1.ring_index < 0
- ? geometry::exterior_ring(polygon)
- : geometry::interior_rings(polygon)[id1.ring_index];
-
- split_range<ring_type>::apply(ring, splitted, id1, id2, point);
- }
- }
-};*/
-
-
-template <typename Tag, typename Geometry>
-struct split
-{};
-
-
-template <typename Ring>
-struct split<ring_tag, Ring> : split_range<Ring>
-{};
-
-
-//template <typename Polygon>
-//struct split<polygon_tag, Polygon> : split_polygon<Polygon>
-//{};
-
-
-
-
-
-
-template <typename Tag, typename RingCollection, typename Geometry>
-struct insert_rings
-{};
-
-
-template <typename RingCollection, typename Ring>
-struct insert_rings<ring_tag, RingCollection, Ring>
-{
- static inline void apply(RingCollection& ring_collection, Ring const& ring)
- {
-#ifdef BOOST_GEOMETRY_DEBUG_SPLIT_RINGS
-std::cout << geometry::wkt(ring)
- << " ; " << geometry::area(ring)
- << " " << ring.size()
- //<< " at " << geometry::wkt(first.point)
- << std::endl;
-/*std::cout << "geometry "
- << " " << geometry::area(geometry)
- << std::endl;*/
-#endif
-
- ring_collection.push_back(ring);
- }
-};
-
-
-template <typename RingCollection, typename Polygon>
-struct insert_rings<polygon_tag, RingCollection, Polygon>
-{
- static inline void apply(RingCollection& ring_collection, Polygon const& polygon)
- {
- ring_collection.push_back(exterior_ring(polygon));
-
- typename interior_return_type<Polygon const>::type rings
- = interior_rings(polygon);
- for (BOOST_AUTO(it, boost::begin(rings)); it != boost::end(rings); ++it)
- {
-#ifdef BOOST_GEOMETRY_DEBUG_SPLIT_RINGS
-std::cout << geometry::wkt(*it)
- << " ; " << geometry::area(*it)
- << " " << it->size()
- //<< " at " << geometry::wkt(first.point)
- << std::endl;
-/*std::cout << "geometry "
- << " " << geometry::area(geometry)
- << std::endl;*/
-#endif
-
- ring_collection.push_back(*it);
- }
- }
-};
-
-
-/// Sorts vector of turns (results from get_turns)
-template <typename Turn>
-struct sorter
-{
- inline bool operator()(Turn const& left, Turn const& right) const
- {
- if (left.count_between != right.count_between)
- {
- return left.count_between < right.count_between;
- }
-
- if (left.operations[0].seg_id.segment_index
- == right.operations[0].seg_id.segment_index)
- {
- return left.operations[0].distance < right.operations[0].distance;
- }
- return left.operations[0].seg_id.segment_index
- < right.operations[0].seg_id.segment_index;
- }
-};
-
-/// Turn operation with additional distance field
-template <typename P>
-struct split_turn_operation : public detail::overlay::turn_operation
-{
- inline split_turn_operation()
- : detail::overlay::turn_operation()
- , distance(geometry::make_distance_result<distance_type>(0))
- {}
-
- typedef typename distance_result<P, P>::type distance_type;
- distance_type distance; // distance-measurement from segment.first to IP
-};
-
-
-/// Turn information with distance fields, plus "count_between" field
-template <typename P>
-struct split_turn_info : detail::overlay::turn_info
- <
- P, split_turn_operation<P>
- >
-{
- //std::string history;
- int count_between; // counts number of segments between ring in intersection
-
- split_turn_info()
- : count_between(0)
- {}
-};
-
-
-/// Policy to calculate distance
-struct split_calculate_distance_policy
-{
- template <typename Point1, typename Point2, typename Info>
- static inline void apply(Info& info, Point1 const& p1, Point2 const& p2)
- {
- info.operations[0].distance
- = boost::geometry::distance(info.point, p1);
- info.operations[1].distance
- = boost::geometry::distance(info.point, p2);
- }
-
-};
-
-
-
-template <typename Range, typename RingCollection>
-class range_split_rings
-{
- typedef typename geometry::tag<Range>::type tag;
- typedef typename geometry::point_type<Range>::type point_type;
-
- typedef typename geometry::ring_type<Range>::type ring_type;
-
-
- typedef typename strategy_intersection
- <
- typename cs_tag<point_type>::type,
- point_type,
- point_type,
- point_type
- >::segment_intersection_strategy_type strategy;
-
-
-
-
-#ifdef BOOST_GEOMETRY_DEBUG_SPLIT_RINGS
- template <typename Turns>
- static void report(Turns const& turns, std::string const& header)
- {
- if (turns.empty())
- {
- return;
- }
- std::cout << header << std::endl;
- BOOST_FOREACH(typename boost::range_value<Turns>::type const& turn, turns)
- {
- std::cout
- << "I at " << turn.operations[0].seg_id.segment_index
- << "/" << turn.operations[1].seg_id.segment_index
- << " (" << turn.count_between
- << ") " << turn.operations[0].distance
- << "/" << turn.operations[1].distance
- << " " << geometry::wkt(turn.point) << std::endl;
- }
- }
-#endif
-
- template <typename Operation>
- static bool adapt(Operation& op, Operation const& first, Operation const& second)
- {
- if (first.seg_id.segment_index > second.seg_id.segment_index)
- {
- return adapt(op, second, first);
- }
- if (op.seg_id.segment_index > first.seg_id.segment_index
- || (op.seg_id.segment_index == first.seg_id.segment_index
- && op.distance > first.distance)
- )
- {
- if (op.seg_id.segment_index < second.seg_id.segment_index
- || (op.seg_id.segment_index == second.seg_id.segment_index
- && op.distance < second.distance)
- )
- {
- // mark for deletion
- op.seg_id.segment_index = -1;
- return true;
- }
- else
- {
- op.seg_id.segment_index -= (second.seg_id.segment_index - first.seg_id.segment_index - 1);
- }
- }
- return false;
- }
-
-
-
-
-
- static void call(Range range, RingCollection& ring_collection)
- {
- typedef split_turn_info<point_type> turn_info;
-
- typedef std::deque<turn_info> turns_type;
- turns_type turns;
-
- detail::get_turns::no_interrupt_policy policy;
- geometry::get_turns
- <
- split_calculate_distance_policy
- >(range, turns, policy);
-
- //report(turns, "intersected");
-
- // Make operations[0].seg_id always the smallest, to sort properly
- // Also calculate the number of segments in between
- for (typename boost::range_iterator<turns_type>::type
- it = boost::begin(turns);
- it != boost::end(turns);
- ++it)
- {
- turn_info& turn = *it;
- if (turn.operations[0].seg_id.segment_index > turn.operations[1].seg_id.segment_index)
- {
- std::swap(turn.operations[0], turn.operations[1]);
- }
- // ...[1] > ...[0]
- // check count
- int const between1 = turn.operations[1].seg_id.segment_index
- - turn.operations[0].seg_id.segment_index;
- /*
- NOTE: if we would use between2 here, we have to adapt other code as well,
- such as adaption of the indexes; splitting of the range, etc.
- int between2 = boost::size(range) + turn.operations[0].seg_id.segment_index
- - turn.operations[1].seg_id.segment_index;
- turn.count_between = (std::min)(between1, between2);
- */
-
- turn.count_between = between1;
- }
- //report(turns, "swapped");
-
- std::sort(turns.begin(), turns.end(), sorter<turn_info>());
- //report(turns, "sorted");
-
-
- while(turns.size() > 0)
- {
- // Process first turn
- turn_info const& turn = turns.front();
-
- split_turn_operation<point_type> const& first_op = turn.operations[0];
- split_turn_operation<point_type> const& second_op = turn.operations[1];
- bool do_split = first_op.seg_id.segment_index >= 0
- && second_op.seg_id.segment_index >= 0;
-
- if (do_split)
- {
-#ifdef BOOST_GEOMETRY_CHECK_SPLIT_RINGS
- ring_type copy = range; // TEMP, for check
-#endif
- ring_collection.resize(ring_collection.size() + 1);
- split<ring_tag, Range>::apply(range, ring_collection.back(),
- turn.operations[0].seg_id, turn.operations[1].seg_id,
- turn.point);
-
-#ifdef BOOST_GEOMETRY_CHECK_SPLIT_RINGS
- {
- std::deque<turn_info> splitted_turns;
- geometry::get_turns
- <
- split_calculate_distance_policy
- >(ring_collection.back(),
- splitted_turns,
- detail::get_turns::no_interrupt_policy());
-
- if (splitted_turns.size() > 0)
- {
- std::cout << "TODO Still intersecting! " << splitted_turns.size() << std::endl;
- //std::cout << " " << geometry::wkt(copy) << std::endl;
- //std::cout << " " << geometry::wkt(splitted) << std::endl;
- //report(splitted_turns, "NOT OK");
- //std::cout << std::endl;
- }
- }
-#endif
-
- }
-
- turns.pop_front();
-
-
- if (do_split)
- {
- for (typename boost::range_iterator<turns_type>::type
- rest = boost::begin(turns);
- rest != boost::end(turns);
- ++rest)
- {
- //turn_info copy = turn;
- if (adapt(rest->operations[0], first_op, second_op)
- || adapt(rest->operations[1], first_op, second_op))
- {
- /**
- std::cout << " ADAPTED "
- << copy.operations[0].seg_id.segment_index << "/" << copy.operations[1].seg_id.segment_index
- << " "
- << geometry::wkt(copy.point) << std::endl;
- **/
- }
- }
- }
- while(turns.size() > 0
- && (turns.front().operations[0].seg_id.segment_index < 0
- || turns.front().operations[1].seg_id.segment_index < 0))
- {
- turns.pop_front();
- }
- }
-
- // Add the (possibly untouched) input range
- insert_rings<ring_tag, RingCollection, Range>::apply(ring_collection, range);
- }
-
-
-public :
- // Copy by value of range is intentional, copy is modified here
- static inline void apply(Range range, RingCollection& ring_collection)
- {
- call(range, ring_collection);
- }
-};
-
-
-template <typename Polygon, typename RingCollection>
-struct polygon_split_rings
-{
- typedef range_split_rings
- <
- typename ring_type<Polygon>::type,
- RingCollection
- > per_ring;
-
- static inline void apply(Polygon const& polygon, RingCollection& ring_collection)
- {
- per_ring::apply(exterior_ring(polygon), ring_collection);
- for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
- it != boost::end(interior_rings(polygon));
- ++it)
- {
- per_ring::apply(*it, ring_collection);
- }
- }
-};
-
-
-}} // namespace detail::split_rings
-#endif // DOXYGEN_NO_DETAIL
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-template
-<
- typename GeometryTag,
- typename Geometry,
- typename RingCollection
->
-struct split_rings
-{};
-
-
-template<typename Polygon, typename RingCollection>
-struct split_rings<polygon_tag, Polygon, RingCollection>
- : detail::split_rings::polygon_split_rings<Polygon, RingCollection>
-{};
-
-
-template<typename Ring, typename RingCollection>
-struct split_rings<ring_tag, Ring, RingCollection>
- : detail::split_rings::range_split_rings<Ring, RingCollection>
-{};
-
-
-} // namespace dispatch
-#endif // DOXYGEN_NO_DISPATCH
-
-
-template
-<
- typename Geometry,
- typename RingCollection
->
-inline void split_rings(Geometry const& geometry, RingCollection& out)
-{
- concept::check<Geometry const>();
- concept::check<typename boost::range_value<RingCollection>::type>();
-
- dispatch::split_rings
- <
- typename tag<Geometry>::type,
- Geometry,
- RingCollection
- >::apply(geometry, out);
-}
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP

Deleted: trunk/boost/geometry/algorithms/dissolve.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/dissolve.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,216 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2010, Geodan, 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_ALGORITHMS_DISSOLVE_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DISSOLVE_HPP
-
-
-#include <map>
-#include <vector>
-
-#include <boost/range.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
-#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
-#include <boost/geometry/algorithms/detail/overlay/enrichment_info.hpp>
-#include <boost/geometry/algorithms/detail/overlay/traversal_info.hpp>
-#include <boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp>
-
-#include <boost/geometry/algorithms/detail/point_on_border.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp>
-#include <boost/geometry/algorithms/detail/overlay/traverse.hpp>
-#include <boost/geometry/algorithms/detail/overlay/assemble.hpp>
-
-#include <boost/geometry/algorithms/convert.hpp>
-
-#include <boost/geometry/geometries/concepts/check.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace dissolve
-{
-
-
-template <typename Geometry, typename GeometryOut>
-struct dissolve_ring_or_polygon
-{
- template <typename OutputIterator>
- static inline OutputIterator apply(Geometry const& geometry,
- OutputIterator out)
- {
- // Get the self-intersection points, including turns
- typedef detail::overlay::traversal_turn_info
- <
- typename point_type<Geometry>::type
- > turn_info;
-
- std::vector<turn_info> turns;
- detail::get_turns::no_interrupt_policy policy;
- geometry::get_turns
- <
- detail::overlay::calculate_distance_policy
- >(geometry, turns, policy);
-
- // The dissolve process is not necessary if there are no turns at all
-
- if (boost::size(turns) > 0)
- {
- typedef typename ring_type<Geometry>::type ring_type;
- typedef std::vector<ring_type> out_vector;
- out_vector rings;
-
- // Enrich the turns
- typedef typename strategy_side
- <
- typename cs_tag<Geometry>::type
- >::type side_strategy_type;
-
- enrich_intersection_points<false, false>(turns,
- detail::overlay::operation_union,
- geometry, geometry,
- side_strategy_type());
-
-
- // Traverse the polygons twice for union...
- traverse<false, false>(geometry, geometry,
- detail::overlay::operation_union,
- turns, rings);
-
- clear_visit_info(turns);
-
- enrich_intersection_points<false, false>(turns,
- detail::overlay::operation_intersection,
- geometry, geometry,
- side_strategy_type());
-
-
- // ... and for intersection
- traverse<false, false>(geometry, geometry,
- detail::overlay::operation_intersection,
- turns, rings);
-
- std::map<ring_identifier, int> map;
- map_turns(map, turns);
- return detail::overlay::assemble<GeometryOut>(rings, map,
- geometry, geometry, overlay_dissolve, true, false, out);
- }
- else
- {
- GeometryOut g;
- geometry::convert(geometry, g);
- *out++ = g;
- return out;
- }
- }
-};
-
-
-
-}} // namespace detail::dissolve
-#endif // DOXYGEN_NO_DETAIL
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-template
-<
- typename GeometryTag,
- typename GeometryOutTag,
- typename Geometry,
- typename GeometryOut
->
-struct dissolve
-{};
-
-
-template<typename Polygon, typename PolygonOut>
-struct dissolve<polygon_tag, polygon_tag, Polygon, PolygonOut>
- : detail::dissolve::dissolve_ring_or_polygon<Polygon, PolygonOut>
-{};
-
-
-template<typename Ring, typename RingOut>
-struct dissolve<ring_tag, ring_tag, Ring, RingOut>
- : detail::dissolve::dissolve_ring_or_polygon<Ring, RingOut>
-{};
-
-
-} // namespace dispatch
-#endif // DOXYGEN_NO_DISPATCH
-
-
-
-/*!
- \brief Removes self intersections from a geometry
- \ingroup overlay
- \tparam Geometry geometry type
- \tparam OutputIterator type of intersection container
- (e.g. vector of "intersection/turn point"'s)
- \param geometry first geometry
- \param out output iterator getting dissolved geometry
- \note Currently dissolve with a (multi)linestring does NOT remove internal
- overlap, it only tries to connect multiple line end-points.
- TODO: we should change this behaviour and add a separate "connect"
- algorithm, and let dissolve work like polygon.
- */
-template
-<
- typename GeometryOut,
- typename Geometry,
- typename OutputIterator
->
-inline OutputIterator dissolve_inserter(Geometry const& geometry, OutputIterator out)
-{
- concept::check<Geometry const>();
- concept::check<GeometryOut>();
-
- return dispatch::dissolve
- <
- typename tag<Geometry>::type,
- typename tag<GeometryOut>::type,
- Geometry,
- GeometryOut
- >::apply(geometry, out);
-}
-
-
-template
-<
- typename Geometry,
- typename Collection
->
-inline void dissolve(Geometry const& geometry, Collection& output_collection)
-{
- concept::check<Geometry const>();
-
- typedef typename boost::range_value<Collection>::type geometry_out;
-
- concept::check<geometry_out>();
-
- dispatch::dissolve
- <
- typename tag<Geometry>::type,
- typename tag<geometry_out>::type,
- Geometry,
- geometry_out
- >::apply(geometry, std::back_inserter(output_collection));
-}
-
-
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_ALGORITHMS_DISSOLVE_HPP

Modified: trunk/boost/geometry/extensions/algorithms/connect.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/connect.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/connect.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -38,17 +38,17 @@
 template <typename Point>
 struct node
 {
- Point point;
     int index;
     bool is_from;
+ Point point;
 
- node(int i, bool f, Point const& p)
+ node(int i, bool f, Point const& p)
         : index(i)
         , is_from(f)
         , point(p)
     {}
 
- node()
+ node()
         : index(-1)
         , is_from(false)
     {}
@@ -83,7 +83,7 @@
 
 
     inline bool find_start(node<Point>& object,
- std::map<int, bool>& included,
+ std::map<int, bool>& included,
             int expected_count = 1)
     {
         for (map_iterator_type it = map.begin();
@@ -211,7 +211,7 @@
     {}
 
     inline bool find_start(node<Point>& object,
- std::map<int, bool>& included,
+ std::map<int, bool>& included,
             int expected_count = 1)
     {
         for (map_iterator_type it = map.begin();
@@ -357,11 +357,11 @@
     {
         std::cout << geometry::dsv(it->first) << " => " ;
         std::vector<node<point_type> > const& range =it->second;
- for ( std::vector<node<point_type> >::const_iterator
+ for (typename std::vector<node<point_type> >::const_iterator
             vit = boost::begin(range); vit != boost::end(range); ++vit)
         {
- std::cout
- << " (" << vit->index
+ std::cout
+ << " (" << vit->index
                 << ", " << (vit->is_from ? "F" : "T")
                 << ")"
                 ;
@@ -451,7 +451,7 @@
                 included[closest.index] = true;
                 copy(multi[closest.index], current, closest.is_from);
             }
- else if ((included.size() != boost::size(multi)))
+ else if ((included.size() != std::size_t(boost::size(multi))))
             {
                 // Get one which is NOT found and go again
                 node<point_type> next;
@@ -500,7 +500,7 @@
 struct connect<multi_linestring_tag, linestring_tag, Multi, GeometryOut, Policy>
     : detail::connect::connect_multi_linestring
         <
- Multi,
+ Multi,
             GeometryOut,
             Policy
>
@@ -526,7 +526,9 @@
     typedef detail::connect::map_policy
         <
             typename point_type<Geometry>::type
- > policy;
+ > policy_type;
+
+ policy_type policy;
 
     dispatch::connect
     <
@@ -534,8 +536,8 @@
         typename tag<geometry_out>::type,
         Geometry,
         geometry_out,
- policy
- >::apply(geometry, policy(), std::back_inserter(output_collection));
+ policy_type
+ >::apply(geometry, policy, std::back_inserter(output_collection));
 }
 
 
@@ -545,7 +547,7 @@
     typename Geometry,
     typename Collection
>
-inline void connect(Geometry const& geometry, Collection& output_collection,
+inline void connect(Geometry const& geometry, Collection& output_collection,
             typename coordinate_type<Geometry>::type const& limit)
 {
     typedef typename boost::range_value<Collection>::type geometry_out;
@@ -556,8 +558,9 @@
     typedef detail::connect::fuzzy_policy
         <
             typename point_type<Geometry>::type
- > policy;
+ > policy_type;
 
+ policy_type policy(limit);
 
     dispatch::connect
     <
@@ -565,8 +568,8 @@
         typename tag<geometry_out>::type,
         Geometry,
         geometry_out,
- policy
- >::apply(geometry, policy(limit), std::back_inserter(output_collection));
+ policy_type
+ >::apply(geometry, policy, std::back_inserter(output_collection));
 }
 
 

Copied: trunk/boost/geometry/extensions/algorithms/detail/overlay/dissolver.hpp (from r68727, /trunk/boost/geometry/algorithms/detail/overlay/dissolver.hpp)
==============================================================================
--- /trunk/boost/geometry/algorithms/detail/overlay/dissolver.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/detail/overlay/dissolver.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -5,8 +5,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP
 
 
 #include <deque>
@@ -635,4 +635,4 @@
 }} // namespace boost::geometry
 
 
-#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DETAIL_OVERLAY_DISSOLVER_HPP

Copied: trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp (from r68727, /trunk/boost/geometry/algorithms/detail/overlay/split_rings.hpp)
==============================================================================
--- /trunk/boost/geometry/algorithms/detail/overlay/split_rings.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -5,8 +5,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP
 
 #define BOOST_GEOMETRY_CHECK_SPLIT_RINGS
 
@@ -559,4 +559,4 @@
 }} // namespace boost::geometry
 
 
-#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP

Copied: trunk/boost/geometry/extensions/algorithms/dissolve.hpp (from r68727, /trunk/boost/geometry/algorithms/dissolve.hpp)
==============================================================================
--- /trunk/boost/geometry/algorithms/dissolve.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/dissolve.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -5,8 +5,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_ALGORITHMS_DISSOLVE_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DISSOLVE_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DISSOLVE_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DISSOLVE_HPP
 
 
 #include <map>
@@ -213,4 +213,4 @@
 
 }} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_ALGORITHMS_DISSOLVE_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DISSOLVE_HPP

Copied: trunk/boost/geometry/extensions/multi/algorithms/dissolve.hpp (from r68727, /trunk/boost/geometry/multi/algorithms/dissolve.hpp)
==============================================================================
--- /trunk/boost/geometry/multi/algorithms/dissolve.hpp (original)
+++ trunk/boost/geometry/extensions/multi/algorithms/dissolve.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -5,8 +5,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DISSOLVE_HPP
-#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DISSOLVE_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_MULTI_ALGORITHMS_DISSOLVE_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_MULTI_ALGORITHMS_DISSOLVE_HPP
 
 
 #include <vector>
@@ -16,10 +16,10 @@
 #include <boost/geometry/multi/core/tags.hpp>
 #include <boost/geometry/multi/core/point_type.hpp>
 
-#include <boost/geometry/algorithms/dissolve.hpp>
 #include <boost/geometry/algorithms/union.hpp>
 
-#include <boost/geometry/algorithms/detail/overlay/dissolver.hpp>
+#include <boost/geometry/extensions/algorithms/dissolve.hpp>
+#include <boost/geometry/extensions/algorithms/detail/overlay/dissolver.hpp>
 
 
 namespace boost { namespace geometry
@@ -95,4 +95,4 @@
 
 }} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DISSOLVE_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_MULTI_ALGORITHMS_DISSOLVE_HPP

Modified: trunk/boost/geometry/geometry.hpp
==============================================================================
--- trunk/boost/geometry/geometry.hpp (original)
+++ trunk/boost/geometry/geometry.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -41,7 +41,6 @@
 #include <boost/geometry/algorithms/convex_hull.hpp>
 #include <boost/geometry/algorithms/correct.hpp>
 #include <boost/geometry/algorithms/difference.hpp>
-#include <boost/geometry/algorithms/dissolve.hpp>
 #include <boost/geometry/algorithms/distance.hpp>
 #include <boost/geometry/algorithms/envelope.hpp>
 #include <boost/geometry/algorithms/for_each.hpp>

Deleted: trunk/boost/geometry/multi/algorithms/dissolve.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/dissolve.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,98 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2010, Geodan, 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DISSOLVE_HPP
-#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DISSOLVE_HPP
-
-
-#include <vector>
-
-#include <boost/range.hpp>
-
-#include <boost/geometry/multi/core/tags.hpp>
-#include <boost/geometry/multi/core/point_type.hpp>
-
-#include <boost/geometry/algorithms/dissolve.hpp>
-#include <boost/geometry/algorithms/union.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/dissolver.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace dissolve
-{
-
-template <typename Multi, typename GeometryOut>
-struct dissolve_multi
-{
- template <typename OutputIterator>
- static inline OutputIterator apply(Multi const& multi, OutputIterator out)
- {
- typedef typename boost::range_value<Multi>::type polygon_type;
- typedef typename boost::range_iterator<Multi const>::type iterator_type;
-
- // Step 1: dissolve all polygons in the multi-polygon, independantly
- std::vector<GeometryOut> step1;
- for (iterator_type it = boost::begin(multi);
- it != boost::end(multi);
- ++it)
- {
- dissolve_ring_or_polygon
- <
- polygon_type,
- GeometryOut
- >::apply(*it, std::back_inserter(step1));
- }
-
- // Step 2: remove mutual overlap
- {
- std::vector<GeometryOut> step2; // TODO avoid this, output to "out", if possible
- detail::dissolver::dissolver_generic<detail::dissolver::plusmin_policy>::apply(step1, step2);
- for (typename std::vector<GeometryOut>::const_iterator it = step2.begin();
- it != step2.end(); ++it)
- {
- *out++ = *it;
- }
- }
-
- return out;
- }
-};
-
-// Dissolving multi-linestring is currently moved to extensions/algorithms/connect,
-// because it is actually different from dissolving of polygons.
-// To be decided what the final behaviour/name is.
-
-}} // namespace detail::dissolve
-#endif
-
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-
-template<typename Multi, typename GeometryOut>
-struct dissolve<multi_polygon_tag, polygon_tag, Multi, GeometryOut>
- : detail::dissolve::dissolve_multi<Multi, GeometryOut>
-{};
-
-
-
-} // namespace dispatch
-#endif // DOXYGEN_NO_DISPATCH
-
-
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DISSOLVE_HPP

Modified: trunk/boost/geometry/multi/multi.hpp
==============================================================================
--- trunk/boost/geometry/multi/multi.hpp (original)
+++ trunk/boost/geometry/multi/multi.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -27,7 +27,6 @@
 #include <boost/geometry/multi/algorithms/clear.hpp>
 #include <boost/geometry/multi/algorithms/convex_hull.hpp>
 #include <boost/geometry/multi/algorithms/correct.hpp>
-#include <boost/geometry/multi/algorithms/dissolve.hpp>
 #include <boost/geometry/multi/algorithms/distance.hpp>
 #include <boost/geometry/multi/algorithms/envelope.hpp>
 #include <boost/geometry/multi/algorithms/equals.hpp>

Modified: trunk/boost/geometry/strategies/buffer.hpp
==============================================================================
--- trunk/boost/geometry/strategies/buffer.hpp (original)
+++ trunk/boost/geometry/strategies/buffer.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -204,6 +204,8 @@
 #endif
 
 
+ typedef typename coordinate_type<PointIn>::type coordinate_type;
+
     template <typename Ring>
     inline void apply(PointIn const& ip, PointIn const& vertex,
                 PointIn const& perp1, PointIn const& perp2,

Modified: trunk/libs/geometry/doc/make_qbk.py
==============================================================================
--- trunk/libs/geometry/doc/make_qbk.py (original)
+++ trunk/libs/geometry/doc/make_qbk.py 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -57,7 +57,7 @@
 
 algorithms = ["append", "assign", "make", "clear"
     , "area", "buffer", "centroid", "combine", "convert", "correct"
- , "convex_hull", "difference", "disjoint", "dissolve", "distance"
+ , "convex_hull", "difference", "disjoint", "distance"
     , "envelope", "equals", "for_each", "intersection", "intersects"
     , "length", "num_geometries", "num_interior_rings", "num_points"
     , "overlaps", "perimeter", "reverse", "simplify", "sym_difference"

Modified: trunk/libs/geometry/doc/quickref.xml
==============================================================================
--- trunk/libs/geometry/doc/quickref.xml (original)
+++ trunk/libs/geometry/doc/quickref.xml 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -344,10 +344,6 @@
      <member><link linkend="geometry.reference.algorithms.difference">difference</link></member>
      <member><link linkend="geometry.reference.algorithms.sym_difference">sym_difference</link></member>
     </simplelist>
- <bridgehead renderas="sect3">Dissolve</bridgehead>
- <simplelist type="vert" columns="1">
- <member><link linkend="geometry.reference.algorithms.dissolve">dissolve</link></member>
- </simplelist>
     <bridgehead renderas="sect3">Envelope</bridgehead>
     <simplelist type="vert" columns="1">
      <member><link linkend="geometry.reference.algorithms.envelope">envelope</link></member>

Modified: trunk/libs/geometry/doc/reference.qbk
==============================================================================
--- trunk/libs/geometry/doc/reference.qbk (original)
+++ trunk/libs/geometry/doc/reference.qbk 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -92,10 +92,6 @@
 [include reference/disjoint.qbk]
 [endsect]
 
-[section:dissolve dissolve]
-[include reference/dissolve.qbk]
-[endsect]
-
 
 [section:distance distance]
 [include reference/distance.qbk]

Deleted: trunk/libs/geometry/doc/reference/dissolve.qbk
==============================================================================
--- trunk/libs/geometry/doc/reference/dissolve.qbk 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,15 +0,0 @@
-[/============================================================================
- Boost.Geometry (aka GGL, Generic Geometry Library)
-
- Copyright (c) 2009-2011 Barend Gehrels, Geodan, Amsterdam, the Netherlands.
- Copyright (c) 2009-2011 Mateusz Loskot (mateusz_at_[hidden])
- Copyright (c) 2009-2011 Bruno Lalande, Paris, France.
-
- Use, modification and distribution is subject to the Boost Software License,
- Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================/]
-
-
-[/ Generated by doxygen_xml2qbk, don't change, will be overwritten automatically]
-[/ Generated from doxy/doxygen_output/xml/group__dissolve.xml]

Modified: trunk/libs/geometry/test/algorithms/algorithms_tests.sln
==============================================================================
--- trunk/libs/geometry/test/algorithms/algorithms_tests.sln (original)
+++ trunk/libs/geometry/test/algorithms/algorithms_tests.sln 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -40,8 +40,6 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perimeter", "perimeter.vcproj", "{EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "is_convex", "is_convex.vcproj", "{65EAD0CE-1AC7-4997-B618-55712AD7D8EA}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "union", "union.vcproj", "{CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "overlaps", "overlaps.vcproj", "{30C37854-9ED6-4C1E-97FB-BF8637BD5811}"
@@ -144,10 +142,6 @@
                 {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Debug|Win32.Build.0 = Debug|Win32
                 {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Release|Win32.ActiveCfg = Release|Win32
                 {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Release|Win32.Build.0 = Release|Win32
- {65EAD0CE-1AC7-4997-B618-55712AD7D8EA}.Debug|Win32.ActiveCfg = Debug|Win32
- {65EAD0CE-1AC7-4997-B618-55712AD7D8EA}.Debug|Win32.Build.0 = Debug|Win32
- {65EAD0CE-1AC7-4997-B618-55712AD7D8EA}.Release|Win32.ActiveCfg = Release|Win32
- {65EAD0CE-1AC7-4997-B618-55712AD7D8EA}.Release|Win32.Build.0 = Release|Win32
                 {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Debug|Win32.ActiveCfg = Debug|Win32
                 {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Debug|Win32.Build.0 = Debug|Win32
                 {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Release|Win32.ActiveCfg = Release|Win32

Deleted: trunk/libs/geometry/test/algorithms/dissolve.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/dissolve.cpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,133 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library) test file
-//
-// Copyright Barend Gehrels 2010, Geodan, 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-//#define BOOST_GEOMETRY_DEBUG_ENRICH
-//#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER
-
-#include <geometry_test_common.hpp>
-
-#include <algorithms/test_dissolve.hpp>
-
-
-template <typename P>
-void test_all()
-{
- typedef bg::model::ring<P> ring;
- typedef bg::model::polygon<P> polygon;
-
- // Simplex
- test_one<polygon, polygon>("1",
- "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))",
- 0, 6, 8);
-
- // Self intersecting
- test_one<polygon, polygon>("2",
- "POLYGON((1 2,1 1,2 1,2 2.25,3 2.25,3 0,0 0,0 3,3 3,2.75 2,1 2))",
- 1, 12, 7.9296875);
-
- // Self intersecting in last segment
- test_one<polygon, polygon>("3",
- "POLYGON((0 2,2 4,2 0,4 2,0 2))",
- 0, 4, 2.0);
-
- // Self tangent
- test_one<polygon, polygon>("4",
- "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))",
- 0, 8, 8.0);
-
-
- // Self tangent in corner
- test_one<polygon, polygon>("5",
- "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))",
- 0, 8, 12.0);
-
-
- // With spike
- test_one<polygon, polygon>("6",
- "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))",
- 0, 6, 16);
-
-
- // Non intersection, but with duplicate
- test_one<polygon, polygon>("d1",
- "POLYGON((0 0,0 4,4 0,4 0,0 0))",
- 0, 4, 8);
-
-
- // With many duplicates
- test_one<polygon, polygon>("d2",
- "POLYGON((0 0,0 1,0 1,0 1,0 2,0 2,0 3,0 3,0 3,0 3,0 4,2 4,2 4,4 4,4 0,4 0,3 0,3 0,3 0,3 0,3 0,0 0))",
- 0, 10, 16);
-
- // Hole: interior tangent to exterior
- test_one<polygon, polygon>("h1",
- "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))",
- 0, 6, 16);
-
- // Hole: interior intersecting exterior
- test_one<polygon, polygon>("h2",
- "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,5 4,1 1))",
- 0, 8, 16.25);
-
- // Hole: two intersecting holes
- test_one<polygon, polygon>("h3",
- "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,3 3,3 1,1 1),(2 2,2 3.5,3.5 3.5,3.5 2,2 2))",
- 0, 5, 16);
-
- // Hole: self-intersecting hole
- test_one<polygon, polygon>("h4",
- "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,3 3,3 2.5,1 3.5,1.5 3.5,1 1))",
- 1, 9, 14.484848484848484);
-
- // See power point
- test_one<polygon, polygon>("case_1",
- "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))",
- 0, 7, 50.48056402439);
-/*
- // Mail
-
- // See power point, and http://en.wikipedia.org/wiki/Pentagram
- test_one<polygon, polygon>("pentagram",
- "POLYGON((5 0,2.5 9,9.5 3.5,0.5 3.5,7.5 9,5 0))",
- 0, 11, 25.6158412);
-
-
- //Should be solved (completely) differently
-
- test_one<polygon, polygon>("mail_denis_1",
- "POLYGON((55 10, 141 237, 249 23, 21 171, 252 169, 24 89, 266 73, 55 10))",
- 0, 7, 50.48056402439);
- // Source: http://upload.wikimedia.org/wikipedia/commons/8/83/Acute_heptagram.svg
- test_one<polygon, polygon>("acute_heptagram",
- "POLYGON((409 5,229 793.631528,733.348792 161.198146,4.543671 512.172194,813.456329 512.172194,84.651208 161.198146,589 793.631528))",
- 0, 11, 25.6158412);
-
- // Source: http://upload.wikimedia.org/wikipedia/commons/a/a7/Obtuse_heptagram.svg
- test_one<polygon, polygon>("obtuse_heptagram",
- "POLYGON((409 5,813.456329 512.172194,229 793.631528,84.651208 161.198146,733.348792 161.198146,589 793.631528,4.543671 512.172194))",
- 0, 11, 25.6158412);
-*/
-
-
- std::string const ticket17 = "POLYGON ((-122.28139163 37.37319149,-122.28100699 37.37273669,-122.28002186 37.37303123,-122.27979681 37.37290072,-122.28007349 37.37240493,-122.27977334 37.37220360,-122.27819720 37.37288580,-122.27714184 37.37275161,-122.27678628 37.37253167,-122.27766437 37.37180973,-122.27804382 37.37121453,-122.27687664 37.37101354,-122.27645829 37.37203386,-122.27604423 37.37249110,-122.27632234 37.37343339,-122.27760980 37.37391082,-122.27812478 37.37800320,-122.26117222 37.39121007,-122.25572289 37.39566631,-122.25547269 37.39564971,-122.25366304 37.39552993,-122.24919976 37.39580268,-122.24417933 37.39366907,-122.24051443 37.39094143,-122.23246277 37.38100418,-122.23606766 37.38141338,-122.24001587 37.37738940,-122.23666848 37.37609347,-122.23057450 37.37882170,-122.22679803 37.37807143,-122.22525727 37.37448817,-122.22523229 37.37443000,-122.23083199 37.37609347,-122.23033486 37.37777891,-122.23169030 37.37732117,-122.23229178 37.37709687,-122.23237761 37.37631249,-122.23297776 37
.37438834,-122.23872850 37.37165986,-122.24044511 37.36934068,-122.24671067 37.36865847,-122.24825570 37.36981819,-122.25151719 37.36947713,-122.25357721 37.36756706,-122.26001451 37.36579354,-122.25615213 37.36545239,-122.25486458 37.36245083,-122.25357721 37.36108651,-122.25194642 37.36013139,-122.24885652 37.35958557,-122.24911401 37.35849399,-122.25357721 37.35808470,-122.25675286 37.35897159,-122.25855539 37.35753887,-122.26181687 37.35828939,-122.26713837 37.35897159,-122.26782510 37.36108651,-122.26662339 37.36456559,-122.27288911 37.36722601,-122.27366159 37.36531602,-122.27168740 37.36470213,-122.27391900 37.36374701,-122.27074326 37.36245083,-122.27134408 37.35951742,-122.27426240 37.36135926,-122.27709482 37.36115474,-122.27966974 37.36231438,-122.27958391 37.36463382,-122.27572152 37.36463382,-122.27563569 37.36524779,-122.27700899 37.36593000,-122.27709482 37.36763529,-122.27554978 37.36838573,-122.27667254 37.36931478,-122.27677932 37.36932073,-122.27769362 37.36853987,-122.27942490 37.36830803
,-122.28178776 37.36677917,-122.28509559 37.36443500,-122.28845129 37.36413744,-122.29194403 37.36695946,-122.29382577 37.36726817,-122.29600414 37.36898512,-122.29733083 37.36995398,-122.29593239 37.37141436,-122.29416649 37.37075898,-122.29325026 37.37108436,-122.29652910 37.37311697,-122.29584237 37.37374461,-122.29537583 37.37573372,-122.29487677 37.37752502,-122.30923212 37.37593011,-122.31122484 37.38230086,-122.31467994 37.38092472,-122.31715663 37.38252181,-122.32307970 37.38166978,-122.31985618 37.37667694,-122.32210304 37.37580220,-122.32581446 37.37589532,-122.32401730 37.37331839,-122.32960417 37.37189020,-122.33465527 37.37331906,-122.33425328 37.37623680,-122.33620676 37.37726132,-122.33397986 37.37822382,-122.33358918 37.38036590,-122.33202637 37.37986918,-122.33147954 37.38101784,-122.33394080 37.38198017,-122.33545239 37.38587943,-122.33478058 37.38785697,-122.33386050 37.38723721,-122.33350041 37.38571137,-122.33122003 37.38548891,-122.33140008 37.38650606,-122.33366042 37.38817490,-122.332
44019 37.39157602,-122.33298157 37.39419201,-122.33164013 37.39477028,-122.33202017 37.39518351,-122.33358038 37.39499282,-122.33376050 37.39597811,-122.33550067 37.39734478,-122.33556069 37.39481797,-122.33344040 37.39292676,-122.33638094 37.38892189,-122.34240644 37.38852719,-122.34906293 37.38726898,-122.35072321 37.39338769,-122.34910291 37.39445252,-122.34796272 37.39410291,-122.34449043 37.39640534,-122.34500223 37.39729709,-122.34936291 37.39670910,-122.35098322 37.39531066,-122.35364623 37.39554510,-122.35434369 37.39612111,-122.35798429 37.39600988,-122.35768430 37.39478621,-122.36334519 37.39206871,-122.36604726 37.39203267,-122.36778592 37.39335592,-122.36518870 37.40022011,-122.36554552 37.40247752,-122.36370519 37.40331974,-122.36270506 37.40530591,-122.36320512 37.40670418,-122.36149849 37.40851392,-122.36730580 37.41054938,-122.37263720 37.41378932,-122.37161871 37.42076600,-122.36566153 37.42006292,-122.36520547 37.42742106,-122.37165953 37.43661157,-122.35943972 37.44459022,-122.35356359 37.
44600810,-122.33792254 37.45796329,-122.35228518 37.47478091,-122.35127080 37.48181199,-122.34867342 37.48487322,-122.34359717 37.48801082,-122.33388431 37.48677650,-122.33142321 37.48429747,-122.32929580 37.48473149,-122.32609609 37.48291144,-122.32344850 37.48228229,-122.31924364 37.48410234,-122.31677299 37.48114051,-122.31431751 37.47848973,-122.31259201 37.47682190,-122.31515972 37.47568196,-122.31691389 37.47360309,-122.31292494 37.46960081,-122.31130153 37.46937743,-122.30889894 37.47124987,-122.30612839 37.47011613,-122.30149630 37.46568378,-122.30064277 37.46363784,-122.29283821 37.45922376,-122.28630141 37.45415497,-122.28883099 37.44629920,-122.28316717 37.44197138,-122.27554148 37.42297597,-122.25597410 37.40553692,-122.25196579 37.40129593,-122.25012043 37.40049143,-122.24823207 37.39897758,-122.24754551 37.39740941,-122.24778582 37.39621607,-122.24934787 37.39599102,-122.25005170 37.39871849,-122.25222328 37.39863668,-122.25342491 37.39737529,-122.25520162 37.39667289,-122.25528737 37.39522726,
-122.27747460 37.37809616,-122.27977493 37.37858717,-122.28157729 37.37920106,-122.28322534 37.37952846,-122.28416939 37.38092656,-122.28621223 37.37984219,-122.28638389 37.37613857,-122.28382607 37.37843722,-122.27930278 37.37718220,-122.28196361 37.37652740,-122.28295058 37.37568167,-122.28216101 37.37523148,-122.28114822 37.37543608,-122.27934569 37.37528613,-122.27996369 37.37448121,-122.28104521 37.37454944,-122.28185197 37.37422883,-122.28290767 37.37474038,-122.28376597 37.37467224,-122.28428104 37.37399012,-122.28402346 37.37338989,-122.28610922 37.37364914,-122.28651264 37.37327388,-122.28672722 37.37207343,-122.28628398 37.37205448,-122.28574460 37.37166682,-122.28479711 37.37200981,-122.28327731 37.37137228,-122.28285511 37.37100700,-122.28279409 37.37125669,-122.28315527 37.37173756,-122.28321872 37.37220569,-122.28187007 37.37231918,-122.28193109 37.37294908,-122.28139163 37.37319149))";
- test_one<polygon, polygon>("ticket17", ticket17,
- 1, 228, 0.00920834633689);
-
- return; // next one does not work for gcc/linux
- // Real-life
- std::string const toolkit = "POLYGON((170718 605997,170718 605997,170776 606016,170773 606015,170786 606020,170778 606016,170787 606021,170781 606017,170795 606028,170795 606028,170829 606055,170939 606140,170933 605968,170933 605968,170932 605908,170929 605834,170920 605866,170961 605803,170739 605684,170699 605749,170691 605766,170693 605762,170686 605775,170688 605771,170673 605794,170676 605790,170668 605800,170672 605796,170651 605818,170653 605816,170639 605829,170568 605899,170662 605943,170633 605875,170603 605961,170718 605997))";
- test_one<polygon, polygon>("toolkit", toolkit,
- 0, 25, 91756.916526794434);
-
-}
-
-
-int test_main(int, char* [])
-{
- test_all<bg::model::d2::point_xy<double> >();
- return 0;
-}

Deleted: trunk/libs/geometry/test/algorithms/dissolve.vcproj
==============================================================================
--- trunk/libs/geometry/test/algorithms/dissolve.vcproj 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,174 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="dissolve"
- ProjectGUID="{206F83D5-17F9-4856-A1DE-82301DB94439}"
- RootNamespace="dissolve"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\dissolve"
- ConfigurationType="1"
- InheritedPropertySheets="..\boost.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../..;.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
- ExceptionHandling="2"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- DebugInformationFormat="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\dissolve"
- ConfigurationType="1"
- InheritedPropertySheets="..\boost.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../..;.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
- ExceptionHandling="2"
- UsePrecompiledHeader="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\dissolve.cpp"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>

Deleted: trunk/libs/geometry/test/algorithms/test_dissolve.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/test_dissolve.hpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,152 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library) test file
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_TEST_DISSOLVE_HPP
-#define BOOST_GEOMETRY_TEST_DISSOLVE_HPP
-
-#include <fstream>
-
-#include <geometry_test_common.hpp>
-
-#include <boost/geometry/algorithms/dissolve.hpp>
-
-// To check results
-#include <boost/geometry/algorithms/length.hpp>
-#include <boost/geometry/algorithms/area.hpp>
-#include <boost/geometry/algorithms/num_points.hpp>
-#include <boost/geometry/algorithms/unique.hpp>
-
-#include <boost/geometry/geometries/geometries.hpp>
-
-#include <boost/geometry/strategies/strategies.hpp>
-
-#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
-
-
-#if defined(TEST_WITH_SVG)
-# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
-#endif
-
-
-
-template <typename GeometryOut, typename Geometry>
-void test_dissolve(std::string const& caseid, Geometry const& geometry,
- std::size_t expected_hole_count, std::size_t expected_point_count,
- double expected_length_or_area, double percentage)
-{
- typedef typename bg::coordinate_type<Geometry>::type coordinate_type;
-
- static const bool is_line = bg::geometry_id<GeometryOut>::type::value == 2;
-
- std::vector<GeometryOut> dissolved_vector;
- bg::dissolve_inserter<GeometryOut>(geometry, std::back_inserter(dissolved_vector));
-
- typename bg::area_result<Geometry>::type length_or_area = 0;
- //std::size_t holes = 0;
- std::size_t count = 0;
-
- BOOST_FOREACH(GeometryOut& dissolved, dissolved_vector)
- {
- bg::unique(dissolved);
-
-
- length_or_area +=
- is_line ? bg::length(dissolved) : bg::area(dissolved);
-
- //holes += bg::num_interior_rings(dissolved);
- count += bg::num_points(dissolved);
- }
-
- BOOST_CHECK_MESSAGE(count == expected_point_count,
- "dissolve: " << caseid
- << " #points expected: " << expected_point_count
- << " detected: " << count
- << " type: " << string_from_type<coordinate_type>::name()
- );
-
-
- //BOOST_CHECK_EQUAL(holes, expected_hole_count);
- BOOST_CHECK_CLOSE(length_or_area, expected_length_or_area, percentage);
-
- // Compile check, it should also compile inplace, outputting to the same geometry
- {
- std::vector<GeometryOut> dissolved;
- bg::dissolve(geometry, dissolved);
- }
-
-
-#if defined(TEST_WITH_SVG)
- {
- std::ostringstream filename;
- filename << "dissolve_"
- << caseid << "_"
- << string_from_type<coordinate_type>::name()
- << ".svg";
-
- std::ofstream svg(filename.str().c_str());
-
- bg::svg_mapper
- <
- typename bg::point_type<Geometry>::type
- > mapper(svg, 500, 500);
- mapper.add(geometry);
-
- mapper.map(geometry, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1");
- BOOST_FOREACH(GeometryOut& dissolved, dissolved_vector)
- {
- mapper.map(dissolved, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5");
- }
- }
-#endif
-}
-
-
-template <typename Geometry, typename GeometryOut>
-void test_one(std::string const& caseid, std::string const& wkt,
- std::size_t expected_hole_count, std::size_t expected_point_count,
- double expected_length_or_area, double percentage = 0.001)
-{
- Geometry geometry;
- bg::read_wkt(wkt, geometry);
-
- test_dissolve<GeometryOut>(caseid, geometry,
- expected_hole_count, expected_point_count,
- expected_length_or_area, percentage);
-
-#ifdef BOOST_GEOMETRY_TEST_MULTI_PERMUTATIONS
- // Test different combinations of a multi-polygon
-
- int n = geometry.size();
-
- // test them in all orders
- std::vector<int> indices;
- for (int i = 0; i < n; i++)
- {
- indices.push_back(i);
- }
- int permutation = 0;
- do
- {
- std::ostringstream out;
- out << caseid;
- Geometry geometry2;
- for (int i = 0; i < n; i++)
- {
- int index = indices[i];
- out << "_" << index;
- geometry2.push_back(geometry[index]);
- }
- test_dissolve<GeometryOut>(out.str(), geometry2, expected_hole_count,
- expected_point_count, expected_length_or_area, percentage);
- } while (std::next_permutation(indices.begin(), indices.end()));
-#endif
-
-}
-
-
-
-#endif

Modified: trunk/libs/geometry/test/extensions/Jamfile.v2
==============================================================================
--- trunk/libs/geometry/test/extensions/Jamfile.v2 (original)
+++ trunk/libs/geometry/test/extensions/Jamfile.v2 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -6,5 +6,6 @@
 # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 # http://www.boost.org/LICENSE_1_0.txt)
 
+build-project algorithms ;
 build-project gis ;
 

Added: trunk/libs/geometry/test/extensions/algorithms/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/test/extensions/algorithms/Jamfile.v2 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -0,0 +1,16 @@
+# test/extensions/algorithms/Jamfile.v2
+#
+# Copyright (c) 2011 Barend Gehrels
+#
+# Use, modification and distribution is subject to the Boost Software License,
+# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+test-suite boost-geometry-extensions-algorithms
+ :
+ [ run dissolve.cpp ]
+ [ run connect.cpp ]
+ [ run offset.cpp ]
+ [ run midpoints.cpp ]
+ [ run selected.cpp ]
+ ;

Modified: trunk/libs/geometry/test/extensions/algorithms/connect.cpp
==============================================================================
--- trunk/libs/geometry/test/extensions/algorithms/connect.cpp (original)
+++ trunk/libs/geometry/test/extensions/algorithms/connect.cpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -159,8 +159,6 @@
     typedef bg::model::linestring<P> linestring;
     typedef bg::model::multi_linestring<linestring> multi_linestring;
 
- goto disconnected;
-
     test_one<multi_linestring, linestring>("ls_simplex",
         "MULTILINESTRING((0 0,1 1),(1 1,2 2))",
         1, 3, 2 * std::sqrt(2.0));
@@ -194,10 +192,9 @@
         "MULTILINESTRING((0 0,0 1.01),(1.02 1.03,0.99 0),(0 0.98,1.001 1),(1.01 0,0 0))",
         3, 7, 4.05163658, 0.01);
 
-disconnected:
     test_one<multi_linestring, linestring>("ls_disconnected_ring4",
         "MULTILINESTRING((0.01 0,0 1.01),(1.02 1.03,0.99 0),(0 0.98,1.001 1),(1.01 0,0.02 0))",
- 1, 8, 4.137147, 0.1);
+ 1, 8, 4.1172, 0.1);
 }
 
 

Copied: trunk/libs/geometry/test/extensions/algorithms/dissolve.cpp (from r69075, /trunk/libs/geometry/test/algorithms/dissolve.cpp)
==============================================================================
--- /trunk/libs/geometry/test/algorithms/dissolve.cpp (original)
+++ trunk/libs/geometry/test/extensions/algorithms/dissolve.cpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -10,7 +10,189 @@
 
 #include <geometry_test_common.hpp>
 
-#include <algorithms/test_dissolve.hpp>
+#include <boost/geometry/extensions/algorithms/dissolve.hpp>
+#include <boost/geometry/extensions/multi/algorithms/dissolve.hpp>
+
+// To check results
+#include <boost/geometry/algorithms/length.hpp>
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+#include <boost/geometry/algorithms/unique.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/multi/algorithms/for_each.hpp>
+
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/io/svg/write_svg_multi.hpp>
+
+
+
+
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+template <typename Mapper>
+struct map_segment
+{
+ map_segment(Mapper& m)
+ : m_mapper(&m)
+ {}
+
+ map_segment<Mapper>& operator=(map_segment<Mapper> const& other)
+ {
+ if(this != &other)
+ {
+ this->m_mapper = other.m_mapper;
+ }
+ return *this;
+ }
+
+
+ template <typename Segment>
+ inline void operator()(Segment const& s)
+ {
+ // create a little offset
+ m_mapper->map(s, "opacity:0.6;fill:none;stroke:rgb(0,0,0);stroke-width:2");
+ }
+
+ Mapper* m_mapper;
+};
+
+
+template <typename GeometryOut, typename Geometry>
+void test_dissolve(std::string const& caseid, Geometry const& geometry,
+ std::size_t expected_hole_count, std::size_t expected_point_count,
+ double expected_length_or_area, double percentage)
+{
+ typedef typename bg::coordinate_type<Geometry>::type coordinate_type;
+
+ static const bool is_line = bg::geometry_id<GeometryOut>::type::value == 2;
+
+ //std::cout << bg::area(geometry) << std::endl;
+
+ std::vector<GeometryOut> dissolved_vector;
+ bg::dissolve_inserter<GeometryOut>(geometry, std::back_inserter(dissolved_vector));
+
+ typename bg::area_result<Geometry>::type length_or_area = 0;
+ //std::size_t holes = 0;
+ std::size_t count = 0;
+
+ BOOST_FOREACH(GeometryOut& dissolved, dissolved_vector)
+ {
+ bg::unique(dissolved);
+
+
+ length_or_area +=
+ is_line ? bg::length(dissolved) : bg::area(dissolved);
+
+ //holes += bg::num_interior_rings(dissolved);
+ count += bg::num_points(dissolved);
+ }
+
+ BOOST_CHECK_MESSAGE(count == expected_point_count,
+ "dissolve: " << caseid
+ << " #points expected: " << expected_point_count
+ << " detected: " << count
+ << " type: " << string_from_type<coordinate_type>::name()
+ );
+
+
+ //BOOST_CHECK_EQUAL(holes, expected_hole_count);
+ BOOST_CHECK_CLOSE(length_or_area, expected_length_or_area, percentage);
+
+ // Compile check, it should also compile inplace, outputting to the same geometry
+ {
+ std::vector<GeometryOut> dissolved;
+ bg::dissolve(geometry, dissolved);
+ }
+
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename << "dissolve_"
+ << caseid << "_"
+ << string_from_type<coordinate_type>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ typedef
+ bg::svg_mapper
+ <
+ typename bg::point_type<Geometry>::type
+ > mapper_type;
+
+ mapper_type mapper(svg, 500, 500);
+ mapper.add(geometry);
+
+ mapper.map(geometry, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1;fill-rule:nonzero");
+
+ bg::for_each_segment(geometry, map_segment<mapper_type>(mapper));
+
+
+ BOOST_FOREACH(GeometryOut& dissolved, dissolved_vector)
+ {
+ mapper.map(dissolved, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5");
+ }
+ }
+#endif
+}
+
+
+template <typename Geometry, typename GeometryOut>
+void test_one(std::string const& caseid, std::string const& wkt,
+ std::size_t expected_hole_count, std::size_t expected_point_count,
+ double expected_length_or_area, double percentage = 0.001)
+{
+ Geometry geometry;
+ bg::read_wkt(wkt, geometry);
+
+ test_dissolve<GeometryOut>(caseid, geometry,
+ expected_hole_count, expected_point_count,
+ expected_length_or_area, percentage);
+
+#ifdef BOOST_GEOMETRY_TEST_MULTI_PERMUTATIONS
+ // Test different combinations of a multi-polygon
+
+ int n = geometry.size();
+
+ // test them in all orders
+ std::vector<int> indices;
+ for (int i = 0; i < n; i++)
+ {
+ indices.push_back(i);
+ }
+ int permutation = 0;
+ do
+ {
+ std::ostringstream out;
+ out << caseid;
+ Geometry geometry2;
+ for (int i = 0; i < n; i++)
+ {
+ int index = indices[i];
+ out << "_" << index;
+ geometry2.push_back(geometry[index]);
+ }
+ test_dissolve<GeometryOut>(out.str(), geometry2, expected_hole_count,
+ expected_point_count, expected_length_or_area, percentage);
+ } while (std::next_permutation(indices.begin(), indices.end()));
+#endif
+
+}
+
+
 
 
 template <typename P>
@@ -87,8 +269,6 @@
     test_one<polygon, polygon>("case_1",
         "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))",
         0, 7, 50.48056402439);
-/*
- // Mail
 
     // See power point, and http://en.wikipedia.org/wiki/Pentagram
     test_one<polygon, polygon>("pentagram",
@@ -96,8 +276,40 @@
         0, 11, 25.6158412);
 
 
- //Should be solved (completely) differently
+ // Multi-geometries
+ {
+ typedef bg::model::multi_polygon<polygon> multi_polygon;
+
+ test_one<multi_polygon, polygon>("three_triangles",
+ "MULTIPOLYGON(((1 1,5 5,8 0,1 1)),((4 2,0 8,5 9,4 2)),((5 3,4 8,10 4,5 3)))" ,
+ 1, 13, 42.614078674948232);
+
+ test_one<multi_polygon, polygon>("simplex_two",
+ "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)))",
+ 0, 8, 14.7);
+ test_one<multi_polygon, polygon>("simplex_three",
+ "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)))",
+ 0, 14, 16.7945);
+ test_one<multi_polygon, polygon>("simplex_four",
+ "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)),((5 5,7 7,8 4,5 5)))",
+ 0, 18, 20.7581);
+
+ // disjoint
+ test_one<multi_polygon, polygon>("simplex_disjoint",
+ "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((1 6,2 10,5 7,1 6)),((3 4,5 6,6 2,3 4)),((6 5,8 7,9 4,6 5)))",
+ 0, 16, 24.0);
+
+ // new hole of four
+ test_one<multi_polygon, polygon>("new_hole",
+ "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)),((3 1,5 4,8 4,3 1)))",
+ 1, 18, 19.5206);
+ }
+
 
+
+/*
+ //Should be solved (completely) differently
+ // From mail on the ggl-mailing list
     test_one<polygon, polygon>("mail_denis_1",
         "POLYGON((55 10, 141 237, 249 23, 21 171, 252 169, 24 89, 266 73, 55 10))",
         0, 7, 50.48056402439);

Copied: trunk/libs/geometry/test/extensions/algorithms/dissolve.vcproj (from r68727, /trunk/libs/geometry/test/algorithms/dissolve.vcproj)
==============================================================================
--- /trunk/libs/geometry/test/algorithms/dissolve.vcproj (original)
+++ trunk/libs/geometry/test/extensions/algorithms/dissolve.vcproj 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -20,7 +20,7 @@
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
                         IntermediateDirectory="$(ConfigurationName)\dissolve"
                         ConfigurationType="1"
- InheritedPropertySheets="..\boost.vsprops"
+ InheritedPropertySheets="..\..\boost.vsprops"
                         CharacterSet="1"
>
                         <Tool
@@ -41,7 +41,7 @@
                         <Tool
                                 Name="VCCLCompilerTool"
                                 Optimization="0"
- AdditionalIncludeDirectories="../../../..;.."
+ AdditionalIncludeDirectories="../../../../..;../..;."
                                 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
                                 ExceptionHandling="2"
                                 RuntimeLibrary="1"
@@ -93,7 +93,7 @@
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
                         IntermediateDirectory="$(ConfigurationName)\dissolve"
                         ConfigurationType="1"
- InheritedPropertySheets="..\boost.vsprops"
+ InheritedPropertySheets="..\..\boost.vsprops"
                         CharacterSet="1"
                         WholeProgramOptimization="1"
>
@@ -114,7 +114,7 @@
                         />
                         <Tool
                                 Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../..;.."
+ AdditionalIncludeDirectories="../../../../..;../..;."
                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
                                 ExceptionHandling="2"
                                 UsePrecompiledHeader="0"

Modified: trunk/libs/geometry/test/extensions/algorithms/extension_algorithms.sln
==============================================================================
--- trunk/libs/geometry/test/extensions/algorithms/extension_algorithms.sln (original)
+++ trunk/libs/geometry/test/extensions/algorithms/extension_algorithms.sln 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -12,6 +12,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mark_spikes", "mark_spikes.vcproj", "{0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dissolve", "dissolve.vcproj", "{206F83D5-17F9-4856-A1DE-82301DB94439}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -42,6 +44,10 @@
                 {0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}.Debug|Win32.Build.0 = Debug|Win32
                 {0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}.Release|Win32.ActiveCfg = Release|Win32
                 {0DFC6D76-C73C-41E6-BCAD-06A4E4F37593}.Release|Win32.Build.0 = Release|Win32
+ {206F83D5-17F9-4856-A1DE-82301DB94439}.Debug|Win32.ActiveCfg = Debug|Win32
+ {206F83D5-17F9-4856-A1DE-82301DB94439}.Debug|Win32.Build.0 = Debug|Win32
+ {206F83D5-17F9-4856-A1DE-82301DB94439}.Release|Win32.ActiveCfg = Release|Win32
+ {206F83D5-17F9-4856-A1DE-82301DB94439}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Modified: trunk/libs/geometry/test/extensions/algorithms/offset.cpp
==============================================================================
--- trunk/libs/geometry/test/extensions/algorithms/offset.cpp (original)
+++ trunk/libs/geometry/test/extensions/algorithms/offset.cpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
@@ -49,9 +49,9 @@
 
     typename bg::length_result<Geometry>::type length
                     = bg::length(moved_by_offset);
- std::size_t count = bg::num_points(moved_by_offset);
 
     /*
+ std::size_t count = bg::num_points(moved_by_offset);
     BOOST_CHECK_MESSAGE(count == expected_point_count,
             "offset: " << caseid
             << " #points expected: " << expected_point_count
@@ -91,13 +91,13 @@
 
 template <typename Geometry>
 void test_one(std::string const& caseid, std::string const& wkt, double distance,
- double expected_length, double percentage = 0.001)
+ double expected_length_plus, double expected_length_minus, double percentage = 0.001)
 {
     Geometry geometry;
     bg::read_wkt(wkt, geometry);
 
- test_offset<Geometry>(caseid + "_a", geometry, distance, expected_length, percentage);
- test_offset<Geometry>(caseid + "_b", geometry, -distance, expected_length, percentage);
+ test_offset<Geometry>(caseid + "_a", geometry, distance, expected_length_plus, percentage);
+ test_offset<Geometry>(caseid + "_b", geometry, -distance, expected_length_minus, percentage);
 }
 
 
@@ -116,12 +116,12 @@
     static std::string const curve = "LINESTRING(2 7,3 5,5 4,7 5,8 7)";
     static std::string const reallife1 = "LINESTRING(76396.40464822574 410095.6795147947,76397.85016212701 410095.211865792,76401.30666443033 410095.0466387949,76405.05892643372 410096.1007777959,76409.45103273794 410098.257640797,76412.96309264141 410101.6522238015)";
 
- test_one<linestring>("ls_simplex", simplex, 0.5, std::sqrt(2.0));
- test_one<linestring>("one_bend", one_bend, 0.5, std::sqrt(2.0));
- test_one<linestring>("two_bends", two_bends, 0.5, std::sqrt(2.0));
- test_one<linestring>("overlapping", overlapping, 0.5, std::sqrt(2.0));
- test_one<linestring>("curve", curve, 0.5, std::sqrt(2.0));
- test_one<linestring>("reallife1", reallife1, 16.5, std::sqrt(2.0));
+ test_one<linestring>("ls_simplex", simplex, 0.5, std::sqrt(2.0), std::sqrt(2.0));
+ test_one<linestring>("one_bend", one_bend, 0.5, 10.17328, 8.8681);
+ test_one<linestring>("two_bends", two_bends, 0.5, 13.2898, 12.92811);
+ test_one<linestring>("overlapping", overlapping, 0.5, 27.1466, 22.0596);
+ test_one<linestring>("curve", curve, 0.5, 7.7776, 10.0507);
+ test_one<linestring>("reallife1", reallife1, 16.5, 5.4654, 36.4943);
 }
 
 

Deleted: trunk/libs/geometry/test/multi/algorithms/multi_dissolve.cpp
==============================================================================
--- trunk/libs/geometry/test/multi/algorithms/multi_dissolve.cpp 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,68 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library) test file
-//
-// Copyright Barend Gehrels 2010, Geodan, 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <iostream>
-#include <string>
-
-
-#include <algorithms/test_dissolve.hpp>
-
-#include <boost/geometry/multi/core/is_multi.hpp>
-
-#include <boost/geometry/multi/algorithms/area.hpp>
-#include <boost/geometry/multi/algorithms/length.hpp>
-#include <boost/geometry/multi/algorithms/dissolve.hpp>
-#include <boost/geometry/multi/algorithms/envelope.hpp>
-#include <boost/geometry/multi/algorithms/num_points.hpp>
-#include <boost/geometry/multi/core/interior_rings.hpp>
-
-#include <boost/geometry/multi/geometries/multi_linestring.hpp>
-#include <boost/geometry/multi/geometries/multi_polygon.hpp>
-
-#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
-#include <boost/geometry/extensions/io/svg/write_svg_multi.hpp>
-
-
-template <typename P>
-void test_all()
-{
- typedef bg::model::polygon<P> polygon;
- typedef bg::model::multi_polygon<polygon> multi_polygon;
-
- test_one<multi_polygon, polygon>("three_triangles",
- "MULTIPOLYGON(((1 1,5 5,8 0,1 1)),((4 2,0 8,5 9,4 2)),((5 3,4 8,10 4,5 3)))" ,
- 1, 13, 42.614078674948232);
-
- test_one<multi_polygon, polygon>("simplex_two",
- "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)))",
- 0, 8, 14.7);
- test_one<multi_polygon, polygon>("simplex_three",
- "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)))",
- 0, 14, 16.7945);
- test_one<multi_polygon, polygon>("simplex_four",
- "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)),((5 5,7 7,8 4,5 5)))",
- 0, 18, 20.7581);
-
- // disjoint
- test_one<multi_polygon, polygon>("simplex_disjoint",
- "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((1 6,2 10,5 7,1 6)),((3 4,5 6,6 2,3 4)),((6 5,8 7,9 4,6 5)))",
- 0, 16, 24.0);
-
- // new hole of four
- test_one<multi_polygon, polygon>("new_hole",
- "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)),((3 1,5 4,8 4,3 1)))",
- 1, 18, 19.5206);
-
-}
-
-
-int test_main(int, char* [])
-{
- test_all<bg::model::d2::point_xy<double> >();
-
- return 0;
-}

Deleted: trunk/libs/geometry/test/multi/algorithms/multi_dissolve.vcproj
==============================================================================
--- trunk/libs/geometry/test/multi/algorithms/multi_dissolve.vcproj 2011-02-20 13:18:10 EST (Sun, 20 Feb 2011)
+++ (empty file)
@@ -1,174 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="multi_dissolve"
- ProjectGUID="{4F6E99F2-D93F-4C61-9300-B835874A3F34}"
- RootNamespace="multi_dissolve"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\multi_dissolve"
- ConfigurationType="1"
- InheritedPropertySheets="..\..\boost.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../../..;../..;."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG;BOOST_GEOMETRY_TEST_MULTI_PERMUTATIONS"
- ExceptionHandling="2"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- DebugInformationFormat="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\multi_dissolve"
- ConfigurationType="1"
- InheritedPropertySheets="..\..\boost.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../../..;../..;."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- ExceptionHandling="2"
- UsePrecompiledHeader="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\multi_dissolve.cpp"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk