Commit Graph

5322 Commits

Author SHA1 Message Date
Adam Wulkiewicz
cb03829dc1 [simplify] Correctly propagate strategies to area() and perimeter().
Also made the algorithm more robust by checking the iterator before
using it.
2021-03-03 01:15:12 +01:00
Adam Wulkiewicz
3620e0aada [simplify] Refactor the implementation.
Add dummy geometries which can be used to get strategies from umbrella
strategy without creating heavy temporary geometries.
2021-03-03 00:27:30 +01:00
Adam Wulkiewicz
26a62a24fe [buffer][simplify] Use umbrella strategies in buffer and simplify.
Move agnostic simplify strategy to algorithms.
2021-03-02 00:48:36 +01:00
Adam Wulkiewicz
095d1615bb [strategies] Add buffer and simplify umbrella strategies. 2021-03-02 00:48:18 +01:00
Adam Wulkiewicz
8886b1d59d [algorithms][strategies] Add support for umbrella strategies in several algorithms.
Algorithms:
  - densify,
  - discrete_frechet_distance,
  - discrete_hausdorff_distance,
  - length,
  - perimeter.
2021-02-24 02:31:09 +01:00
Adam Wulkiewicz
9ca2e1897d [algorithms][index][strategies] Add support for distance umbrella strategies in distance, comparable_distance.
Also adapt index calling comparable_distance in knn query.
2021-02-17 02:01:15 +01:00
Adam Wulkiewicz
f413c31d02 [strategies] Add distance umbrella strategies and modify existing ones.
Replace existing comparable_distance() getters with distance() getters.
The code using them is responsible for the conversion to comparable if
needed.

In some cases it is required to force the algorithms to use comparable
strategies internally. For this purpose add
strategies::distance::detail::comparable<> wrapper converting distance
strategies to comparable strategies.

Derive distance strategies from relate strategies.
Derive index strategies from distance strategies.

