Changes intersection tests because output is unique now.

[SVN r73319]
This commit is contained in:
Barend Gehrels 2011-07-24 09:08:26 +00:00
parent 1bbd1aa73d
commit c94bba95fe
6 changed files with 23 additions and 29 deletions

View File

@ -218,6 +218,13 @@ void test_all()
1, 0, 3200.4,
0.01);
test_one<polygon, polygon, polygon>("ggl_list_20110716_enrico",
ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1],
3, 0, 35723.8506317139,
1, 0, 58456.4964294434
);
#ifdef _MSC_VER
// 2011-07-02
// Interesting FP-precision case.
@ -229,8 +236,7 @@ void test_all()
test_one<polygon, polygon, polygon>("ggl_list_20110627_phillip",
ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1],
if_typed<ct, double>(0, 1), 0,
if_typed<ct, double>(0.0, if_typed<ct, float>(0.000383878,
0.0000000000001105367)),
if_typed_tt<ct>(0.0000000000001105367, 0.0),
1, 0, 3577.40960816756,
0.01
);

View File

@ -184,6 +184,16 @@ void test_areal()
ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1],
1, if_typed_tt<ct>(6, 5), 11151.6618);
test_one<Polygon, Polygon, Polygon>("ggl_list_20110716_enrico",
ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1],
3,
#ifdef _MSC_VER
if_typed<ct, float>(20, 22),
#else
20,
#endif
35723.8506317139);
return;

View File

@ -23,7 +23,6 @@
#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>
@ -73,9 +72,6 @@ void test_difference(std::string const& caseid, G1 const& g1, G2 const& g2,
{
if (expected_point_count > 0)
{
// Get a correct point-count without duplicate points
// (note that overlay might be adapted to avoid duplicates)
bg::unique(*it);
n += bg::num_points(*it);
}

View File

@ -20,7 +20,6 @@
#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/algorithms/length.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/algorithms/unique.hpp>
#include <boost/geometry/geometries/geometries.hpp>
@ -41,8 +40,7 @@ typename bg::default_area_result<G1>::type test_intersection(std::string const&
G1 const& g1, G2 const& g2,
std::size_t expected_count = 0, std::size_t expected_point_count = 0,
double expected_length_or_area = 0,
double percentage = 0.0001,
bool make_unique = true)
double percentage = 0.0001)
{
static const bool is_line = bg::geometry_id<OutputType>::type::value == 2;
@ -78,17 +76,7 @@ typename bg::default_area_result<G1>::type test_intersection(std::string const&
{
if (expected_point_count > 0)
{
if (make_unique)
{
// Get a correct point-count without duplicate points
// (note that overlay might be adapted to avoid duplicates)
bg::unique(*it);
n += bg::num_points(*it, true);
}
else
{
n += bg::num_points(*it, true);
}
n += bg::num_points(*it, true);
}
// instead of specialization we check it run-time here
@ -179,8 +167,7 @@ typename bg::default_area_result<G1>::type test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2,
std::size_t expected_count = 0, std::size_t expected_point_count = 0,
double expected_length_or_area = 0,
double percentage = 0.0001,
bool make_unique = true)
double percentage = 0.0001)
{
G1 g1;
bg::read_wkt(wkt1, g1);
@ -194,7 +181,7 @@ typename bg::default_area_result<G1>::type test_one(std::string const& caseid,
return test_intersection<OutputType, void>(caseid, g1, g2,
expected_count, expected_point_count,
expected_length_or_area, percentage, make_unique);
expected_length_or_area, percentage);
}

View File

@ -21,7 +21,6 @@
#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/algorithms/length.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/algorithms/unique.hpp>
#include <boost/geometry/geometries/geometries.hpp>
@ -55,10 +54,6 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
area += bg::area(*it);
holes += bg::num_interior_rings(*it);
// Get a correct point-count without duplicate points
// (note that overlay might be adapted to avoid duplicates)
OutputType simplified;
bg::unique(*it);
n += bg::num_points(*it, true);
}

View File

@ -11,7 +11,7 @@
#include <string>
// #define BOOST_GEOMETRY_DEBUG_ASSEMBLE
#define BOOST_GEOMETRY_CHECK_WITH_SQLSERVER
//#define BOOST_GEOMETRY_CHECK_WITH_SQLSERVER
#include <algorithms/test_difference.hpp>
#include <algorithms/test_overlay.hpp>