Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60579 - in sandbox/geometry/libs/geometry/test: algorithms algorithms/overlay multi multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2010-03-14 10:31:23


Author: barendgehrels
Date: 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
New Revision: 60579
URL: http://svn.boost.org/trac/boost/changeset/60579

Log:
Added/updated tests for dissolve
Added:
   sandbox/geometry/libs/geometry/test/algorithms/dissolve.cpp
      - copied, changed from r60443, /sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp
   sandbox/geometry/libs/geometry/test/algorithms/dissolve.vcproj
      - copied, changed from r60443, /sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj
   sandbox/geometry/libs/geometry/test/algorithms/test_dissolve.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_dissolve.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_dissolve.vcproj (contents, props changed)
Removed:
   sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp
   sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj
Text files modified:
   sandbox/geometry/libs/geometry/test/algorithms/algorithms_tests.sln | 6 +
   sandbox/geometry/libs/geometry/test/algorithms/dissolve.cpp | 171 +++++++++++----------------------------
   sandbox/geometry/libs/geometry/test/algorithms/dissolve.vcproj | 10 +-
   sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln | 6 -
   sandbox/geometry/libs/geometry/test/multi/multi_tests.sln | 6 +
   5 files changed, 66 insertions(+), 133 deletions(-)

Modified: sandbox/geometry/libs/geometry/test/algorithms/algorithms_tests.sln
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/algorithms_tests.sln (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/algorithms_tests.sln 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
@@ -56,6 +56,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reverse", "reverse.vcproj", "{14B5DFC5-D511-4D8C-A231-EE90A05687E1}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dissolve", "dissolve.vcproj", "{206F83D5-17F9-4856-A1DE-82301DB94439}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -174,6 +176,10 @@
                 {14B5DFC5-D511-4D8C-A231-EE90A05687E1}.Debug|Win32.Build.0 = Debug|Win32
                 {14B5DFC5-D511-4D8C-A231-EE90A05687E1}.Release|Win32.ActiveCfg = Release|Win32
                 {14B5DFC5-D511-4D8C-A231-EE90A05687E1}.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

Copied: sandbox/geometry/libs/geometry/test/algorithms/dissolve.cpp (from r60443, /sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp)
==============================================================================
--- /sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/dissolve.cpp 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
@@ -5,84 +5,11 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#include <iostream>
-#include <iomanip>
-#include <string>
-
 
 #include <geometry_test_common.hpp>
 
-#include <boost/foreach.hpp>
-
-#include <boost/geometry/algorithms/intersection.hpp>
-#include <boost/geometry/algorithms/dissolve.hpp>
-
-#include <boost/geometry/strategies/strategies.hpp>
-
-#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
-#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
-
-
-
-#if defined(TEST_WITH_SVG)
-# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
-#endif
-
-template <typename Geometry>
-inline void test_dissolve(std::string const& id,
- int expected_count, double expected_area,
- Geometry const& geometry, double precision)
-{
- namespace bg = boost::geometry;
-
- std::vector<Geometry> out;
- bg::dissolve(geometry, std::back_inserter(out));
-
-
-#if defined(TEST_WITH_SVG)
- {
- std::ostringstream filename;
- filename << "dissolve_" << id << ".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, "fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:1");
- BOOST_FOREACH(Geometry const& geometry, out)
- {
- // Light red plus dark black outline gives clear impression
- mapper.map(geometry,
- "fill-opacity:0.1;fill:rgb(255,0,0);"
- "stroke-opacity:0.9;stroke:rgb(0,0,0);stroke-width:3");
- }
- }
-#endif
-}
-
-
+#include <algorithms/test_dissolve.hpp>
 
-template <typename Geometry>
-void test_geometry(std::string const& id, int expected_count, double expected_area,
- std::string const& wkt, double precision = 0.001)
-{
- if (wkt.empty())
- {
- return;
- }
-
- Geometry geometry;
- boost::geometry::read_wkt(wkt, geometry);
-
- std::string caseid = id;
-
-//#ifdef GEOMETRY_DEBUG_INTERSECTION
- std::cout << std::endl << std::endl << "# " << caseid << std::endl;
-//#endif
- test_dissolve(caseid, expected_count, expected_area, geometry, precision);
-}
-
-
-#if ! defined(GEOMETRY_TEST_MULTI)
 
 template <typename P>
 void test_all()
@@ -90,91 +17,91 @@
     typedef boost::geometry::linear_ring<P> ring;
     typedef boost::geometry::polygon<P> polygon;
 
- // Just a normal polygon
- test_geometry<polygon>("1", 0, 0,
- "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))");
-
+ // Simplex
+ test_one<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_geometry<polygon>("2", 2, 2.125,
- "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))");
-
+ test_one<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_geometry<polygon>("3", 1, 2,
- "POLYGON((0 2,2 4,2 0,4 2,0 2))");
-
+ test_one<polygon>("3",
+ "POLYGON((0 2,2 4,2 0,4 2,0 2))",
+ 0, 4, 2.0);
 
     // Self tangent
- test_geometry<polygon>("4", 1, 4,
- "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))");
+ test_one<polygon>("4",
+ "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))",
+ 0, 11, 12.0);
 
 
     // Self tangent in corner
- test_geometry<polygon>("5", 1, 4,
- "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))");
+ test_one<polygon>("5",
+ "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))",
+ 0, 11, 16.0);
 
 
     // With spike
- test_geometry<polygon>("6", 1, 2,
- "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))");
+ test_one<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_geometry<polygon>("d1", 0, 0,
- "POLYGON((0 0,0 4,4 0,4 0,0 0))");
+ test_one<polygon>("d1",
+ "POLYGON((0 0,0 4,4 0,4 0,0 0))",
+ 0, 4, 8);
 
 
     // With many duplicates
- test_geometry<polygon>("d2", 0, 0,
- "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))");
+ test_one<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_geometry<polygon>("h1", 2, 4,
- "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))");
-
+ test_one<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_geometry<polygon>("h2", 4, 3.5,
- "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,5 4,1 1))");
+ test_one<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_geometry<polygon>("h3", 4, 2.5,
- "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))");
+ test_one<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_geometry<polygon>("h4", 2, 2.96969697,
- "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))");
+ test_one<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>("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);
 
 
- test_geometry<polygon>("toolkit_1", 2, 2.96969697,
- "POLYGON((166445 554833,166445 554833,164795 555594,166448 554831,166439 554802,166439 554803,166439 554802,166439 554802,166425 554745,166425 554745,166425 554745,166425 554745,166417 554697,166405 554657,166405 554657,166405 554657,166405 554657,166405 554657,166405 554657,166402 554637,166361 554653,166364 554659,166400 554644,166405 554637,166404 554632,166360 554650,166319 554668,166291 554685,166292 554685,166276 554692,166276 554692,166260 554698,166215 554716,166201 554727,166195 554734,166194 554742,166196 554755,166198 554772,166200 554780,166220 554852,166224 554858,166224 554858,166226 554861,166226 554861,166228 554865,166233 554872,166240 554873,166282 554868,166292 554865,166292 554865,166297 554864,166297 554864,166304 554863,166304 554863,166315 554861,166314 554861,166341 554859,166389 554845,166388 554845,166411 554843,166411 554843,166425 554844,166435 554841,166441 554838,166441 554838,166444 554836,166444 554836,166447 554835,166443 554827,166440 554828,166443 554834,166445
 554833))");
-
- test_geometry<polygon>("toolkit_2", 2, 2.96969697,
- "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_geometry<polygon>("case_1", 2, 2.96969697,
- "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))");
- //return;
-
-
- // Real-life
+ // 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>("toolkit", toolkit,
+ 0, 25, 91756.916526794434);
 
     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_geometry<polygon>("ticket17", 2, 37.38691, ticket17);
-
-
+ test_one<polygon>("ticket17", ticket17,
+ 1, 228, 0.00920834633689);
 }
-#endif
-
 
 
-#if ! defined(GEOMETRY_TEST_MULTI)
 int test_main(int, char* [])
 {
     test_all<boost::geometry::point_xy<double> >();
     return 0;
 }
-#endif

Copied: sandbox/geometry/libs/geometry/test/algorithms/dissolve.vcproj (from r60443, /sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj)
==============================================================================
--- /sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/dissolve.vcproj 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
         ProjectType="Visual C++"
- Version="8.00"
+ Version="8,00"
         Name="dissolve"
         ProjectGUID="{206F83D5-17F9-4856-A1DE-82301DB94439}"
         RootNamespace="dissolve"
@@ -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"
                                 MinimalRebuild="true"
                                 ExceptionHandling="2"
@@ -96,7 +96,7 @@
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
                         IntermediateDirectory="$(ConfigurationName)\dissolve"
                         ConfigurationType="1"
- InheritedPropertySheets="..\..\boost.vsprops"
+ InheritedPropertySheets="..\boost.vsprops"
                         CharacterSet="1"
                         WholeProgramOptimization="1"
>
@@ -117,7 +117,7 @@
                         />
                         <Tool
                                 Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".;../../../../..;../.."
+ AdditionalIncludeDirectories="../../../..;.."
                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
                                 ExceptionHandling="2"
                                 RuntimeLibrary="2"

