Commit Graph

8536 Commits

Author SHA1 Message Date
Barend Gehrels
533543e86b [traverse][robustness] in case of cc, instead of arbitrary candidate,
take candidate with largest remaining distance. This fixes some
errors if rescaling is turned off.
2015-10-14 17:15:53 +02:00
Barend Gehrels
74f5465516 [get_turns][test] exclude failing case for clang/release 2015-10-14 16:30:51 +02:00
Barend Gehrels
c5f31b17a4 [difference][test] increase tolerance to let it pass on clang (the subsequent
cases also have tolerance of 1e-10).
Also increase printed precision to be able to investigate the problem
2015-10-14 14:17:47 +02:00
Barend Gehrels
d25b47f627 [buffer][test] decrease one tolerance which was too high 2015-10-14 12:59:30 +02:00
Barend Gehrels
82b1290849 [buffer][test] increase tolerances for extreme cases to let them pass
in clang/clang release/gcc
2015-10-14 12:59:15 +02:00
Barend Gehrels
4c29a2f7d5 [buffer] initialize intersection point to avoid warning 2015-10-14 12:58:05 +02:00
Barend Gehrels
ec017da3f0 [buffer] move same code fragments to finish_ring 2015-10-14 12:57:46 +02:00
Barend Gehrels
71143c1b68 [buffer][fix] Fix case where side calculation fails because of length 2015-10-14 12:14:38 +02:00
Menelaos Karavelas
c863eb4e92 Merge pull request #331 from mkaravel/fix/is_valid_numerically_collinear
Fix problem of numerical inconsistency when checking for spikes
2015-10-14 09:24:29 +03:00
Menelaos Karavelas
b029641604 [algorithms][detail][point_is_spike_or_equal] fix inconsistency between sideness/collinearity
test and check for direction of vectors;

Problem: when checking whether a point q creates a spike or not with respect to two (ordered)
points a and b, the first check performed is whether q, a and b are collinear; if so, then it
is determined whether the vectors q-b and b-a have the same direction or not; for points with
floating-point coordinates, due to rounding errors as well as due to the fact that equality to
zero is checked using some tolerance, the three points may be detected as collinear; however,
when the directions of the two vectors are checked, computations are done without taking into
account any tolerance and this can lead to inconsistent results;

Fix: when checking the directions of the vectors q-b and b-a, compute signs of differences using
numerical tolerances, that is using math::equals() instead of plain comparison operators;
2015-10-12 12:07:10 +03:00
Menelaos Karavelas
04b834506c [test][algorithms][is_valid] add test cases for checking spikes in areal geometries 2015-10-12 11:37:29 +03:00
Jeremy W. Murphy
013ed09a55 [projections] Use lexical_cast, check for zeroes.
-99 is a placeholder.
2015-10-11 23:36:22 +11:00
Jeremy W. Murphy
37b3487a0d [projections] Punctuation and naming. 2015-10-11 18:13:22 +11:00
Adam Wulkiewicz
605d6d2e9b [relate] Comment-out unused variable to suppress compiler warning. 2015-10-09 17:04:38 +02:00
Adam Wulkiewicz
51d683c737 Merge pull request #321 from awulkiew/fix/rtree_eps2
Enlarge nodes boxes in the rtree WRT epsilon when non-Box values are indexed.
2015-10-09 15:54:03 +02:00
Menelaos Karavelas
8614c403f0 Merge pull request #325 from mkaravel/fix/difference_intersection_linear_areal
Fix/difference intersection linear areal
2015-10-09 08:13:52 +03:00
Menelaos Karavelas
49b7be215e [algorithms][intersection] use more descriptive name for method;
change template parameter name to something more descreptive;
2015-10-09 08:11:39 +03:00
Adam Wulkiewicz
350e75bfc2 Merge pull request #328 from jeremy-murphy/redefined_macro
[transform][strategies] Don't clobber BOOST_UBLAS_TYPE_CHECK macro.
2015-10-09 02:26:00 +02:00
Adam Wulkiewicz
7a446e9103 Merge pull request #330 from awulkiew/fix/distance
Fix assertion failure in distance(Pt, Box) for NaN coordinates
2015-10-08 23:43:58 +02:00
Adam Wulkiewicz
df2056756f [test][index] Enable enlargement in the test checking handling of epsilon in the rtree. 2015-10-08 19:02:23 +02:00
Adam Wulkiewicz
bef1a98d2e [index] Add #ifdef for conditional enabling of Values' bounds in the rtree. 2015-10-08 19:01:00 +02:00
Adam Wulkiewicz
34048498ec [test][distance] Add a test case with NaN coordinates. 2015-10-08 17:42:59 +02:00
Adam Wulkiewicz
25d9f9c195 [distance] Fix assertion failure in distance(Pt, Box) for NaN coordinates.
If there are NaN coordinates the conditions cannot be reasonably
calculated, therefore if the condition isn't met check if NaN coordinates
were not involved. This is consistent with the general policy WRT invalid
geometries, the algorithm don't fail but may generate invalid result.
2015-10-08 17:39:16 +02:00
Adam Wulkiewicz
4e64885344 [relate][touches][overlaps] Add test cases for fixed bugs. 2015-10-08 14:00:21 +02:00
Adam Wulkiewicz
d518688486 [relate][touches] Fix bugs in relate(A,A) and use it in touches(A,A)
Bugs are related to the handling of interior rings intersecting the second
geometry.

