[setops] Add support for tupled output in intersection PointLike/Linear.

This commit is contained in:
Adam Wulkiewicz
2020-01-08 01:18:07 +01:00
parent 51323cc8fa
commit bc11d6295b

View File

@@ -1230,12 +1230,12 @@ struct intersection_insert
BOOST_MPL_ASSERT_MSG
(
is_point_found, POINTLIKE_AND_GEOMETRY_EXPECTED_IN_TUPLED_OUTPUT
is_point_found, POINTLIKE_GEOMETRY_EXPECTED_IN_TUPLED_OUTPUT
, (types<PointLike1, PointLike2, TupledOut>)
);
// NOTE: The order of geometries in TupledOut tuple/pair must correspond to the order
// iterators in OutputIterators tuple/pair.
// of iterators in OutputIterators tuple/pair.
template
<
typename RobustPolicy, typename OutputIterators, typename Strategy
@@ -1319,6 +1319,8 @@ struct intersection_insert
{};
// This specialization is needed because intersection() reverses the arguments
// for MultiPoint/Linestring combination.
template
<
typename Linestring, typename MultiPoint, typename PointOut,
@@ -1348,6 +1350,61 @@ struct intersection_insert
};
template
<
typename PointLike, typename Linear, typename TupledOut,
overlay_type OverlayType,
bool Reverse1, bool Reverse2,
typename TagIn1, typename TagIn2
>
struct intersection_insert
<
PointLike, Linear, TupledOut, OverlayType,
Reverse1, Reverse2,
TagIn1, TagIn2, detail::intersection::tupled_output_tag,
pointlike_tag, linear_tag, detail::intersection::tupled_output_tag
>
// Reuse the implementation for PointLike/PointLike.
: intersection_insert
<
PointLike, Linear, TupledOut, OverlayType,
Reverse1, Reverse2,
TagIn1, TagIn2, detail::intersection::tupled_output_tag,
pointlike_tag, pointlike_tag, detail::intersection::tupled_output_tag
>
{};
// This specialization is needed because intersection() reverses the arguments
// for MultiPoint/Linestring combination.
template
<
typename Linestring, typename MultiPoint, typename TupledOut,
bool Reverse1, bool Reverse2
>
struct intersection_insert
<
Linestring, MultiPoint, TupledOut, overlay_intersection,
Reverse1, Reverse2,
linestring_tag, multi_point_tag, detail::intersection::tupled_output_tag,
linear_tag, pointlike_tag, detail::intersection::tupled_output_tag
>
{
template <typename RobustPolicy, typename OutputIterators, typename Strategy>
static inline OutputIterators apply(Linestring const& linestring,
MultiPoint const& multipoint,
RobustPolicy const& robust_policy,
OutputIterators out,
Strategy const& strategy)
{
return intersection_insert
<
MultiPoint, Linestring, TupledOut, overlay_intersection
>::apply(multipoint, linestring, robust_policy, out, strategy);
}
};
} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH