[geometry] Work in progress: factor (rational) instead of distance

This is a large commit. It replaces enriched.distance with factor. Factor
is based on integer calculations, calculated in cart_intersect, from the
passed robust points, so always trustable.

We had to do this because without certain tests failed because of FP
problems with distance (calculated with FP).

This commit also greatly simplifies relate_collinear, where most things and checks
are replaced by simple unified calculations. This is also based on robust
fractions (but could have been done earlier).

Many (but not all) testcases commented in previous commit are now uncommented
again, they now work thanks to the fractions. There are also testcases
uncommented which now work correctly using clang/Linux

This commit breaks compiling disjoint (because of rescale), and running buffer
(also because of rescale), and some more (probably all because or rescaling),
this has to be fixed soon after.
This commit is contained in:
Barend Gehrels
2013-12-18 19:19:10 +01:00
parent 107621943d
commit 9a9efcff89
19 changed files with 868 additions and 444 deletions

View File

@@ -135,12 +135,10 @@ void test_areal()
2, 12, 7962.66, 1, 18, 2775258.93,
0.001);
#if ! defined(BOOST_GEOMETRY_RESCALE_TO_ROBUST)
test_one<Polygon, MultiPolygon, MultiPolygon>("ticket_9081",
ticket_9081[0], ticket_9081[1],
2, 28, 0.0907392476356186, 4, 25, 0.126018011439877,
0.001);
#endif
/* TODO: fix
test_one<Polygon, MultiPolygon, MultiPolygon>("case_101_multi",

View File

@@ -108,11 +108,9 @@ void test_areal()
ggl_list_20120915_h2[0], ggl_list_20120915_h2[2],
2, 10, 6.0); // Area from SQL Server
#if ! defined(BOOST_GEOMETRY_RESCALE_TO_ROBUST)
test_one<Polygon, MultiPolygon, MultiPolygon>("ticket_9081",
ticket_9081[0], ticket_9081[1],
2, 10, 0.0019812556);
#endif
}
template <typename Polygon, typename MultiPolygon, typename Box>
@@ -159,9 +157,12 @@ void test_point_output()
typedef bg::model::polygon<P> polygon;
typedef bg::model::multi_polygon<polygon> multi_polygon;
#if ! defined(BOOST_GEOMETRY_RESCALE_TO_ROBUST)
// TODO: fix, not yet adapted for rescaling
test_point_output<multi_polygon, multi_polygon>(case_multi_simplex[0], case_multi_simplex[1], 10);
test_point_output<linestring, multi_polygon>("linestring(4 0,0 4)", case_multi_simplex[0], 4);
test_point_output<box, multi_polygon>("box(3 0,4 6)", case_multi_simplex[0], 8);
#endif
}
template <typename MultiPolygon, typename MultiLineString>

View File

@@ -114,11 +114,9 @@ void test_areal()
ggl_list_20120915_h2[0], ggl_list_20120915_h2[2],
1, 0, 12, 23.0); // Area from SQL Server
#if ! defined(BOOST_GEOMETRY_RESCALE_TO_ROBUST)
test_one<Polygon, MultiPolygon, MultiPolygon>("ticket_9081",
ticket_9081[0], ticket_9081[1],
3, 0, 31, 0.2187385);
#endif
4, 0, 31, 0.2187385);
}
template <typename P>