Alter legacy strategies if it's required, e.g. for automatic conversion
to umbrella strategies.
2021-02-17 01:55:23 +01:00
Adam Wulkiewicz
0922e3d56c [util] Add new is_segmental type trait (meaning linear or polygonal). 2021-02-17 01:33:40 +01:00
Adam Wulkiewicz
5c1fffb1ea [overlay] Fix warnings: unused type and signed/unsigned comparison. 2021-02-16 17:17:55 +01:00
Adam Wulkiewicz
2a048f7be4 [distance] Add missing include. 2021-02-16 16:15:12 +01:00
Adam Wulkiewicz
1f16b72cd6 [strategies] Remove redundent comments. 2021-02-16 15:25:11 +01:00
Adam Wulkiewicz
b1e5362d59 [azimuth] Make variables const. 2021-02-16 14:24:10 +01:00
Adam Wulkiewicz
ae33a8dc0c Merge branch 'develop' into feature/azimuth 2021-02-16 14:14:13 +01:00
Adam Wulkiewicz
429423cdb1 Merge pull request #768 from awulkiew/feature/strategies_relate
Support umbrella strategies in relops, setops, index, buffer and more.
2021-02-16 13:32:17 +01:00
Adam Wulkiewicz
920de2ca6a [algorithms] Remove unneeded comments, change names and indentation. 2021-02-16 13:06:32 +01:00
Mateusz Łoskot
c7adc567b0 Fix MSVC warning C4267: '=': conversion from 'size_t' to 'int' (#798) 2021-02-11 23:37:09 +01:00
Adam Wulkiewicz
9eb674d64f [strategies] Remove usage of equals() algorithm from side strategies. 2021-01-31 22:23:05 +01:00
Adam Wulkiewicz
ab28baae28 Merge branch 'develop' into feature/strategies_relate 2021-01-31 21:08:38 +01:00
Mateusz Łoskot
bceae0187c Add missing #include <string> 2021-01-20 23:23:34 +01:00
Adam Wulkiewicz
c267547e2e [doc] Add documentation for azimuth() algorithm. 2021-01-20 02:49:40 +01:00
Barend Gehrels
58429fb557 [get_turn_info] minor clean up of typedefs and includes 2021-01-13 09:33:21 +01:00
Adam Wulkiewicz
24dc47e23f [algorithms] Add new algorithm: azimuth(). 2021-01-13 01:23:52 +01:00
Barend Gehrels
84d3a8d9ce [get_turn_info] handle collinear as equal if both segments arrive at intersection point 2020-12-30 14:18:01 +01:00
Barend Gehrels
705efe9bad Merge pull request #780 from barendgehrels/fix/sort-by-side-point-at-turn
Fix/sort by side point at turn
2020-12-30 11:37:24 +01:00
Vissarion Fisikopoulos
421f4de74c Merge pull request #785 from vissarion/fix/spherical_str
[strategies] [test] Fix spherical cross track and convex hull tests
2020-12-23 14:49:19 +02:00
Mateusz Łoskot
b54a0589bd Catch up with dms_parser change from function call operator to apply (#786)
The change was applied in PR #394
2020-12-23 10:35:09 +01:00
Vissarion Fisikopoulos
4034ac88b2 [strategies] [test] Fix spherical cross track and convex hull tests 2020-12-21 15:11:17 +02:00
Vissarion Fisikopoulos
83dcb53ffc Merge remote-tracking branch 'origin/develop' into feature/robust_convex_hull 2020-12-21 12:22:55 +02:00
Vissarion Fisikopoulos
3374cda6f6 Merge pull request #749 from vissarion/feature/robust_area
Area strategy for more accurate computations in cartesian CS
2020-12-21 12:20:31 +02:00
Barend Gehrels
59e0840d75 [sort_by_side] walk forward for point_to
(similarly to walking backwards for point_from)
2020-12-16 14:41:49 +01:00
Barend Gehrels
4e8ff81131 [sort_by_side] add epsilon to approximately_equals 2020-12-16 10:31:14 +01:00
Barend Gehrels
324249bb2d [copy_segment_point] change offset with modulo, add to box, update unit test 2020-12-09 13:52:07 +01:00
Barend Gehrels
abaa211d3a [sort_by_side] fix cases where the cluster point is approached by segments, but the last point before is colocated with the turn itself
This fixes 50% of the errors currently found by recursive_polygons_buffer (when rescaling is turned off)
2020-12-02 14:19:50 +01:00
Barend Gehrels
77838a8995 [copy_segment_point] change implementation to allow also negative offsets,
including unit test
2020-12-02 13:19:15 +01:00
Adam Wulkiewicz
d2d3a7954a [concepts] Add vs2015 workaround. 2020-11-30 01:27:00 +01:00
Adam Wulkiewicz
928603f32e Fix vs2015 workarounds #ifdefs to work with non-vc compilers properly. 2020-11-26 04:12:19 +01:00
Adam Wulkiewicz
95a9b43712 Merge branch 'develop' into feature/traits_make 2020-11-25 15:23:55 +01:00
Adam Wulkiewicz
20ce3d5ce1 Merge pull request #778 from awulkiew/fix/clang_workarounds
Fixes/workarounds for clang 3.5-3.9
2020-11-25 14:38:06 +01:00
Barend Gehrels
bc77b4889b Merge pull request #773 from barendgehrels/fix/fraction-by-arrival
Fix turns where segments arrive at an intersection point, or leave
2020-11-25 10:24:25 +01:00
Barend Gehrels
42bd7cfe95 [turns] fix precision when turns are arriving or leaving.
Then their fractions should be 1 or 0 (and not nearly so)
2020-11-25 10:21:16 +01:00
Adam Wulkiewicz
016691b15f Merge branch 'develop' into feature/traits_make 2020-11-25 00:06:55 +01:00
Adam Wulkiewicz
c1f4912445 [geometries] Enable model::point's ctors only if Dimension match.
This allows to check if a constructor is implemented with
std::is_constructible without compilation errors with clang-3.5-3.9.
2020-11-24 23:41:19 +01:00
Adam Wulkiewicz
acbd14330a Do not use parameter pack explicitly in specializations for boost::variant.
Use BOOST_VARIANT_ENUM_PARAMS instead which expands to parameter pack if
C++14 is fully supported.

This is a workaround for compilation errors with clang-3.5. Lists of
template arguments are still processed with variadic templates.
2020-11-24 17:56:11 +01:00
Adam Wulkiewicz
632d1fcb43 Merge pull request #772 from awulkiew/fix/vs2015_workaround
Add constexpr and boost::variant workarounds for vs2015.
2020-11-23 02:50:50 +01:00
CG-SD
35a02b7ee6 [extensions][wkb] Fix risk of undefined behavior when parsing a byte_order byte
* fixed risk of undefined behavior when parsing a byte_order byte

tried to parse a spatialite WKB blob with this code but the byte_order byte was replaced by a '69' token :
 parsing this byte is successful but the value read is not part of the enum, the function returns true but the order parameter is left untouched. 
Calls to that function elsewhere in the code do not initialise the order parameter.
see 869e72fc01/include/boost/geometry/extensions/multi/gis/io/wkb/detail/parser.hpp (L83)

another option would be to return false in that case, but it didn't fit my need

* Update parser.hpp

typo fix
2020-11-21 02:53:39 +01:00
Vissarion Fisikopoulos
5351d98305 Fix unused parameter warnings (#775) 2020-11-18 15:51:59 +02:00
Adam Wulkiewicz
0b55a946b5 Add constexpr and boost::variant workarounds for vs2015. 2020-11-07 23:22:49 +01:00
Adam Wulkiewicz
f510cf2744 [area] Fix area_result for boost::variant and default_strategy. 2020-11-07 21:41:51 +01:00
Vissarion Fisikopoulos
e84295005a [strategies] Use auto and const in some places in cartesian area strategies 2020-11-06 12:18:00 +02:00
Barend Gehrels
3e111a0302 [turns] without rescaling, include start turns in calculation 2020-10-28 14:27:26 +01:00