Deleted: sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
+++ (empty file)
@@ -1,180 +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 <iomanip>
-#include <string>
-
-
-#include <geometry_test_common.hpp>
-
-#include <boost/foreach.hpp>
-
-#include <boost/geometry/algorithms/intersection.hpp>
-#include <boost/geometry/algorithms/dissolve.hpp>
-
-#include <boost/geometry/strategies/strategies.hpp>
-
-#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
-#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
-
-
-
-#if defined(TEST_WITH_SVG)
-# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
-#endif
-
-template <typename Geometry>
-inline void test_dissolve(std::string const& id,
- int expected_count, double expected_area,
- Geometry const& geometry, double precision)
-{
- namespace bg = boost::geometry;
-
- std::vector<Geometry> out;
- bg::dissolve(geometry, std::back_inserter(out));
-
-
-#if defined(TEST_WITH_SVG)
- {
- std::ostringstream filename;
- filename << "dissolve_" << id << ".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, "fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:1");
- BOOST_FOREACH(Geometry const& geometry, out)
- {
- // Light red plus dark black outline gives clear impression
- mapper.map(geometry,
- "fill-opacity:0.1;fill:rgb(255,0,0);"
- "stroke-opacity:0.9;stroke:rgb(0,0,0);stroke-width:3");
- }
- }
-#endif
-}
-
-
-
-template <typename Geometry>
-void test_geometry(std::string const& id, int expected_count, double expected_area,
- std::string const& wkt, double precision = 0.001)
-{
- if (wkt.empty())
- {
- return;
- }
-
- Geometry geometry;
- boost::geometry::read_wkt(wkt, geometry);
-
- std::string caseid = id;
-
-//#ifdef GEOMETRY_DEBUG_INTERSECTION
- std::cout << std::endl << std::endl << "# " << caseid << std::endl;
-//#endif
- test_dissolve(caseid, expected_count, expected_area, geometry, precision);
-}
-
-
-#if ! defined(GEOMETRY_TEST_MULTI)
-
-template <typename P>
-void test_all()
-{
- typedef boost::geometry::linear_ring<P> ring;
- typedef boost::geometry::polygon<P> polygon;
-
- // Just a normal polygon
- test_geometry<polygon>("1", 0, 0,
- "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))");
-
-
- // Self intersecting
- test_geometry<polygon>("2", 2, 2.125,
- "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))");
-
-
- // Self intersecting in last segment
- test_geometry<polygon>("3", 1, 2,
- "POLYGON((0 2,2 4,2 0,4 2,0 2))");
-
-
- // Self tangent
- test_geometry<polygon>("4", 1, 4,
- "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))");
-
-
- // Self tangent in corner
- test_geometry<polygon>("5", 1, 4,
- "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))");
-
-
- // With spike
- test_geometry<polygon>("6", 1, 2,
- "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))");
-
-
- // Non intersection, but with duplicate
- test_geometry<polygon>("d1", 0, 0,
- "POLYGON((0 0,0 4,4 0,4 0,0 0))");
-
-
- // With many duplicates
- test_geometry<polygon>("d2", 0, 0,
- "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))");
-
-
- // Hole: interior tangent to exterior
- test_geometry<polygon>("h1", 2, 4,
- "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))");
-
-
- // Hole: interior intersecting exterior
- test_geometry<polygon>("h2", 4, 3.5,
- "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,5 4,1 1))");
-
-
- // Hole: two intersecting holes
- test_geometry<polygon>("h3", 4, 2.5,
- "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))");
-
- // Hole: self-intersecting hole
- test_geometry<polygon>("h4", 2, 2.96969697,
- "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))");
-
-
- test_geometry<polygon>("toolkit_1", 2, 2.96969697,
- "POLYGON((166445 554833,166445 554833,164795 555594,166448 554831,166439 554802,166439 554803,166439 554802,166439 554802,166425 554745,166425 554745,166425 554745,166425 554745,166417 554697,166405 554657,166405 554657,166405 554657,166405 554657,166405 554657,166405 554657,166402 554637,166361 554653,166364 554659,166400 554644,166405 554637,166404 554632,166360 554650,166319 554668,166291 554685,166292 554685,166276 554692,166276 554692,166260 554698,166215 554716,166201 554727,166195 554734,166194 554742,166196 554755,166198 554772,166200 554780,166220 554852,166224 554858,166224 554858,166226 554861,166226 554861,166228 554865,166233 554872,166240 554873,166282 554868,166292 554865,166292 554865,166297 554864,166297 554864,166304 554863,166304 554863,166315 554861,166314 554861,166341 554859,166389 554845,166388 554845,166411 554843,166411 554843,166425 554844,166435 554841,166441 554838,166441 554838,166444 554836,166444 554836,166447 554835,166443 554827,166440 554828,166443 554834,166445
 554833))");