touches(A,A) now calls relate(A,A) besides a Ring/Ring case bcause Rings
have no holes so the simpified version may be used.
2015-10-08 13:55:11 +02:00
Barend Gehrels
b1c0c487e1 [test][union] add two testcases causing problems with u/u turns
and handle_touch (in other branch)
2015-10-07 19:45:25 +02:00
Dane Springmeyer
eb7613e703 [algorithms][intersection] Fixes liang_barsky for integer coordinate types
- Fixes an integer division bug which caused incorrect clipping results when
   a geometry is clipped by a box and the coordinate type is integral
 - Refs https://github.com/mapbox/mapnik-vector-tile/pull/102
2015-10-06 13:58:18 -07:00
Menelaos Karavelas
b3be70aee2 [algorithms][overlay][exception] move inconsistent_turns_exception to a separate file 2015-10-05 14:06:58 +03:00
Menelaos Karavelas
7f5f894535 [algorithms][overlay][exception] move inconsistent_turns_exception to a separate file 2015-10-05 12:24:31 +03:00
Jeremy W. Murphy
2c9cf6cc5f [transform][strategies] Don't clobber BOOST_UBLAS_TYPE_CHECK macro.
This macro is also defined in boost/numeric/ublas/detail/config.hpp.
2015-09-27 19:50:15 +10:00
Menelaos Karavelas
37c97a58dc Merge pull request #327 from mkaravel/fix/debug_print_complement_graph
Fix issue with use of std::cout only in debug mode
2015-09-22 08:46:48 +03:00
Menelaos Karavelas
c8b1095eea [algorithms][is_valid] fix issue with use of std::cout only in debug mode:
originally reported by Jeremy Murphy (GitHub PR #326); the problem is that
when debug_print_complement_graph() is called, std::cout needs to be defined
which requires the inclusion of <iostream> even in non-debug mode; with this
commit the call to debug_print_complement_graph() is guarded by the appropriate
macro and the use inclusion of <iostream> is no longer needed in non-debug mode;
2015-09-17 09:28:55 +03:00
Adam Wulkiewicz
825815a418 [test][buffer] Add cases causing assertion failure. 2015-09-09 00:50:20 +02:00
Adam Wulkiewicz
7cdc476a40 [test] Fix size_t to int conversions (msvc warnings). 2015-09-08 17:47:23 +02:00
Jeremy W. Murphy
cb78622a8e Merge branch 'develop' into pj_units 2015-09-07 23:44:29 +10:00
Adam Wulkiewicz
047cbbf60d [doc] Update 1.60 release notes (ticket). 2015-09-07 14:42:57 +02:00
Adam Wulkiewicz
a71aaa3617 [core] Make geometry::exception::what() public. 2015-09-07 14:03:54 +02:00
Barend Gehrels
e8785f63dc [handle_touch] check on uu index 2015-09-06 20:25:41 +02:00
Barend Gehrels
b0262c163e [handle_touch] remove map, because now that u/u turns contain travel information
we can start just there and don' t have to start on another turn on the same
input rings. This simplifies the code
2015-09-06 19:47:56 +02:00
Barend Gehrels
eb3880991e [handle_touch] add logic to set the selectable_start flag to true 2015-09-06 15:43:43 +02:00
Barend Gehrels
93481dc289 [union] include handle_touch in operation, handle switch_source, and add corresponding testcases
(from Menelaos' unmerged PR).
Regression in one case (case_recursive_boxes_3)
2015-09-06 14:52:28 +02:00
Barend Gehrels
3144419031 [handle_touch] add additional cases from Menelaos' (non merged) PR
both for polygon and multi polygon
2015-09-06 14:49:46 +02:00
Barend Gehrels
9977478aec [handle_touch] split can_reach function and add more conditions to check
reachability via u/u turn. Which fixes the issues in unit test
2015-09-06 12:30:08 +02:00
Barend Gehrels
5b4ff7dc7f [handle_touch] remove the insert_into_sequence method because it is
way more convenient to do that in enrich
(not complete yet - union test still fails for some cases)
2015-09-04 23:25:49 +02:00
Barend Gehrels
ad2524d245 [traverse] handle u/u differently such that it is not discarded
for a union operation
2015-09-04 23:13:28 +02:00
Menelaos Karavelas
68611a159c [algorithms][intersection][difference] fix bug in determining whether a turn
is a crossing turn or not (as part of the bug-fix the logic now determines is the
turn is a crossing turn, as opposed to a non-crossing turn)
2015-09-04 10:50:03 +03:00
Menelaos Karavelas
5328407f9d [test][algorithms][difference] add one more test case for difference(L, A) 2015-09-04 10:48:32 +03:00
Barend Gehrels
77c2a32503 [handle_touch] add start sorting to re-assign index of non-discarded u/u turn 2015-09-03 23:35:32 +02:00
Barend Gehrels
9a6695c825 [enrich] move indexed_turn_operation/sort to separate source file to
reuse it for handle_touch

Also, remove the unused member variable m_strategy from it
2015-09-03 23:17:44 +02:00
Menelaos Karavelas
3b12d520ac [util][math] fix possible unused variable warning 2015-09-03 20:04:55 +03:00