-
- test_geometry<polygon>("toolkit_2", 2, 2.96969697,
- "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_geometry<polygon>("case_1", 2, 2.96969697,
- "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))");
- //return;
-
-
- // Real-life
-
- 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_geometry<polygon>("ticket17", 2, 37.38691, ticket17);
-
-
-}
-#endif
-
-
-
-#if ! defined(GEOMETRY_TEST_MULTI)
-int test_main(int, char* [])
-{
- test_all<boost::geometry::point_xy<double> >();
- return 0;
-}
-#endif

Deleted: sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
+++ (empty file)
@@ -1,182 +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"
- MinimalRebuild="true"
- ExceptionHandling="2"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="kernel32.lib $(NoInherit)"
- LinkIncremental="2"
- 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"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="kernel32.lib $(NoInherit)"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- 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>

Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
@@ -14,8 +14,6 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "assemble", "assemble.vcproj", "{306E829F-ACEC-42D5-B1D4-2531B2F56EA3}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dissolve", "dissolve.vcproj", "{206F83D5-17F9-4856-A1DE-82301DB94439}"
-EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -50,10 +48,6 @@
                 {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Debug|Win32.Build.0 = Debug|Win32
                 {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Release|Win32.ActiveCfg = Release|Win32
                 {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.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

Added: sandbox/geometry/libs/geometry/test/algorithms/test_dissolve.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_dissolve.hpp 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
@@ -0,0 +1,118 @@
+// 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/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 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_area, double percentage)
+{
+ namespace bg = boost::geometry;
+ typedef typename bg::coordinate_type<Geometry>::type coordinate_type;
+
+ std::vector<Geometry> dissolved_vector;
+ bg::dissolve_inserter<Geometry>(geometry, std::back_inserter(dissolved_vector));
+
+ typename bg::area_result<Geometry>::type area = 0;
+ std::size_t holes = 0;
+ std::size_t count = 0;
+
+ BOOST_FOREACH(Geometry& dissolved, dissolved_vector)
+ {
+ bg::unique(dissolved);
+
+ area += bg::area(dissolved);
+ holes += boost::geometry::num_interior_rings(dissolved);
+ count += boost::geometry::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(area, expected_area, percentage);
+
+ // Compile check, it should also compile inplace, outputting to the same geometry
+ {
+ Geometry 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());
+
+ boost::geometry::svg_mapper
+ <
+ typename boost::geometry::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(Geometry& dissolved, dissolved_vector)
+ {
+ mapper.map(dissolved, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5");
+ }
+ }
+#endif
+}
+
+
+template <typename Geometry>
+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_area, double percentage = 0.001)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+
+ test_dissolve(caseid, geometry,
+ expected_hole_count, expected_point_count,
+ expected_area, percentage);
+}
+
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_dissolve.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_dissolve.cpp 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
@@ -0,0 +1,46 @@
+// 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/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_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()
+{
+ namespace bg = boost::geometry;
+ typedef bg::polygon<P> polygon;
+ typedef bg::multi_polygon<polygon> multi_polygon;
+
+ test_one<multi_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, 15, 42.614078674948232);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_dissolve.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_dissolve.vcproj 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
@@ -0,0 +1,182 @@
+<?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"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ 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"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ 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>

Modified: sandbox/geometry/libs/geometry/test/multi/multi_tests.sln
==============================================================================
--- sandbox/geometry/libs/geometry/test/multi/multi_tests.sln (original)
+++ sandbox/geometry/libs/geometry/test/multi/multi_tests.sln 2010-03-14 10:31:21 EDT (Sun, 14 Mar 2010)
@@ -32,6 +32,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_unique", "algorithms\multi_unique.vcproj", "{71879D37-84A8-4949-8CDB-212982F81D80}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_dissolve", "algorithms\multi_dissolve.vcproj", "{4F6E99F2-D93F-4C61-9300-B835874A3F34}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -102,6 +104,10 @@
                 {71879D37-84A8-4949-8CDB-212982F81D80}.Debug|Win32.Build.0 = Debug|Win32
                 {71879D37-84A8-4949-8CDB-212982F81D80}.Release|Win32.ActiveCfg = Release|Win32
                 {71879D37-84A8-4949-8CDB-212982F81D80}.Release|Win32.Build.0 = Release|Win32
+ {4F6E99F2-D93F-4C61-9300-B835874A3F34}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4F6E99F2-D93F-4C61-9300-B835874A3F34}.Debug|Win32.Build.0 = Debug|Win32
+ {4F6E99F2-D93F-4C61-9300-B835874A3F34}.Release|Win32.ActiveCfg = Release|Win32
+ {4F6E99F2-D93F-4C61-9300-B835874A3F34}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE


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