mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-09 23:24:02 +00:00
Remove trailing whitespaces from include and index directories
This commit is contained in:
parent
1451c6ca65
commit
eb38231d36
@ -107,7 +107,7 @@ struct ring_area
|
|||||||
auto const end = boost::end(view);
|
auto const end = boost::end(view);
|
||||||
|
|
||||||
strategy_type const strategy = strategies.area(ring);
|
strategy_type const strategy = strategies.area(ring);
|
||||||
typename strategy_type::template state<Ring> state;
|
typename strategy_type::template state<Ring> state;
|
||||||
|
|
||||||
for (auto previous = it++; it != end; ++previous, ++it)
|
for (auto previous = it++; it != end; ++previous, ++it)
|
||||||
{
|
{
|
||||||
|
@ -231,7 +231,7 @@ struct assign
|
|||||||
concepts::check<Geometry1>();
|
concepts::check<Geometry1>();
|
||||||
concepts::check<Geometry2 const>();
|
concepts::check<Geometry2 const>();
|
||||||
concepts::check_concepts_and_equal_dimensions<Geometry1, Geometry2 const>();
|
concepts::check_concepts_and_equal_dimensions<Geometry1, Geometry2 const>();
|
||||||
|
|
||||||
static bool const same_point_order
|
static bool const same_point_order
|
||||||
= point_order<Geometry1>::value == point_order<Geometry2>::value;
|
= point_order<Geometry1>::value == point_order<Geometry2>::value;
|
||||||
BOOST_GEOMETRY_STATIC_ASSERT(
|
BOOST_GEOMETRY_STATIC_ASSERT(
|
||||||
@ -244,23 +244,23 @@ struct assign
|
|||||||
same_closure,
|
same_closure,
|
||||||
"Assign is not supported for different closures.",
|
"Assign is not supported for different closures.",
|
||||||
Geometry1, Geometry2);
|
Geometry1, Geometry2);
|
||||||
|
|
||||||
dispatch::convert<Geometry2, Geometry1>::apply(geometry2, geometry1);
|
dispatch::convert<Geometry2, Geometry1>::apply(geometry2, geometry1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <BOOST_VARIANT_ENUM_PARAMS(typename T), typename Geometry2>
|
template <BOOST_VARIANT_ENUM_PARAMS(typename T), typename Geometry2>
|
||||||
struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Geometry2>
|
struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Geometry2>
|
||||||
{
|
{
|
||||||
struct visitor: static_visitor<void>
|
struct visitor: static_visitor<void>
|
||||||
{
|
{
|
||||||
Geometry2 const& m_geometry2;
|
Geometry2 const& m_geometry2;
|
||||||
|
|
||||||
visitor(Geometry2 const& geometry2)
|
visitor(Geometry2 const& geometry2)
|
||||||
: m_geometry2(geometry2)
|
: m_geometry2(geometry2)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <typename Geometry1>
|
template <typename Geometry1>
|
||||||
result_type operator()(Geometry1& geometry1) const
|
result_type operator()(Geometry1& geometry1) const
|
||||||
{
|
{
|
||||||
@ -272,7 +272,7 @@ struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Geometry2>
|
|||||||
(geometry1, m_geometry2);
|
(geometry1, m_geometry2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
apply(variant<BOOST_VARIANT_ENUM_PARAMS(T)>& geometry1,
|
apply(variant<BOOST_VARIANT_ENUM_PARAMS(T)>& geometry1,
|
||||||
Geometry2 const& geometry2)
|
Geometry2 const& geometry2)
|
||||||
@ -280,19 +280,19 @@ struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Geometry2>
|
|||||||
return boost::apply_visitor(visitor(geometry2), geometry1);
|
return boost::apply_visitor(visitor(geometry2), geometry1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename Geometry1, BOOST_VARIANT_ENUM_PARAMS(typename T)>
|
template <typename Geometry1, BOOST_VARIANT_ENUM_PARAMS(typename T)>
|
||||||
struct assign<Geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
struct assign<Geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
||||||
{
|
{
|
||||||
struct visitor: static_visitor<void>
|
struct visitor: static_visitor<void>
|
||||||
{
|
{
|
||||||
Geometry1& m_geometry1;
|
Geometry1& m_geometry1;
|
||||||
|
|
||||||
visitor(Geometry1 const& geometry1)
|
visitor(Geometry1 const& geometry1)
|
||||||
: m_geometry1(geometry1)
|
: m_geometry1(geometry1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <typename Geometry2>
|
template <typename Geometry2>
|
||||||
result_type operator()(Geometry2 const& geometry2) const
|
result_type operator()(Geometry2 const& geometry2) const
|
||||||
{
|
{
|
||||||
@ -304,7 +304,7 @@ struct assign<Geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
|||||||
(m_geometry1, geometry2);
|
(m_geometry1, geometry2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
apply(Geometry1& geometry1,
|
apply(Geometry1& geometry1,
|
||||||
variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& geometry2)
|
variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& geometry2)
|
||||||
@ -312,8 +312,8 @@ struct assign<Geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
|||||||
return boost::apply_visitor(visitor(geometry1), geometry2);
|
return boost::apply_visitor(visitor(geometry1), geometry2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <BOOST_VARIANT_ENUM_PARAMS(typename T1), BOOST_VARIANT_ENUM_PARAMS(typename T2)>
|
template <BOOST_VARIANT_ENUM_PARAMS(typename T1), BOOST_VARIANT_ENUM_PARAMS(typename T2)>
|
||||||
struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T1)>, variant<BOOST_VARIANT_ENUM_PARAMS(T2)> >
|
struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T1)>, variant<BOOST_VARIANT_ENUM_PARAMS(T2)> >
|
||||||
{
|
{
|
||||||
@ -332,7 +332,7 @@ struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T1)>, variant<BOOST_VARIANT_ENUM
|
|||||||
(geometry1, geometry2);
|
(geometry1, geometry2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
apply(variant<BOOST_VARIANT_ENUM_PARAMS(T1)>& geometry1,
|
apply(variant<BOOST_VARIANT_ENUM_PARAMS(T1)>& geometry1,
|
||||||
variant<BOOST_VARIANT_ENUM_PARAMS(T2)> const& geometry2)
|
variant<BOOST_VARIANT_ENUM_PARAMS(T2)> const& geometry2)
|
||||||
@ -340,9 +340,9 @@ struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T1)>, variant<BOOST_VARIANT_ENUM
|
|||||||
return boost::apply_visitor(visitor(), geometry1, geometry2);
|
return boost::apply_visitor(visitor(), geometry1, geometry2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace resolve_variant
|
} // namespace resolve_variant
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Assigns one geometry to another geometry
|
\brief Assigns one geometry to another geometry
|
||||||
|
@ -40,7 +40,7 @@ namespace boost { namespace geometry
|
|||||||
#ifndef DOXYGEN_NO_DETAIL
|
#ifndef DOXYGEN_NO_DETAIL
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
#endif // DOXYGEN_NO_DETAIL
|
#endif // DOXYGEN_NO_DETAIL
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ inline auto azimuth(Point1 const& point1, Point2 const& point2)
|
|||||||
{
|
{
|
||||||
concepts::check<Point1 const>();
|
concepts::check<Point1 const>();
|
||||||
concepts::check<Point2 const>();
|
concepts::check<Point2 const>();
|
||||||
|
|
||||||
return resolve_strategy::azimuth
|
return resolve_strategy::azimuth
|
||||||
<
|
<
|
||||||
default_strategy
|
default_strategy
|
||||||
|
@ -218,7 +218,7 @@ struct centroid_range
|
|||||||
{
|
{
|
||||||
// prepare translation transformer
|
// prepare translation transformer
|
||||||
translating_transformer<Range> transformer(*boost::begin(range));
|
translating_transformer<Range> transformer(*boost::begin(range));
|
||||||
|
|
||||||
typename Strategy::template state_type
|
typename Strategy::template state_type
|
||||||
<
|
<
|
||||||
typename geometry::point_type<Range>::type,
|
typename geometry::point_type<Range>::type,
|
||||||
@ -226,7 +226,7 @@ struct centroid_range
|
|||||||
>::type state;
|
>::type state;
|
||||||
|
|
||||||
centroid_range_state::apply(range, transformer, strategy, state);
|
centroid_range_state::apply(range, transformer, strategy, state);
|
||||||
|
|
||||||
if ( strategy.result(state, centroid) )
|
if ( strategy.result(state, centroid) )
|
||||||
{
|
{
|
||||||
// translate the result back
|
// translate the result back
|
||||||
@ -277,7 +277,7 @@ struct centroid_polygon
|
|||||||
// prepare translation transformer
|
// prepare translation transformer
|
||||||
translating_transformer<Polygon>
|
translating_transformer<Polygon>
|
||||||
transformer(*boost::begin(exterior_ring(poly)));
|
transformer(*boost::begin(exterior_ring(poly)));
|
||||||
|
|
||||||
typename Strategy::template state_type
|
typename Strategy::template state_type
|
||||||
<
|
<
|
||||||
typename geometry::point_type<Polygon>::type,
|
typename geometry::point_type<Polygon>::type,
|
||||||
@ -285,7 +285,7 @@ struct centroid_polygon
|
|||||||
>::type state;
|
>::type state;
|
||||||
|
|
||||||
centroid_polygon_state::apply(poly, transformer, strategy, state);
|
centroid_polygon_state::apply(poly, transformer, strategy, state);
|
||||||
|
|
||||||
if ( strategy.result(state, centroid) )
|
if ( strategy.result(state, centroid) )
|
||||||
{
|
{
|
||||||
// translate the result back
|
// translate the result back
|
||||||
@ -366,7 +366,7 @@ struct centroid_multi
|
|||||||
transformer.apply_reverse(centroid);
|
transformer.apply_reverse(centroid);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -152,7 +152,7 @@ struct range_to_range
|
|||||||
geometry::detail::conversion::convert_point_to_point(point1, point2);
|
geometry::detail::conversion::convert_point_to_point(point1, point2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void apply(Range1 const& source, Range2& destination)
|
static inline void apply(Range1 const& source, Range2& destination)
|
||||||
{
|
{
|
||||||
apply(source, destination, default_policy());
|
apply(source, destination, default_policy());
|
||||||
|
@ -231,7 +231,7 @@ struct crosses
|
|||||||
>::apply(geometry1, geometry2, strategy);
|
>::apply(geometry1, geometry2, strategy);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename DynamicGeometry1, typename Geometry2, typename Tag2>
|
template <typename DynamicGeometry1, typename Geometry2, typename Tag2>
|
||||||
struct crosses<DynamicGeometry1, Geometry2, dynamic_geometry_tag, Tag2>
|
struct crosses<DynamicGeometry1, Geometry2, dynamic_geometry_tag, Tag2>
|
||||||
@ -295,10 +295,10 @@ struct crosses<DynamicGeometry1, DynamicGeometry2, dynamic_geometry_tag, dynamic
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace resolve_dynamic
|
} // namespace resolve_dynamic
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief \brief_check2{crosses}
|
\brief \brief_check2{crosses}
|
||||||
\ingroup crosses
|
\ingroup crosses
|
||||||
|
@ -88,7 +88,7 @@ struct densify_range
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto strategy = strategies.densify(rng);
|
auto strategy = strategies.densify(rng);
|
||||||
push_back_policy<MutRng> policy(rng_out);
|
push_back_policy<MutRng> policy(rng_out);
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ struct densify<default_strategy, false>
|
|||||||
<
|
<
|
||||||
Geometry
|
Geometry
|
||||||
>::type strategies_type;
|
>::type strategies_type;
|
||||||
|
|
||||||
dispatch::densify
|
dispatch::densify
|
||||||
<
|
<
|
||||||
Geometry, Geometry
|
Geometry, Geometry
|
||||||
|
@ -32,7 +32,7 @@ namespace detail { namespace buffer
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
template <typename Strategy>
|
template <typename Strategy>
|
||||||
struct original_get_box
|
struct original_get_box
|
||||||
{
|
{
|
||||||
explicit original_get_box(Strategy const& strategy)
|
explicit original_get_box(Strategy const& strategy)
|
||||||
|
@ -128,14 +128,14 @@ struct calculate_point_order_by_azimuth
|
|||||||
{
|
{
|
||||||
// Add point
|
// Add point
|
||||||
cleaned.push_back(clean_point_t(it));
|
cleaned.push_back(clean_point_t(it));
|
||||||
|
|
||||||
while (cleaned.size() >= 3)
|
while (cleaned.size() >= 3)
|
||||||
{
|
{
|
||||||
cleaned_iter_t it0 = cleaned.end() - 3;
|
cleaned_iter_t it0 = cleaned.end() - 3;
|
||||||
cleaned_iter_t it1 = cleaned.end() - 2;
|
cleaned_iter_t it1 = cleaned.end() - 2;
|
||||||
cleaned_iter_t it2 = cleaned.end() - 1;
|
cleaned_iter_t it2 = cleaned.end() - 1;
|
||||||
|
|
||||||
calc_t diff;
|
calc_t diff;
|
||||||
if (get_or_calculate_azimuths_difference(*it0, *it1, *it2, diff, strategy)
|
if (get_or_calculate_azimuths_difference(*it0, *it1, *it2, diff, strategy)
|
||||||
&& ! math::equals(math::abs(diff), pi))
|
&& ! math::equals(math::abs(diff), pi))
|
||||||
{
|
{
|
||||||
@ -148,7 +148,7 @@ struct calculate_point_order_by_azimuth
|
|||||||
// TODO: angles have to be invalidated only if spike is detected
|
// TODO: angles have to be invalidated only if spike is detected
|
||||||
// for duplicates it'd be ok to leave them
|
// for duplicates it'd be ok to leave them
|
||||||
it0->set_azimuth_invalid();
|
it0->set_azimuth_invalid();
|
||||||
it0->set_azimuth_difference_invalid();
|
it0->set_azimuth_difference_invalid();
|
||||||
it2->set_azimuth_difference_invalid();
|
it2->set_azimuth_difference_invalid();
|
||||||
cleaned.erase(it1);
|
cleaned.erase(it1);
|
||||||
}
|
}
|
||||||
@ -269,7 +269,7 @@ private:
|
|||||||
razi = p0.reverse_azimuth();
|
razi = p0.reverse_azimuth();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strategy.apply(p0.ref(), p1.ref(), azi, razi))
|
if (strategy.apply(p0.ref(), p1.ref(), azi, razi))
|
||||||
{
|
{
|
||||||
p0.set_azimuths(azi, razi);
|
p0.set_azimuths(azi, razi);
|
||||||
|
@ -75,7 +75,7 @@ struct translating_transformer<Geometry, areal_tag, cartesian_tag>
|
|||||||
{
|
{
|
||||||
typedef typename geometry::point_type<Geometry>::type point_type;
|
typedef typename geometry::point_type<Geometry>::type point_type;
|
||||||
typedef point_type result_type;
|
typedef point_type result_type;
|
||||||
|
|
||||||
explicit translating_transformer(Geometry const& geom)
|
explicit translating_transformer(Geometry const& geom)
|
||||||
: m_origin(NULL)
|
: m_origin(NULL)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ public:
|
|||||||
typename RangeIterator,
|
typename RangeIterator,
|
||||||
typename Strategy,
|
typename Strategy,
|
||||||
typename Distance
|
typename Distance
|
||||||
>
|
>
|
||||||
static inline RangeIterator apply(Geometry const& geometry,
|
static inline RangeIterator apply(Geometry const& geometry,
|
||||||
RangeIterator first,
|
RangeIterator first,
|
||||||
RangeIterator last,
|
RangeIterator last,
|
||||||
@ -111,7 +111,7 @@ public:
|
|||||||
typename Geometry,
|
typename Geometry,
|
||||||
typename RangeIterator,
|
typename RangeIterator,
|
||||||
typename Strategy
|
typename Strategy
|
||||||
>
|
>
|
||||||
static inline RangeIterator apply(Geometry const& geometry,
|
static inline RangeIterator apply(Geometry const& geometry,
|
||||||
RangeIterator first,
|
RangeIterator first,
|
||||||
RangeIterator last,
|
RangeIterator last,
|
||||||
|
@ -189,7 +189,7 @@ private:
|
|||||||
it_min1 = it_back;
|
it_min1 = it_back;
|
||||||
it_min2 = first;
|
it_min2 = first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef typename std::pair<iterator_type, iterator_type> return_type;
|
typedef typename std::pair<iterator_type, iterator_type> return_type;
|
||||||
|
@ -150,7 +150,7 @@ public:
|
|||||||
apply(rtree_first, rtree_last, queries_first, queries_last,
|
apply(rtree_first, rtree_last, queries_first, queries_last,
|
||||||
strategy, rtree_min, qit_min, dist_min);
|
strategy, rtree_min, qit_min, dist_min);
|
||||||
|
|
||||||
return std::make_pair(rtree_min, qit_min);
|
return std::make_pair(rtree_min, qit_min);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ namespace dispatch
|
|||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Geometry1,
|
typename Geometry1,
|
||||||
typename Geometry2,
|
typename Geometry2,
|
||||||
typename Tag1,
|
typename Tag1,
|
||||||
typename Tag2
|
typename Tag2
|
||||||
>
|
>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
@ -62,8 +62,8 @@ struct closest_points
|
|||||||
<
|
<
|
||||||
Geometry2, Geometry1, Tag2, Tag1, false
|
Geometry2, Geometry1, Tag2, Tag1, false
|
||||||
>::apply(g2, g1, shortest_seg, strategy);
|
>::apply(g2, g1, shortest_seg, strategy);
|
||||||
|
|
||||||
detail::closest_points::swap_segment_points::apply(shortest_seg);
|
detail::closest_points::swap_segment_points::apply(shortest_seg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,44 +44,44 @@ struct linear_to_areal
|
|||||||
>::type;
|
>::type;
|
||||||
|
|
||||||
using linestring_type = geometry::model::linestring<point_type>;
|
using linestring_type = geometry::model::linestring<point_type>;
|
||||||
|
|
||||||
/* TODO: currently intersection does not support some cases of tupled input
|
/* TODO: currently intersection does not support some cases of tupled input
|
||||||
* such as linestring - multipolygon
|
* such as linestring - multipolygon
|
||||||
* this could be implemented directly with dynamic geometries
|
* this could be implemented directly with dynamic geometries
|
||||||
using polygon_type = geometry::model::polygon<point_type>;
|
using polygon_type = geometry::model::polygon<point_type>;
|
||||||
std::tuple
|
std::tuple
|
||||||
<
|
<
|
||||||
geometry::model::multi_point<point_type>,
|
geometry::model::multi_point<point_type>,
|
||||||
geometry::model::multi_linestring<linestring_type>,
|
geometry::model::multi_linestring<linestring_type>,
|
||||||
geometry::model::multi_polygon<polygon_type>
|
geometry::model::multi_polygon<polygon_type>
|
||||||
> tp;
|
> tp;
|
||||||
bool intersect_tp = geometry::intersection(linear, areal, tp, strategies);
|
bool intersect_tp = geometry::intersection(linear, areal, tp, strategies);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
geometry::model::multi_point<point_type> mp_out;
|
geometry::model::multi_point<point_type> mp_out;
|
||||||
geometry::intersection(linear, areal, mp_out, strategies);
|
geometry::intersection(linear, areal, mp_out, strategies);
|
||||||
|
|
||||||
if (! boost::empty(mp_out))
|
if (! boost::empty(mp_out))
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(*boost::begin(mp_out),
|
set_segment_from_points::apply(*boost::begin(mp_out),
|
||||||
*boost::begin(mp_out),
|
*boost::begin(mp_out),
|
||||||
shortest_seg);
|
shortest_seg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there are no intersection points then check if the linear geometry
|
// if there are no intersection points then check if the linear geometry
|
||||||
// (or part of it) is inside the areal and return any point of this part
|
// (or part of it) is inside the areal and return any point of this part
|
||||||
geometry::model::multi_linestring<linestring_type> ln_out;
|
geometry::model::multi_linestring<linestring_type> ln_out;
|
||||||
geometry::intersection(linear, areal, ln_out, strategies);
|
geometry::intersection(linear, areal, ln_out, strategies);
|
||||||
|
|
||||||
if (! boost::empty(ln_out))
|
if (! boost::empty(ln_out))
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(*boost::begin(*boost::begin(ln_out)),
|
set_segment_from_points::apply(*boost::begin(*boost::begin(ln_out)),
|
||||||
*boost::begin(*boost::begin(ln_out)),
|
*boost::begin(*boost::begin(ln_out)),
|
||||||
shortest_seg);
|
shortest_seg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
linear_to_linear::apply(linear, areal, shortest_seg, strategies, false);
|
linear_to_linear::apply(linear, areal, shortest_seg, strategies, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -104,7 +104,7 @@ struct segment_to_areal
|
|||||||
template <typename Segment, typename Areal, typename OutSegment, typename Strategies>
|
template <typename Segment, typename Areal, typename OutSegment, typename Strategies>
|
||||||
static inline void apply(Segment const& segment,
|
static inline void apply(Segment const& segment,
|
||||||
Areal const& areal,
|
Areal const& areal,
|
||||||
OutSegment& shortest_seg,
|
OutSegment& shortest_seg,
|
||||||
Strategies const& strategies,
|
Strategies const& strategies,
|
||||||
bool = false)
|
bool = false)
|
||||||
{
|
{
|
||||||
@ -120,7 +120,7 @@ struct areal_to_segment
|
|||||||
template <typename Areal, typename Segment, typename OutSegment, typename Strategies>
|
template <typename Areal, typename Segment, typename OutSegment, typename Strategies>
|
||||||
static inline void apply(Areal const& areal,
|
static inline void apply(Areal const& areal,
|
||||||
Segment const& segment,
|
Segment const& segment,
|
||||||
OutSegment& shortest_seg,
|
OutSegment& shortest_seg,
|
||||||
Strategies const& strategies,
|
Strategies const& strategies,
|
||||||
bool = false)
|
bool = false)
|
||||||
{
|
{
|
||||||
@ -148,47 +148,47 @@ struct areal_to_areal
|
|||||||
|
|
||||||
using linestring_type = geometry::model::linestring<point_type>;
|
using linestring_type = geometry::model::linestring<point_type>;
|
||||||
using polygon_type = geometry::model::polygon<point_type>;
|
using polygon_type = geometry::model::polygon<point_type>;
|
||||||
|
|
||||||
/* TODO: currently intersection does not support tupled input
|
/* TODO: currently intersection does not support tupled input
|
||||||
* this should be implemented directly with dynamic geometries
|
* this should be implemented directly with dynamic geometries
|
||||||
*/
|
*/
|
||||||
|
|
||||||
geometry::model::multi_point<point_type> mp_out;
|
geometry::model::multi_point<point_type> mp_out;
|
||||||
geometry::intersection(areal1, areal2, mp_out, strategies);
|
geometry::intersection(areal1, areal2, mp_out, strategies);
|
||||||
|
|
||||||
if (! boost::empty(mp_out))
|
if (! boost::empty(mp_out))
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(*boost::begin(mp_out),
|
set_segment_from_points::apply(*boost::begin(mp_out),
|
||||||
*boost::begin(mp_out),
|
*boost::begin(mp_out),
|
||||||
shortest_seg);
|
shortest_seg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there are no intersection points then the linear geometry (or part of it)
|
// if there are no intersection points then the linear geometry (or part of it)
|
||||||
// is inside the areal; return any point of this part
|
// is inside the areal; return any point of this part
|
||||||
geometry::model::multi_linestring<linestring_type> ln_out;
|
geometry::model::multi_linestring<linestring_type> ln_out;
|
||||||
geometry::intersection(areal1, areal2, ln_out, strategies);
|
geometry::intersection(areal1, areal2, ln_out, strategies);
|
||||||
|
|
||||||
if (! boost::empty(ln_out))
|
if (! boost::empty(ln_out))
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(*boost::begin(*boost::begin(ln_out)),
|
set_segment_from_points::apply(*boost::begin(*boost::begin(ln_out)),
|
||||||
*boost::begin(*boost::begin(ln_out)),
|
*boost::begin(*boost::begin(ln_out)),
|
||||||
shortest_seg);
|
shortest_seg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
geometry::model::multi_polygon<polygon_type> pl_out;
|
geometry::model::multi_polygon<polygon_type> pl_out;
|
||||||
geometry::intersection(areal1, areal2, pl_out, strategies);
|
geometry::intersection(areal1, areal2, pl_out, strategies);
|
||||||
|
|
||||||
if (! boost::empty(pl_out))
|
if (! boost::empty(pl_out))
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(
|
set_segment_from_points::apply(
|
||||||
*boost::begin(boost::geometry::exterior_ring(*boost::begin(pl_out))),
|
*boost::begin(boost::geometry::exterior_ring(*boost::begin(pl_out))),
|
||||||
*boost::begin(boost::geometry::exterior_ring(*boost::begin(pl_out))),
|
*boost::begin(boost::geometry::exterior_ring(*boost::begin(pl_out))),
|
||||||
shortest_seg);
|
shortest_seg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
linear_to_linear::apply(areal1, areal2, shortest_seg, strategies, false);
|
linear_to_linear::apply(areal1, areal2, shortest_seg, strategies, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -205,7 +205,7 @@ namespace dispatch
|
|||||||
template <typename Linear, typename Areal>
|
template <typename Linear, typename Areal>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Linear, Areal,
|
Linear, Areal,
|
||||||
linear_tag, areal_tag,
|
linear_tag, areal_tag,
|
||||||
false
|
false
|
||||||
>
|
>
|
||||||
@ -216,7 +216,7 @@ template <typename Areal, typename Linear>
|
|||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Areal, Linear,
|
Areal, Linear,
|
||||||
areal_tag, linear_tag,
|
areal_tag, linear_tag,
|
||||||
false
|
false
|
||||||
>
|
>
|
||||||
: detail::closest_points::areal_to_linear
|
: detail::closest_points::areal_to_linear
|
||||||
@ -225,7 +225,7 @@ struct closest_points
|
|||||||
template <typename Segment, typename Areal>
|
template <typename Segment, typename Areal>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Segment, Areal,
|
Segment, Areal,
|
||||||
segment_tag, areal_tag,
|
segment_tag, areal_tag,
|
||||||
false
|
false
|
||||||
>
|
>
|
||||||
@ -236,7 +236,7 @@ template <typename Areal, typename Segment>
|
|||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Areal, Segment,
|
Areal, Segment,
|
||||||
areal_tag, segment_tag,
|
areal_tag, segment_tag,
|
||||||
false
|
false
|
||||||
>
|
>
|
||||||
: detail::closest_points::areal_to_segment
|
: detail::closest_points::areal_to_segment
|
||||||
@ -246,7 +246,7 @@ template <typename Areal1, typename Areal2>
|
|||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Areal1, Areal2,
|
Areal1, Areal2,
|
||||||
areal_tag, areal_tag,
|
areal_tag, areal_tag,
|
||||||
false
|
false
|
||||||
>
|
>
|
||||||
: detail::closest_points::areal_to_areal
|
: detail::closest_points::areal_to_areal
|
||||||
|
@ -35,7 +35,7 @@ struct linear_to_linear
|
|||||||
template <typename Linear1, typename Linear2, typename Segment, typename Strategies>
|
template <typename Linear1, typename Linear2, typename Segment, typename Strategies>
|
||||||
static inline void apply(Linear1 const& linear1,
|
static inline void apply(Linear1 const& linear1,
|
||||||
Linear2 const& linear2,
|
Linear2 const& linear2,
|
||||||
Segment& shortest_seg,
|
Segment& shortest_seg,
|
||||||
Strategies const& strategies,
|
Strategies const& strategies,
|
||||||
bool = false)
|
bool = false)
|
||||||
{
|
{
|
||||||
@ -86,7 +86,7 @@ struct segment_to_linear
|
|||||||
template <typename Segment, typename Linear, typename OutSegment, typename Strategies>
|
template <typename Segment, typename Linear, typename OutSegment, typename Strategies>
|
||||||
static inline void apply(Segment const& segment,
|
static inline void apply(Segment const& segment,
|
||||||
Linear const& linear,
|
Linear const& linear,
|
||||||
OutSegment& shortest_seg,
|
OutSegment& shortest_seg,
|
||||||
Strategies const& strategies,
|
Strategies const& strategies,
|
||||||
bool = false)
|
bool = false)
|
||||||
{
|
{
|
||||||
@ -103,7 +103,7 @@ struct linear_to_segment
|
|||||||
template <typename Linear, typename Segment, typename OutSegment, typename Strategies>
|
template <typename Linear, typename Segment, typename OutSegment, typename Strategies>
|
||||||
static inline void apply(Linear const& linear,
|
static inline void apply(Linear const& linear,
|
||||||
Segment const& segment,
|
Segment const& segment,
|
||||||
OutSegment& shortest_seg,
|
OutSegment& shortest_seg,
|
||||||
Strategies const& strategies,
|
Strategies const& strategies,
|
||||||
bool = false)
|
bool = false)
|
||||||
{
|
{
|
||||||
@ -124,7 +124,7 @@ template <typename Linear1, typename Linear2>
|
|||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Linear1, Linear2,
|
Linear1, Linear2,
|
||||||
linear_tag, linear_tag,
|
linear_tag, linear_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::linear_to_linear
|
> : detail::closest_points::linear_to_linear
|
||||||
{};
|
{};
|
||||||
@ -132,7 +132,7 @@ struct closest_points
|
|||||||
template <typename Segment, typename Linear>
|
template <typename Segment, typename Linear>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Segment, Linear,
|
Segment, Linear,
|
||||||
segment_tag, linear_tag,
|
segment_tag, linear_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::segment_to_linear
|
> : detail::closest_points::segment_to_linear
|
||||||
@ -141,7 +141,7 @@ struct closest_points
|
|||||||
template <typename Linear, typename Segment>
|
template <typename Linear, typename Segment>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Linear, Segment,
|
Linear, Segment,
|
||||||
linear_tag, segment_tag,
|
linear_tag, segment_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::linear_to_segment
|
> : detail::closest_points::linear_to_segment
|
||||||
|
@ -33,11 +33,11 @@ namespace detail { namespace closest_points
|
|||||||
|
|
||||||
struct multipoint_to_multipoint
|
struct multipoint_to_multipoint
|
||||||
{
|
{
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename MultiPoint1,
|
typename MultiPoint1,
|
||||||
typename MultiPoint2,
|
typename MultiPoint2,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(MultiPoint1 const& multipoint1,
|
static inline void apply(MultiPoint1 const& multipoint1,
|
||||||
@ -67,11 +67,11 @@ struct multipoint_to_multipoint
|
|||||||
|
|
||||||
struct multipoint_to_linear
|
struct multipoint_to_linear
|
||||||
{
|
{
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename MultiPoint,
|
typename MultiPoint,
|
||||||
typename Linear,
|
typename Linear,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(MultiPoint const& multipoint,
|
static inline void apply(MultiPoint const& multipoint,
|
||||||
@ -90,11 +90,11 @@ struct multipoint_to_linear
|
|||||||
|
|
||||||
struct linear_to_multipoint
|
struct linear_to_multipoint
|
||||||
{
|
{
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Linear,
|
typename Linear,
|
||||||
typename MultiPoint,
|
typename MultiPoint,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(Linear const& linear,
|
static inline void apply(Linear const& linear,
|
||||||
@ -109,11 +109,11 @@ struct linear_to_multipoint
|
|||||||
|
|
||||||
struct segment_to_multipoint
|
struct segment_to_multipoint
|
||||||
{
|
{
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename MultiPoint,
|
typename MultiPoint,
|
||||||
typename OutSegment,
|
typename OutSegment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(Segment const& segment,
|
static inline void apply(Segment const& segment,
|
||||||
@ -134,11 +134,11 @@ struct segment_to_multipoint
|
|||||||
|
|
||||||
struct multipoint_to_segment
|
struct multipoint_to_segment
|
||||||
{
|
{
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename MultiPoint,
|
typename MultiPoint,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename OutSegment,
|
typename OutSegment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(MultiPoint const& multipoint,
|
static inline void apply(MultiPoint const& multipoint,
|
||||||
@ -152,7 +152,7 @@ struct multipoint_to_segment
|
|||||||
>;
|
>;
|
||||||
linestring_type linestring;
|
linestring_type linestring;
|
||||||
convert(segment, linestring);
|
convert(segment, linestring);
|
||||||
multipoint_to_linear::apply(multipoint, linestring, shortest_seg,
|
multipoint_to_linear::apply(multipoint, linestring, shortest_seg,
|
||||||
strategies);
|
strategies);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -182,11 +182,11 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename MultiPoint,
|
typename MultiPoint,
|
||||||
typename Areal,
|
typename Areal,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(MultiPoint const& multipoint,
|
static inline void apply(MultiPoint const& multipoint,
|
||||||
@ -200,11 +200,11 @@ public:
|
|||||||
boost::begin(multipoint),
|
boost::begin(multipoint),
|
||||||
boost::end(multipoint),
|
boost::end(multipoint),
|
||||||
predicate);
|
predicate);
|
||||||
|
|
||||||
if (it != boost::end(multipoint))
|
if (it != boost::end(multipoint))
|
||||||
{
|
{
|
||||||
return set_segment_from_points::apply(*it, *it, shortest_seg);
|
return set_segment_from_points::apply(*it, *it, shortest_seg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
point_or_segment_range_to_geometry_rtree::apply(
|
point_or_segment_range_to_geometry_rtree::apply(
|
||||||
@ -218,11 +218,11 @@ public:
|
|||||||
|
|
||||||
struct areal_to_multipoint
|
struct areal_to_multipoint
|
||||||
{
|
{
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Areal,
|
typename Areal,
|
||||||
typename MultiPoint,
|
typename MultiPoint,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(Areal const& areal,
|
static inline void apply(Areal const& areal,
|
||||||
@ -248,7 +248,7 @@ namespace dispatch
|
|||||||
template <typename MultiPoint1, typename MultiPoint2>
|
template <typename MultiPoint1, typename MultiPoint2>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
MultiPoint1, MultiPoint2,
|
MultiPoint1, MultiPoint2,
|
||||||
multi_point_tag, multi_point_tag,
|
multi_point_tag, multi_point_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::multipoint_to_multipoint
|
> : detail::closest_points::multipoint_to_multipoint
|
||||||
@ -258,7 +258,7 @@ struct closest_points
|
|||||||
template <typename MultiPoint, typename Linear>
|
template <typename MultiPoint, typename Linear>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
MultiPoint, Linear,
|
MultiPoint, Linear,
|
||||||
multi_point_tag, linear_tag,
|
multi_point_tag, linear_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::multipoint_to_linear
|
> : detail::closest_points::multipoint_to_linear
|
||||||
@ -268,7 +268,7 @@ struct closest_points
|
|||||||
template <typename Linear, typename MultiPoint>
|
template <typename Linear, typename MultiPoint>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Linear, MultiPoint,
|
Linear, MultiPoint,
|
||||||
linear_tag, multi_point_tag,
|
linear_tag, multi_point_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::linear_to_multipoint
|
> : detail::closest_points::linear_to_multipoint
|
||||||
@ -278,7 +278,7 @@ struct closest_points
|
|||||||
template <typename MultiPoint, typename Segment>
|
template <typename MultiPoint, typename Segment>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
MultiPoint, Segment,
|
MultiPoint, Segment,
|
||||||
multi_point_tag, segment_tag,
|
multi_point_tag, segment_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::multipoint_to_segment
|
> : detail::closest_points::multipoint_to_segment
|
||||||
@ -288,7 +288,7 @@ struct closest_points
|
|||||||
template <typename Segment, typename MultiPoint>
|
template <typename Segment, typename MultiPoint>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Segment, MultiPoint,
|
Segment, MultiPoint,
|
||||||
segment_tag, multi_point_tag,
|
segment_tag, multi_point_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::segment_to_multipoint
|
> : detail::closest_points::segment_to_multipoint
|
||||||
@ -298,7 +298,7 @@ struct closest_points
|
|||||||
template <typename MultiPoint, typename Areal>
|
template <typename MultiPoint, typename Areal>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
MultiPoint, Areal,
|
MultiPoint, Areal,
|
||||||
multi_point_tag, areal_tag,
|
multi_point_tag, areal_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::multipoint_to_areal
|
> : detail::closest_points::multipoint_to_areal
|
||||||
@ -308,7 +308,7 @@ struct closest_points
|
|||||||
template <typename Areal, typename MultiPoint>
|
template <typename Areal, typename MultiPoint>
|
||||||
struct closest_points
|
struct closest_points
|
||||||
<
|
<
|
||||||
Areal, MultiPoint,
|
Areal, MultiPoint,
|
||||||
areal_tag, multi_point_tag,
|
areal_tag, multi_point_tag,
|
||||||
false
|
false
|
||||||
> : detail::closest_points::areal_to_multipoint
|
> : detail::closest_points::areal_to_multipoint
|
||||||
|
@ -53,7 +53,7 @@ namespace detail { namespace closest_points
|
|||||||
struct point_to_point
|
struct point_to_point
|
||||||
{
|
{
|
||||||
template <typename P1, typename P2, typename Segment, typename Strategies>
|
template <typename P1, typename P2, typename Segment, typename Strategies>
|
||||||
static inline void apply(P1 const& p1, P2 const& p2,
|
static inline void apply(P1 const& p1, P2 const& p2,
|
||||||
Segment& shortest_seg, Strategies const&)
|
Segment& shortest_seg, Strategies const&)
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(p1, p2, shortest_seg);
|
set_segment_from_points::apply(p1, p2, shortest_seg);
|
||||||
@ -75,7 +75,7 @@ struct point_to_segment
|
|||||||
auto closest_point = strategies.closest_points(point, segment)
|
auto closest_point = strategies.closest_points(point, segment)
|
||||||
.apply(point, p[0], p[1]);
|
.apply(point, p[0], p[1]);
|
||||||
|
|
||||||
set_segment_from_points::apply(point, closest_point, shortest_seg);
|
set_segment_from_points::apply(point, closest_point, shortest_seg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -114,22 +114,22 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
closest_points::creturn_t<Point, Range, Strategies> cd_min;
|
closest_points::creturn_t<Point, Range, Strategies> cd_min;
|
||||||
|
|
||||||
auto comparable_distance = strategy::distance::services::get_comparable
|
auto comparable_distance = strategy::distance::services::get_comparable
|
||||||
<
|
<
|
||||||
decltype(strategies.distance(point, range))
|
decltype(strategies.distance(point, range))
|
||||||
>::apply(strategies.distance(point, range));
|
>::apply(strategies.distance(point, range));
|
||||||
|
|
||||||
auto closest_segment = point_to_point_range::apply(point,
|
auto closest_segment = point_to_point_range::apply(point,
|
||||||
boost::begin(range),
|
boost::begin(range),
|
||||||
boost::end(range),
|
boost::end(range),
|
||||||
comparable_distance,
|
comparable_distance,
|
||||||
cd_min);
|
cd_min);
|
||||||
|
|
||||||
auto closest_point = strategies.closest_points(point, range)
|
auto closest_point = strategies.closest_points(point, range)
|
||||||
.apply(point, *closest_segment.first, *closest_segment.second);
|
.apply(point, *closest_segment.first, *closest_segment.second);
|
||||||
|
|
||||||
set_segment_from_points::apply(point, closest_point, shortest_seg);
|
set_segment_from_points::apply(point, closest_point, shortest_seg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ struct point_to_ring
|
|||||||
{
|
{
|
||||||
if (within::within_point_geometry(point, ring, strategies))
|
if (within::within_point_geometry(point, ring, strategies))
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(point, point, shortest_seg);
|
set_segment_from_points::apply(point, point, shortest_seg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -154,7 +154,7 @@ struct point_to_ring
|
|||||||
closure<Ring>::value
|
closure<Ring>::value
|
||||||
>::apply(point, ring, shortest_seg, strategies);
|
>::apply(point, ring, shortest_seg, strategies);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -165,11 +165,11 @@ class point_to_polygon
|
|||||||
template <typename Polygon>
|
template <typename Polygon>
|
||||||
struct distance_to_interior_rings
|
struct distance_to_interior_rings
|
||||||
{
|
{
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Point,
|
typename Point,
|
||||||
typename InteriorRingIterator,
|
typename InteriorRingIterator,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(Point const& point,
|
static inline void apply(Point const& point,
|
||||||
@ -191,14 +191,14 @@ class point_to_polygon
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_segment_from_points::apply(point, point, shortest_seg);
|
set_segment_from_points::apply(point, point, shortest_seg);
|
||||||
}
|
}
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Point,
|
typename Point,
|
||||||
typename InteriorRings,
|
typename InteriorRings,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(Point const& point, InteriorRings const& interior_rings,
|
static inline void apply(Point const& point, InteriorRings const& interior_rings,
|
||||||
@ -214,11 +214,11 @@ class point_to_polygon
|
|||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Point,
|
typename Point,
|
||||||
typename Polygon,
|
typename Polygon,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
typename Strategies
|
typename Strategies
|
||||||
>
|
>
|
||||||
static inline void apply(Point const& point,
|
static inline void apply(Point const& point,
|
||||||
@ -261,7 +261,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Point,
|
typename Point,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
@ -287,7 +287,7 @@ public:
|
|||||||
selector_type::end(multigeometry),
|
selector_type::end(multigeometry),
|
||||||
comparable_distance,
|
comparable_distance,
|
||||||
cd);
|
cd);
|
||||||
|
|
||||||
dispatch::closest_points
|
dispatch::closest_points
|
||||||
<
|
<
|
||||||
Point,
|
Point,
|
||||||
@ -305,7 +305,7 @@ public:
|
|||||||
template <typename MultiPolygon>
|
template <typename MultiPolygon>
|
||||||
struct point_to_multigeometry<MultiPolygon, true>
|
struct point_to_multigeometry<MultiPolygon, true>
|
||||||
{
|
{
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Point,
|
typename Point,
|
||||||
typename Segment,
|
typename Segment,
|
||||||
@ -318,7 +318,7 @@ struct point_to_multigeometry<MultiPolygon, true>
|
|||||||
{
|
{
|
||||||
if (within::covered_by_point_geometry(point, multipolygon, strategies))
|
if (within::covered_by_point_geometry(point, multipolygon, strategies))
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(point, point, shortest_seg);
|
set_segment_from_points::apply(point, point, shortest_seg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public:
|
|||||||
cd);
|
cd);
|
||||||
dispatch::closest_points
|
dispatch::closest_points
|
||||||
<
|
<
|
||||||
point_or_segment_type,
|
point_or_segment_type,
|
||||||
typename std::iterator_traits
|
typename std::iterator_traits
|
||||||
<
|
<
|
||||||
typename selector_type::iterator_type
|
typename selector_type::iterator_type
|
||||||
|
@ -44,7 +44,7 @@ namespace detail { namespace closest_points
|
|||||||
class segment_to_segment
|
class segment_to_segment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template <typename Segment1, typename Segment2, typename OutputSegment, typename Strategies>
|
template <typename Segment1, typename Segment2, typename OutputSegment, typename Strategies>
|
||||||
static inline void apply(Segment1 const& segment1, Segment2 const& segment2,
|
static inline void apply(Segment1 const& segment1, Segment2 const& segment2,
|
||||||
OutputSegment& shortest_seg,
|
OutputSegment& shortest_seg,
|
||||||
@ -66,12 +66,12 @@ public:
|
|||||||
intersection_policy());
|
intersection_policy());
|
||||||
if (is.count > 0)
|
if (is.count > 0)
|
||||||
{
|
{
|
||||||
set_segment_from_points::apply(is.intersections[0],
|
set_segment_from_points::apply(is.intersections[0],
|
||||||
is.intersections[0],
|
is.intersections[0],
|
||||||
shortest_seg);
|
shortest_seg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename point_type<Segment1>::type p[2];
|
typename point_type<Segment1>::type p[2];
|
||||||
detail::assign_point_from_index<0>(segment1, p[0]);
|
detail::assign_point_from_index<0>(segment1, p[0]);
|
||||||
detail::assign_point_from_index<1>(segment1, p[1]);
|
detail::assign_point_from_index<1>(segment1, p[1]);
|
||||||
@ -86,17 +86,17 @@ public:
|
|||||||
auto cp3 = strategies.closest_points(p[1], segment2).apply(p[1], q[0], q[1]);
|
auto cp3 = strategies.closest_points(p[1], segment2).apply(p[1], q[0], q[1]);
|
||||||
|
|
||||||
closest_points::creturn_t<Segment1, Segment2, Strategies> d[4];
|
closest_points::creturn_t<Segment1, Segment2, Strategies> d[4];
|
||||||
|
|
||||||
auto const cds = strategies::distance::detail::make_comparable(strategies)
|
auto const cds = strategies::distance::detail::make_comparable(strategies)
|
||||||
.distance(detail::dummy_point(), detail::dummy_point());
|
.distance(detail::dummy_point(), detail::dummy_point());
|
||||||
|
|
||||||
d[0] = cds.apply(cp0, q[0]);
|
d[0] = cds.apply(cp0, q[0]);
|
||||||
d[1] = cds.apply(cp1, q[1]);
|
d[1] = cds.apply(cp1, q[1]);
|
||||||
d[2] = cds.apply(p[0], cp2);
|
d[2] = cds.apply(p[0], cp2);
|
||||||
d[3] = cds.apply(p[1], cp3);
|
d[3] = cds.apply(p[1], cp3);
|
||||||
|
|
||||||
std::size_t imin = std::distance(boost::addressof(d[0]), std::min_element(d, d + 4));
|
std::size_t imin = std::distance(boost::addressof(d[0]), std::min_element(d, d + 4));
|
||||||
|
|
||||||
switch (imin)
|
switch (imin)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -84,7 +84,7 @@ struct comparable_distance<Strategy, false>
|
|||||||
<
|
<
|
||||||
strategies_type
|
strategies_type
|
||||||
> comparable_strategies_type;
|
> comparable_strategies_type;
|
||||||
|
|
||||||
return dispatch::distance
|
return dispatch::distance
|
||||||
<
|
<
|
||||||
Geometry1, Geometry2,
|
Geometry1, Geometry2,
|
||||||
|
@ -207,7 +207,7 @@ struct convex_hull
|
|||||||
OutputGeometry& out,
|
OutputGeometry& out,
|
||||||
Strategy const& strategy)
|
Strategy const& strategy)
|
||||||
{
|
{
|
||||||
detail::convex_hull::input_geometry_proxy<Geometry> in_proxy(geometry);
|
detail::convex_hull::input_geometry_proxy<Geometry> in_proxy(geometry);
|
||||||
detail::convex_hull::graham_andrew
|
detail::convex_hull::graham_andrew
|
||||||
<
|
<
|
||||||
typename point_type<Geometry>::type
|
typename point_type<Geometry>::type
|
||||||
|
@ -113,7 +113,7 @@ struct direction_code_impl<spherical_equatorial_tag>
|
|||||||
coord1_t const b1 = geometry::get<1>(segment_b);
|
coord1_t const b1 = geometry::get<1>(segment_b);
|
||||||
coord2_t const p0 = geometry::get<0>(p);
|
coord2_t const p0 = geometry::get<0>(p);
|
||||||
coord2_t const p1 = geometry::get<1>(p);
|
coord2_t const p1 = geometry::get<1>(p);
|
||||||
|
|
||||||
if ( (math::equals(b0, a0) && math::equals(b1, a1))
|
if ( (math::equals(b0, a0) && math::equals(b1, a1))
|
||||||
|| (math::equals(b0, p0) && math::equals(b1, p1)) )
|
|| (math::equals(b0, p0) && math::equals(b1, p1)) )
|
||||||
{
|
{
|
||||||
|
@ -142,7 +142,7 @@ struct disjoint_segment_areal
|
|||||||
template <typename Segment, typename Polygon>
|
template <typename Segment, typename Polygon>
|
||||||
class disjoint_segment_areal<Segment, Polygon, polygon_tag>
|
class disjoint_segment_areal<Segment, Polygon, polygon_tag>
|
||||||
{
|
{
|
||||||
|
|
||||||
template <typename InteriorRings, typename Strategy>
|
template <typename InteriorRings, typename Strategy>
|
||||||
static inline
|
static inline
|
||||||
bool check_interior_rings(InteriorRings const& interior_rings,
|
bool check_interior_rings(InteriorRings const& interior_rings,
|
||||||
|
@ -286,7 +286,7 @@ public:
|
|||||||
typedef typename point_type<MultiPoint>::type point1_type;
|
typedef typename point_type<MultiPoint>::type point1_type;
|
||||||
typedef typename point_type<SingleGeometry>::type point2_type;
|
typedef typename point_type<SingleGeometry>::type point2_type;
|
||||||
typedef model::box<point2_type> box2_type;
|
typedef model::box<point2_type> box2_type;
|
||||||
|
|
||||||
box2_type box2;
|
box2_type box2;
|
||||||
geometry::envelope(single_geometry, box2, strategy);
|
geometry::envelope(single_geometry, box2, strategy);
|
||||||
geometry::detail::expand_by_epsilon(box2);
|
geometry::detail::expand_by_epsilon(box2);
|
||||||
@ -431,7 +431,7 @@ public:
|
|||||||
typedef model::box<point1_type> box1_type;
|
typedef model::box<point1_type> box1_type;
|
||||||
typedef model::box<point2_type> box2_type;
|
typedef model::box<point2_type> box2_type;
|
||||||
typedef std::pair<box2_type, std::size_t> box_pair_type;
|
typedef std::pair<box2_type, std::size_t> box_pair_type;
|
||||||
|
|
||||||
std::size_t count2 = boost::size(multi_geometry);
|
std::size_t count2 = boost::size(multi_geometry);
|
||||||
std::vector<box_pair_type> boxes(count2);
|
std::vector<box_pair_type> boxes(count2);
|
||||||
for (std::size_t i = 0 ; i < count2 ; ++i)
|
for (std::size_t i = 0 ; i < count2 ; ++i)
|
||||||
@ -530,7 +530,7 @@ struct disjoint
|
|||||||
{
|
{
|
||||||
return detail::disjoint::multipoint_multipoint
|
return detail::disjoint::multipoint_multipoint
|
||||||
::apply(multipoint2, multipoint1, strategy);
|
::apply(multipoint2, multipoint1, strategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return detail::disjoint::multipoint_multipoint
|
return detail::disjoint::multipoint_multipoint
|
||||||
::apply(multipoint1, multipoint2, strategy);
|
::apply(multipoint1, multipoint2, strategy);
|
||||||
|
@ -54,7 +54,7 @@ template
|
|||||||
>
|
>
|
||||||
struct segment_or_box_point_range_closure
|
struct segment_or_box_point_range_closure
|
||||||
: not_implemented<SegmentOrBox>
|
: not_implemented<SegmentOrBox>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
template <typename Segment>
|
template <typename Segment>
|
||||||
struct segment_or_box_point_range_closure<Segment, segment_tag>
|
struct segment_or_box_point_range_closure<Segment, segment_tag>
|
||||||
@ -196,7 +196,7 @@ public:
|
|||||||
|
|
||||||
assign_segment_or_box_points
|
assign_segment_or_box_points
|
||||||
<
|
<
|
||||||
SegmentOrBox,
|
SegmentOrBox,
|
||||||
std::vector<segment_or_box_point>
|
std::vector<segment_or_box_point>
|
||||||
>::apply(segment_or_box, seg_or_box_points);
|
>::apply(segment_or_box, seg_or_box_points);
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline return_type apply(SegmentOrBox const& segment_or_box, Geometry const& geometry,
|
static inline return_type apply(SegmentOrBox const& segment_or_box, Geometry const& geometry,
|
||||||
Strategies const& strategies, bool check_intersection = true)
|
Strategies const& strategies, bool check_intersection = true)
|
||||||
{
|
{
|
||||||
return apply(geometry, segment_or_box, strategies, check_intersection);
|
return apply(geometry, segment_or_box, strategies, check_intersection);
|
||||||
|
@ -91,7 +91,7 @@ template <typename Linear, typename Areal, typename Strategy>
|
|||||||
struct distance
|
struct distance
|
||||||
<
|
<
|
||||||
Linear, Areal, Strategy,
|
Linear, Areal, Strategy,
|
||||||
linear_tag, areal_tag,
|
linear_tag, areal_tag,
|
||||||
strategy_tag_distance_point_segment, false
|
strategy_tag_distance_point_segment, false
|
||||||
>
|
>
|
||||||
: detail::distance::linear_to_areal
|
: detail::distance::linear_to_areal
|
||||||
@ -104,7 +104,7 @@ template <typename Areal, typename Linear, typename Strategy>
|
|||||||
struct distance
|
struct distance
|
||||||
<
|
<
|
||||||
Areal, Linear, Strategy,
|
Areal, Linear, Strategy,
|
||||||
areal_tag, linear_tag,
|
areal_tag, linear_tag,
|
||||||
strategy_tag_distance_point_segment, false
|
strategy_tag_distance_point_segment, false
|
||||||
>
|
>
|
||||||
: detail::distance::linear_to_areal
|
: detail::distance::linear_to_areal
|
||||||
@ -118,7 +118,7 @@ template <typename Areal1, typename Areal2, typename Strategy>
|
|||||||
struct distance
|
struct distance
|
||||||
<
|
<
|
||||||
Areal1, Areal2, Strategy,
|
Areal1, Areal2, Strategy,
|
||||||
areal_tag, areal_tag,
|
areal_tag, areal_tag,
|
||||||
strategy_tag_distance_point_segment, false
|
strategy_tag_distance_point_segment, false
|
||||||
>
|
>
|
||||||
: detail::distance::areal_to_areal
|
: detail::distance::areal_to_areal
|
||||||
|
@ -102,7 +102,7 @@ template <typename Linear1, typename Linear2, typename Strategy, typename Strate
|
|||||||
struct distance
|
struct distance
|
||||||
<
|
<
|
||||||
Linear1, Linear2, Strategy,
|
Linear1, Linear2, Strategy,
|
||||||
linear_tag, linear_tag,
|
linear_tag, linear_tag,
|
||||||
StrategyTag, false
|
StrategyTag, false
|
||||||
> : detail::distance::linear_to_linear
|
> : detail::distance::linear_to_linear
|
||||||
<
|
<
|
||||||
|
@ -127,7 +127,7 @@ public:
|
|||||||
{
|
{
|
||||||
covered_by_areal predicate(areal, strategies);
|
covered_by_areal predicate(areal, strategies);
|
||||||
|
|
||||||
if (! boost::empty(multipoint) &&
|
if (! boost::empty(multipoint) &&
|
||||||
std::none_of(boost::begin(multipoint), boost::end(multipoint), predicate))
|
std::none_of(boost::begin(multipoint), boost::end(multipoint), predicate))
|
||||||
{
|
{
|
||||||
return detail::distance::point_or_segment_range_to_geometry_rtree
|
return detail::distance::point_or_segment_range_to_geometry_rtree
|
||||||
|
@ -95,7 +95,7 @@ public:
|
|||||||
:
|
:
|
||||||
dispatch::distance
|
dispatch::distance
|
||||||
<
|
<
|
||||||
point_or_segment_type,
|
point_or_segment_type,
|
||||||
typename std::iterator_traits
|
typename std::iterator_traits
|
||||||
<
|
<
|
||||||
typename selector_type::iterator_type
|
typename selector_type::iterator_type
|
||||||
|
@ -91,7 +91,7 @@ private:
|
|||||||
std::vector<box_point>,
|
std::vector<box_point>,
|
||||||
open
|
open
|
||||||
> point_to_point_range;
|
> point_to_point_range;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// TODO: Or should the return type be defined by sb_strategy_type?
|
// TODO: Or should the return type be defined by sb_strategy_type?
|
||||||
typedef distance::return_t<box_point, Segment, Strategies> return_type;
|
typedef distance::return_t<box_point, Segment, Strategies> return_type;
|
||||||
@ -114,7 +114,7 @@ public:
|
|||||||
// get box points
|
// get box points
|
||||||
std::vector<box_point> box_points(4);
|
std::vector<box_point> box_points(4);
|
||||||
detail::assign_box_corners_oriented<true>(box, box_points);
|
detail::assign_box_corners_oriented<true>(box, box_points);
|
||||||
|
|
||||||
ps_strategy_type const strategy = strategies.distance(dummy_point(), dummy_segment());
|
ps_strategy_type const strategy = strategies.distance(dummy_point(), dummy_segment());
|
||||||
|
|
||||||
auto const cstrategy = strategy::distance::services::get_comparable
|
auto const cstrategy = strategy::distance::services::get_comparable
|
||||||
@ -192,7 +192,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
// TODO: Or should the return type be defined by sb_strategy_type?
|
// TODO: Or should the return type be defined by sb_strategy_type?
|
||||||
typedef distance::return_t<box_point, Segment, Strategies> return_type;
|
typedef distance::return_t<box_point, Segment, Strategies> return_type;
|
||||||
|
|
||||||
static inline return_type apply(Segment const& segment,
|
static inline return_type apply(Segment const& segment,
|
||||||
Box const& box,
|
Box const& box,
|
||||||
Strategies const& strategies,
|
Strategies const& strategies,
|
||||||
|
@ -36,7 +36,7 @@ struct envelope<Collection, geometry_collection_tag>
|
|||||||
Strategies const& strategies)
|
Strategies const& strategies)
|
||||||
{
|
{
|
||||||
using strategy_t = decltype(strategies.envelope(geometry, mbr));
|
using strategy_t = decltype(strategies.envelope(geometry, mbr));
|
||||||
|
|
||||||
typename strategy_t::template state<Box> state;
|
typename strategy_t::template state<Box> state;
|
||||||
detail::visit_breadth_first([&](auto const& g)
|
detail::visit_breadth_first([&](auto const& g)
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <boost/geometry/algorithms/detail/normalize.hpp>
|
#include <boost/geometry/algorithms/detail/normalize.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace boost { namespace geometry
|
namespace boost { namespace geometry
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace detail { namespace envelope
|
namespace detail { namespace envelope
|
||||||
@ -38,7 +38,7 @@ struct intersects_antimeridian
|
|||||||
<
|
<
|
||||||
CoordinateType, Units
|
CoordinateType, Units
|
||||||
> constants;
|
> constants;
|
||||||
|
|
||||||
return
|
return
|
||||||
math::equals(math::abs(lat1), constants::max_latitude())
|
math::equals(math::abs(lat1), constants::max_latitude())
|
||||||
||
|
||
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
longitude_interval(T const& left, T const& right)
|
longitude_interval(T const& left, T const& right)
|
||||||
{
|
{
|
||||||
m_end[0] = left;
|
m_end[0] = left;
|
||||||
m_end[1] = right;
|
m_end[1] = right;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::size_t Index>
|
template <std::size_t Index>
|
||||||
@ -287,7 +287,7 @@ struct envelope_range_of_boxes
|
|||||||
// if the box degenerates to the south or north pole
|
// if the box degenerates to the south or north pole
|
||||||
// just ignore it
|
// just ignore it
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
coordinate_type lon_left = geometry::get<min_corner, 0>(*it);
|
coordinate_type lon_left = geometry::get<min_corner, 0>(*it);
|
||||||
coordinate_type lon_right = geometry::get<max_corner, 0>(*it);
|
coordinate_type lon_right = geometry::get<max_corner, 0>(*it);
|
||||||
|
@ -389,7 +389,7 @@ struct equals
|
|||||||
<
|
<
|
||||||
MultiPolygon1, MultiPolygon2,
|
MultiPolygon1, MultiPolygon2,
|
||||||
multi_polygon_tag, multi_polygon_tag,
|
multi_polygon_tag, multi_polygon_tag,
|
||||||
areal_tag, areal_tag,
|
areal_tag, areal_tag,
|
||||||
2,
|
2,
|
||||||
Reverse
|
Reverse
|
||||||
>
|
>
|
||||||
@ -402,7 +402,7 @@ struct equals
|
|||||||
<
|
<
|
||||||
Polygon, MultiPolygon,
|
Polygon, MultiPolygon,
|
||||||
polygon_tag, multi_polygon_tag,
|
polygon_tag, multi_polygon_tag,
|
||||||
areal_tag, areal_tag,
|
areal_tag, areal_tag,
|
||||||
2,
|
2,
|
||||||
Reverse
|
Reverse
|
||||||
>
|
>
|
||||||
@ -414,7 +414,7 @@ struct equals
|
|||||||
<
|
<
|
||||||
MultiPolygon, Ring,
|
MultiPolygon, Ring,
|
||||||
multi_polygon_tag, ring_tag,
|
multi_polygon_tag, ring_tag,
|
||||||
areal_tag, areal_tag,
|
areal_tag, areal_tag,
|
||||||
2,
|
2,
|
||||||
Reverse
|
Reverse
|
||||||
>
|
>
|
||||||
|
@ -61,7 +61,7 @@ struct indexed_loop
|
|||||||
|
|
||||||
std::less<coordinate_type> less;
|
std::less<coordinate_type> less;
|
||||||
std::greater<coordinate_type> greater;
|
std::greater<coordinate_type> greater;
|
||||||
|
|
||||||
if (less(coord, get<min_corner, Dimension>(box)))
|
if (less(coord, get<min_corner, Dimension>(box)))
|
||||||
{
|
{
|
||||||
set<min_corner, Dimension>(box, coord);
|
set<min_corner, Dimension>(box, coord);
|
||||||
|
@ -100,7 +100,7 @@ struct expand<default_strategy, false>
|
|||||||
|
|
||||||
namespace resolve_dynamic
|
namespace resolve_dynamic
|
||||||
{
|
{
|
||||||
|
|
||||||
template <typename Geometry, typename Tag = typename tag<Geometry>::type>
|
template <typename Geometry, typename Tag = typename tag<Geometry>::type>
|
||||||
struct expand
|
struct expand
|
||||||
{
|
{
|
||||||
@ -112,7 +112,7 @@ struct expand
|
|||||||
concepts::check<Box>();
|
concepts::check<Box>();
|
||||||
concepts::check<Geometry const>();
|
concepts::check<Geometry const>();
|
||||||
concepts::check_concepts_and_equal_dimensions<Box, Geometry const>();
|
concepts::check_concepts_and_equal_dimensions<Box, Geometry const>();
|
||||||
|
|
||||||
resolve_strategy::expand<Strategy>::apply(box, geometry, strategy);
|
resolve_strategy::expand<Strategy>::apply(box, geometry, strategy);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -131,10 +131,10 @@ struct expand<Geometry, dynamic_geometry_tag>
|
|||||||
}, geometry);
|
}, geometry);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace resolve_dynamic
|
} // namespace resolve_dynamic
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Expands (with strategy)
|
\brief Expands (with strategy)
|
||||||
\ingroup expand
|
\ingroup expand
|
||||||
|
@ -44,7 +44,7 @@ struct corner_by_epsilon
|
|||||||
typedef typename coordinate_type<Point>::type coord_type;
|
typedef typename coordinate_type<Point>::type coord_type;
|
||||||
coord_type const coord = get<I>(point);
|
coord_type const coord = get<I>(point);
|
||||||
coord_type const seps = math::scaled_epsilon(coord);
|
coord_type const seps = math::scaled_epsilon(coord);
|
||||||
|
|
||||||
set<I>(point, PlusOrMinus<coord_type>()(coord, seps));
|
set<I>(point, PlusOrMinus<coord_type>()(coord, seps));
|
||||||
|
|
||||||
corner_by_epsilon<Point, PlusOrMinus, I+1>::apply(point);
|
corner_by_epsilon<Point, PlusOrMinus, I+1>::apply(point);
|
||||||
|
@ -131,7 +131,7 @@ inline void gc_group_elements(GC1View const& gc1_view, GC2View const& gc2_view,
|
|||||||
std::array<std::vector<bool>, 2> visited = {
|
std::array<std::vector<bool>, 2> visited = {
|
||||||
std::vector<bool>(boost::size(gc1_view), false),
|
std::vector<bool>(boost::size(gc1_view), false),
|
||||||
std::vector<bool>(boost::size(gc2_view), false)
|
std::vector<bool>(boost::size(gc2_view), false)
|
||||||
};
|
};
|
||||||
for (auto const& elem : adjacent)
|
for (auto const& elem : adjacent)
|
||||||
{
|
{
|
||||||
std::vector<gc_element_id> group;
|
std::vector<gc_element_id> group;
|
||||||
|
@ -31,7 +31,7 @@ struct interior_iterator
|
|||||||
{
|
{
|
||||||
typedef typename boost::range_iterator
|
typedef typename boost::range_iterator
|
||||||
<
|
<
|
||||||
typename geometry::interior_type<Geometry>::type
|
typename geometry::interior_type<Geometry>::type
|
||||||
>::type type;
|
>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ struct intersection_areal_areal_<TupledOut, tupled_output_tag>
|
|||||||
pointlike::get(geometry_out),
|
pointlike::get(geometry_out),
|
||||||
strategy);
|
strategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ private:
|
|||||||
traits::iter_visit<Geometry2>::apply([&](auto const& g2)
|
traits::iter_visit<Geometry2>::apply([&](auto const& g2)
|
||||||
{
|
{
|
||||||
TupleOut inters_result;
|
TupleOut inters_result;
|
||||||
using g2_t = util::remove_cref_t<decltype(g2)>;
|
using g2_t = util::remove_cref_t<decltype(g2)>;
|
||||||
intersection<G1, g2_t, TupleOut>::apply(g1, g2, inters_result, strategy);
|
intersection<G1, g2_t, TupleOut>::apply(g1, g2, inters_result, strategy);
|
||||||
|
|
||||||
// TODO: If possible merge based on adjacency lists, i.e. merge
|
// TODO: If possible merge based on adjacency lists, i.e. merge
|
||||||
@ -218,7 +218,7 @@ private:
|
|||||||
<
|
<
|
||||||
Out, Out, typename Strategy::cs_tag
|
Out, Out, typename Strategy::cs_tag
|
||||||
>::type;
|
>::type;
|
||||||
|
|
||||||
rescale_policy_type robust_policy
|
rescale_policy_type robust_policy
|
||||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||||
g1, g2, strategy);
|
g1, g2, strategy);
|
||||||
|
@ -127,7 +127,7 @@ struct intersection
|
|||||||
Geometry2,
|
Geometry2,
|
||||||
typename Strategy::cs_tag
|
typename Strategy::cs_tag
|
||||||
>::type rescale_policy_type;
|
>::type rescale_policy_type;
|
||||||
|
|
||||||
rescale_policy_type robust_policy
|
rescale_policy_type robust_policy
|
||||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||||
geometry1, geometry2, strategy);
|
geometry1, geometry2, strategy);
|
||||||
@ -225,7 +225,7 @@ struct intersection<default_strategy, false>
|
|||||||
|
|
||||||
namespace resolve_dynamic
|
namespace resolve_dynamic
|
||||||
{
|
{
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Geometry1, typename Geometry2,
|
typename Geometry1, typename Geometry2,
|
||||||
@ -240,7 +240,7 @@ struct intersection
|
|||||||
{
|
{
|
||||||
concepts::check<Geometry1 const>();
|
concepts::check<Geometry1 const>();
|
||||||
concepts::check<Geometry2 const>();
|
concepts::check<Geometry2 const>();
|
||||||
|
|
||||||
return resolve_strategy::intersection
|
return resolve_strategy::intersection
|
||||||
<
|
<
|
||||||
Strategy
|
Strategy
|
||||||
@ -283,7 +283,7 @@ struct intersection<Geometry1, DynamicGeometry2, Tag1, dynamic_geometry_tag>
|
|||||||
result = intersection
|
result = intersection
|
||||||
<
|
<
|
||||||
Geometry1,
|
Geometry1,
|
||||||
util::remove_cref_t<decltype(g2)>
|
util::remove_cref_t<decltype(g2)>
|
||||||
>::apply(geometry1, g2, geometry_out, strategy);
|
>::apply(geometry1, g2, geometry_out, strategy);
|
||||||
}, geometry2);
|
}, geometry2);
|
||||||
return result;
|
return result;
|
||||||
@ -310,9 +310,9 @@ struct intersection<DynamicGeometry1, DynamicGeometry2, dynamic_geometry_tag, dy
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace resolve_dynamic
|
} // namespace resolve_dynamic
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief \brief_calc2{intersection}
|
\brief \brief_calc2{intersection}
|
||||||
|
@ -158,7 +158,7 @@ public:
|
|||||||
inline bool apply(Turn const& turn) const
|
inline bool apply(Turn const& turn) const
|
||||||
{
|
{
|
||||||
typedef typename boost::range_value<MultiLinestring>::type linestring_type;
|
typedef typename boost::range_value<MultiLinestring>::type linestring_type;
|
||||||
|
|
||||||
linestring_type const& ls1 =
|
linestring_type const& ls1 =
|
||||||
range::at(m_multilinestring, turn.operations[0].seg_id.multi_index);
|
range::at(m_multilinestring, turn.operations[0].seg_id.multi_index);
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ public:
|
|||||||
// return true for empty multilinestring
|
// return true for empty multilinestring
|
||||||
|
|
||||||
using not_simple = not_simple<Strategy>; // do not compute self-intersections
|
using not_simple = not_simple<Strategy>; // do not compute self-intersections
|
||||||
|
|
||||||
if (std::any_of(boost::begin(multilinestring),
|
if (std::any_of(boost::begin(multilinestring),
|
||||||
boost::end(multilinestring),
|
boost::end(multilinestring),
|
||||||
not_simple(strategy)))
|
not_simple(strategy)))
|
||||||
|
@ -39,7 +39,7 @@ debug_print_complement_graph(OutputStream& os,
|
|||||||
{
|
{
|
||||||
os << " " << it->id();
|
os << " " << it->id();
|
||||||
}
|
}
|
||||||
os << " }" << std::endl;
|
os << " }" << std::endl;
|
||||||
|
|
||||||
for (vertex_handle it = graph.m_vertices.begin();
|
for (vertex_handle it = graph.m_vertices.begin();
|
||||||
it != graph.m_vertices.end(); ++it)
|
it != graph.m_vertices.end(); ++it)
|
||||||
@ -54,7 +54,7 @@ debug_print_complement_graph(OutputStream& os,
|
|||||||
{
|
{
|
||||||
os << " " << (*nit)->id();
|
os << " " << (*nit)->id();
|
||||||
}
|
}
|
||||||
os << "}" << std::endl;
|
os << "}" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
namespace boost { namespace geometry
|
namespace boost { namespace geometry
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifndef DOXYGEN_NO_DETAIL
|
#ifndef DOXYGEN_NO_DETAIL
|
||||||
namespace detail { namespace is_valid
|
namespace detail { namespace is_valid
|
||||||
{
|
{
|
||||||
@ -89,8 +89,8 @@ struct range_has_invalid_coordinate
|
|||||||
bool const has_valid_coordinates = std::none_of
|
bool const has_valid_coordinates = std::none_of
|
||||||
(
|
(
|
||||||
geometry::points_begin(geometry), points_end,
|
geometry::points_begin(geometry), points_end,
|
||||||
[]( auto const& point ){
|
[]( auto const& point ){
|
||||||
return point_has_invalid_coordinate::apply(point);
|
return point_has_invalid_coordinate::apply(point);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
namespace boost { namespace geometry
|
namespace boost { namespace geometry
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace resolve_strategy
|
namespace resolve_strategy
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ public:
|
|||||||
|| turn.method == method_touch_interior)
|
|| turn.method == method_touch_interior)
|
||||||
&& turn.touch_only;
|
&& turn.touch_only;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}} // namespace detail::is_valid
|
}} // namespace detail::is_valid
|
||||||
|
@ -105,7 +105,7 @@ namespace dispatch
|
|||||||
// A curve is simple if it does not pass through the same point twice,
|
// A curve is simple if it does not pass through the same point twice,
|
||||||
// with the possible exception of its two endpoints
|
// with the possible exception of its two endpoints
|
||||||
//
|
//
|
||||||
// There is an option here as to whether spikes are allowed for linestrings;
|
// There is an option here as to whether spikes are allowed for linestrings;
|
||||||
// here we pass this as an additional template parameter: allow_spikes
|
// here we pass this as an additional template parameter: allow_spikes
|
||||||
// If allow_spikes is set to true, spikes are allowed, false otherwise.
|
// If allow_spikes is set to true, spikes are allowed, false otherwise.
|
||||||
// By default, spikes are disallowed
|
// By default, spikes are disallowed
|
||||||
@ -166,7 +166,7 @@ public:
|
|||||||
|
|
||||||
using per_ls = per_linestring<VisitPolicy, Strategy>;
|
using per_ls = per_linestring<VisitPolicy, Strategy>;
|
||||||
|
|
||||||
return std::all_of(boost::begin(multilinestring),
|
return std::all_of(boost::begin(multilinestring),
|
||||||
boost::end(multilinestring),
|
boost::end(multilinestring),
|
||||||
per_ls(visitor, strategy));
|
per_ls(visitor, strategy));
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,7 @@ public:
|
|||||||
|
|
||||||
using has_valid_turns = has_valid_self_turns
|
using has_valid_turns = has_valid_self_turns
|
||||||
<
|
<
|
||||||
MultiPolygon,
|
MultiPolygon,
|
||||||
typename Strategy::cs_tag
|
typename Strategy::cs_tag
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ protected:
|
|||||||
VisitPolicy& visitor,
|
VisitPolicy& visitor,
|
||||||
Strategy const& strategy)
|
Strategy const& strategy)
|
||||||
{
|
{
|
||||||
return std::none_of(boost::begin(interior_rings),
|
return std::none_of(boost::begin(interior_rings),
|
||||||
boost::end(interior_rings),
|
boost::end(interior_rings),
|
||||||
is_invalid_ring<VisitPolicy, Strategy>(visitor, strategy));
|
is_invalid_ring<VisitPolicy, Strategy>(visitor, strategy));
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct has_holes_inside
|
struct has_holes_inside
|
||||||
{
|
{
|
||||||
template <typename TurnIterator, typename VisitPolicy, typename Strategy>
|
template <typename TurnIterator, typename VisitPolicy, typename Strategy>
|
||||||
static inline bool apply(Polygon const& polygon,
|
static inline bool apply(Polygon const& polygon,
|
||||||
TurnIterator first,
|
TurnIterator first,
|
||||||
|
@ -225,7 +225,7 @@ maximum_gap(RangeOfIntervals const& range_of_intervals,
|
|||||||
std::priority_queue
|
std::priority_queue
|
||||||
<
|
<
|
||||||
event_type,
|
event_type,
|
||||||
std::vector<event_type>,
|
std::vector<event_type>,
|
||||||
detail::max_interval_gap::event_greater<event_type>
|
detail::max_interval_gap::event_greater<event_type>
|
||||||
> queue;
|
> queue;
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ struct overlaps
|
|||||||
>::apply(geometry1, geometry2, strategy);
|
>::apply(geometry1, geometry2, strategy);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename DynamicGeometry1, typename Geometry2, typename Tag2>
|
template <typename DynamicGeometry1, typename Geometry2, typename Tag2>
|
||||||
struct overlaps<DynamicGeometry1, Geometry2, dynamic_geometry_tag, Tag2>
|
struct overlaps<DynamicGeometry1, Geometry2, dynamic_geometry_tag, Tag2>
|
||||||
@ -211,7 +211,7 @@ struct overlaps<DynamicGeometry1, DynamicGeometry2, dynamic_geometry_tag, dynami
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace resolve_dynamic
|
} // namespace resolve_dynamic
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ static inline bool is_entering(Turn const& turn,
|
|||||||
|
|
||||||
template <typename Turn, typename Operation>
|
template <typename Turn, typename Operation>
|
||||||
static inline bool is_staying_inside(Turn const& turn,
|
static inline bool is_staying_inside(Turn const& turn,
|
||||||
Operation const& operation,
|
Operation const& operation,
|
||||||
bool entered)
|
bool entered)
|
||||||
{
|
{
|
||||||
if ( !entered )
|
if ( !entered )
|
||||||
@ -327,7 +327,7 @@ public:
|
|||||||
for (TurnIterator it = first; it != beyond; ++it)
|
for (TurnIterator it = first; it != beyond; ++it)
|
||||||
{
|
{
|
||||||
oit = process_turn(it, boost::begin(it->operations),
|
oit = process_turn(it, boost::begin(it->operations),
|
||||||
entered, enter_count,
|
entered, enter_count,
|
||||||
linestring,
|
linestring,
|
||||||
current_piece, current_segment_id,
|
current_piece, current_segment_id,
|
||||||
oit,
|
oit,
|
||||||
|
@ -201,7 +201,7 @@ public:
|
|||||||
BOOST_STATIC_ASSERT(I < 2);
|
BOOST_STATIC_ASSERT(I < 2);
|
||||||
return ips[I];
|
return ips[I];
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// only if collinear (same_dirs)
|
// only if collinear (same_dirs)
|
||||||
@ -287,7 +287,7 @@ struct get_turn_info_for_endpoint
|
|||||||
|
|
||||||
if ( intersections.template get<1>().p_operation == operation_none )
|
if ( intersections.template get<1>().p_operation == operation_none )
|
||||||
return result_ignore_ip0;
|
return result_ignore_ip0;
|
||||||
|
|
||||||
bool append1_last
|
bool append1_last
|
||||||
= analyse_segment_and_assign_ip(range_p, range_q,
|
= analyse_segment_and_assign_ip(range_p, range_q,
|
||||||
intersections.template get<1>(),
|
intersections.template get<1>(),
|
||||||
@ -436,7 +436,7 @@ struct get_turn_info_for_endpoint
|
|||||||
|
|
||||||
if ( operations_both(operations, operation_continue) )
|
if ( operations_both(operations, operation_continue) )
|
||||||
{
|
{
|
||||||
if ( op1 != operation_union
|
if ( op1 != operation_union
|
||||||
|| op2 != operation_union
|
|| op2 != operation_union
|
||||||
|| ! ( G1Index == 0 ? inters.is_spike_q() : inters.is_spike_p() ) )
|
|| ! ( G1Index == 0 ? inters.is_spike_q() : inters.is_spike_p() ) )
|
||||||
{
|
{
|
||||||
@ -544,7 +544,7 @@ struct get_turn_info_for_endpoint
|
|||||||
OutputIterator out)
|
OutputIterator out)
|
||||||
{
|
{
|
||||||
TurnInfo tp = tp_model;
|
TurnInfo tp = tp_model;
|
||||||
|
|
||||||
//geometry::convert(ip, tp.point);
|
//geometry::convert(ip, tp.point);
|
||||||
//tp.method = method;
|
//tp.method = method;
|
||||||
base_turn_handler::assign_point(tp, method, result.intersection_points, ip_index);
|
base_turn_handler::assign_point(tp, method, result.intersection_points, ip_index);
|
||||||
|
@ -345,7 +345,7 @@ public:
|
|||||||
<
|
<
|
||||||
UniqueSubRange2, UniqueSubRange1, UmbrellaStrategy
|
UniqueSubRange2, UniqueSubRange1, UmbrellaStrategy
|
||||||
> swapped_side_calculator_type;
|
> swapped_side_calculator_type;
|
||||||
|
|
||||||
intersection_info_base(UniqueSubRange1 const& range_p,
|
intersection_info_base(UniqueSubRange1 const& range_p,
|
||||||
UniqueSubRange2 const& range_q,
|
UniqueSubRange2 const& range_q,
|
||||||
UmbrellaStrategy const& umbrella_strategy,
|
UmbrellaStrategy const& umbrella_strategy,
|
||||||
@ -409,7 +409,7 @@ public:
|
|||||||
|
|
||||||
typedef typename base::side_calculator_type side_calculator_type;
|
typedef typename base::side_calculator_type side_calculator_type;
|
||||||
typedef typename base::result_type result_type;
|
typedef typename base::result_type result_type;
|
||||||
|
|
||||||
typedef typename result_type::intersection_points_type i_info_type;
|
typedef typename result_type::intersection_points_type i_info_type;
|
||||||
typedef typename result_type::direction_type d_info_type;
|
typedef typename result_type::direction_type d_info_type;
|
||||||
|
|
||||||
@ -462,7 +462,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,18 +485,18 @@ public:
|
|||||||
bool const has_pk = ! base::p_is_last_segment();
|
bool const has_pk = ! base::p_is_last_segment();
|
||||||
int const pk_q1 = has_pk ? base::sides().pk_wrt_q1() : 0;
|
int const pk_q1 = has_pk ? base::sides().pk_wrt_q1() : 0;
|
||||||
int const pk_q2 = has_pk ? base::sides().pk_wrt_q2() : 0;
|
int const pk_q2 = has_pk ? base::sides().pk_wrt_q2() : 0;
|
||||||
|
|
||||||
if (pk_q1 == -pk_q2)
|
if (pk_q1 == -pk_q2)
|
||||||
{
|
{
|
||||||
if (pk_q1 == 0)
|
if (pk_q1 == 0)
|
||||||
{
|
{
|
||||||
return direction_code<cs_tag>(base::rqi(), base::rqj(), base::rqk()) == -1;
|
return direction_code<cs_tag>(base::rqi(), base::rqj(), base::rqk()) == -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,12 +120,12 @@ struct get_turn_info_linear_areal
|
|||||||
replace_method_and_operations_tm(tp.method,
|
replace_method_and_operations_tm(tp.method,
|
||||||
tp.operations[0].operation,
|
tp.operations[0].operation,
|
||||||
tp.operations[1].operation);
|
tp.operations[1].operation);
|
||||||
|
|
||||||
// this function assumes that 'u' must be set for a spike
|
// this function assumes that 'u' must be set for a spike
|
||||||
calculate_spike_operation(tp.operations[0].operation,
|
calculate_spike_operation(tp.operations[0].operation,
|
||||||
inters,
|
inters,
|
||||||
umbrella_strategy);
|
umbrella_strategy);
|
||||||
|
|
||||||
*out++ = tp;
|
*out++ = tp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ struct get_turn_info_linear_areal
|
|||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
using handler = touch<TurnInfo, verify_policy_la>;
|
using handler = touch<TurnInfo, verify_policy_la>;
|
||||||
handler::apply(range_p, range_q, tp,
|
handler::apply(range_p, range_q, tp,
|
||||||
@ -178,7 +178,7 @@ struct get_turn_info_linear_areal
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tp.operations[0].operation = operation_union;
|
tp.operations[0].operation = operation_union;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -407,7 +407,7 @@ struct get_turn_info_linear_areal
|
|||||||
if ( is_p_spike )
|
if ( is_p_spike )
|
||||||
{
|
{
|
||||||
int const pk_q1 = inters.sides().pk_wrt_q1();
|
int const pk_q1 = inters.sides().pk_wrt_q1();
|
||||||
|
|
||||||
bool going_in = pk_q1 < 0; // Pk on the right
|
bool going_in = pk_q1 < 0; // Pk on the right
|
||||||
bool going_out = pk_q1 > 0; // Pk on the left
|
bool going_out = pk_q1 > 0; // Pk on the left
|
||||||
|
|
||||||
@ -415,7 +415,7 @@ struct get_turn_info_linear_areal
|
|||||||
|
|
||||||
// special cases
|
// special cases
|
||||||
if ( qk_q1 < 0 ) // Q turning R
|
if ( qk_q1 < 0 ) // Q turning R
|
||||||
{
|
{
|
||||||
// spike on the edge point
|
// spike on the edge point
|
||||||
// if it's already known that the spike is going out this musn't be checked
|
// if it's already known that the spike is going out this musn't be checked
|
||||||
if ( ! going_out
|
if ( ! going_out
|
||||||
@ -528,7 +528,7 @@ struct get_turn_info_linear_areal
|
|||||||
|| tp.operations[0].operation == operation_intersection ) : // i ???
|
|| tp.operations[0].operation == operation_intersection ) : // i ???
|
||||||
true )
|
true )
|
||||||
&& inters.is_spike_p();
|
&& inters.is_spike_p();
|
||||||
|
|
||||||
// TODO: throw an exception for spike in Areal?
|
// TODO: throw an exception for spike in Areal?
|
||||||
/*bool is_q_spike = ( ( Version == append_touches
|
/*bool is_q_spike = ( ( Version == append_touches
|
||||||
&& tp.operations[1].operation == operation_continue )
|
&& tp.operations[1].operation == operation_continue )
|
||||||
@ -675,7 +675,7 @@ struct get_turn_info_linear_areal
|
|||||||
// possible to define a spike on an endpoint. Areal geometries must
|
// possible to define a spike on an endpoint. Areal geometries must
|
||||||
// NOT have spikes at all. One thing that could be done is to throw
|
// NOT have spikes at all. One thing that could be done is to throw
|
||||||
// an exception when spike is detected in Areal geometry.
|
// an exception when spike is detected in Areal geometry.
|
||||||
|
|
||||||
template <bool EnableFirst,
|
template <bool EnableFirst,
|
||||||
bool EnableLast,
|
bool EnableLast,
|
||||||
typename UniqueSubRange1,
|
typename UniqueSubRange1,
|
||||||
@ -801,7 +801,7 @@ struct get_turn_info_linear_areal
|
|||||||
&& ( ip_count > 1 ? (ip1.is_pj && !ip1.is_qi) : (ip0.is_pj && !ip0.is_qi) ) ) // prevents duplication
|
&& ( ip_count > 1 ? (ip1.is_pj && !ip1.is_qi) : (ip0.is_pj && !ip0.is_qi) ) ) // prevents duplication
|
||||||
{
|
{
|
||||||
TurnInfo tp = tp_model;
|
TurnInfo tp = tp_model;
|
||||||
|
|
||||||
if ( inters.i_info().count > 1 )
|
if ( inters.i_info().count > 1 )
|
||||||
{
|
{
|
||||||
//BOOST_GEOMETRY_ASSERT( result.template get<1>().dir_a == 0 && result.template get<1>().dir_b == 0 );
|
//BOOST_GEOMETRY_ASSERT( result.template get<1>().dir_a == 0 && result.template get<1>().dir_b == 0 );
|
||||||
@ -827,7 +827,7 @@ struct get_turn_info_linear_areal
|
|||||||
{
|
{
|
||||||
side_pi_y = sides.apply(range_q.at(1), range_q.at(2), range_p.at(0)); // pi wrt q2
|
side_pi_y = sides.apply(range_q.at(1), range_q.at(2), range_p.at(0)); // pi wrt q2
|
||||||
side_pi_x = sides.apply(range_q.at(0), range_q.at(1), range_p.at(0)); // pi wrt q1
|
side_pi_x = sides.apply(range_q.at(0), range_q.at(1), range_p.at(0)); // pi wrt q1
|
||||||
side_qz_x = sides.apply(range_q.at(0), range_q.at(1), range_q.at(2)); // qk wrt q1
|
side_qz_x = sides.apply(range_q.at(0), range_q.at(1), range_q.at(2)); // qk wrt q1
|
||||||
}
|
}
|
||||||
// 2. ip0 or pj in the middle of q1
|
// 2. ip0 or pj in the middle of q1
|
||||||
else
|
else
|
||||||
@ -853,7 +853,7 @@ struct get_turn_info_linear_areal
|
|||||||
tp.operations[0].operation = operation_blocked;
|
tp.operations[0].operation = operation_blocked;
|
||||||
tp.operations[0].position = position_back;
|
tp.operations[0].position = position_back;
|
||||||
tp.operations[1].position = position_middle;
|
tp.operations[1].position = position_middle;
|
||||||
|
|
||||||
// equals<> or collinear<> will assign the second point,
|
// equals<> or collinear<> will assign the second point,
|
||||||
// we'd like to assign the first one
|
// we'd like to assign the first one
|
||||||
unsigned int ip_index = ip_count > 1 ? 1 : 0;
|
unsigned int ip_index = ip_count > 1 ? 1 : 0;
|
||||||
|
@ -110,7 +110,7 @@ struct get_turn_info_linear_linear
|
|||||||
inters.swapped_sides(),
|
inters.swapped_sides(),
|
||||||
umbrella_strategy);
|
umbrella_strategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( tp.operations[0].operation == operation_blocked )
|
if ( tp.operations[0].operation == operation_blocked )
|
||||||
{
|
{
|
||||||
tp.operations[1].is_collinear = true;
|
tp.operations[1].is_collinear = true;
|
||||||
@ -123,7 +123,7 @@ struct get_turn_info_linear_linear
|
|||||||
replace_method_and_operations_tm(tp.method,
|
replace_method_and_operations_tm(tp.method,
|
||||||
tp.operations[0].operation,
|
tp.operations[0].operation,
|
||||||
tp.operations[1].operation);
|
tp.operations[1].operation);
|
||||||
|
|
||||||
*out++ = tp;
|
*out++ = tp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ struct get_turn_info_linear_linear
|
|||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler::apply(range_p, range_q, tp,
|
handler::apply(range_p, range_q, tp,
|
||||||
inters.i_info(), inters.d_info(),
|
inters.i_info(), inters.d_info(),
|
||||||
@ -169,7 +169,7 @@ struct get_turn_info_linear_linear
|
|||||||
if ( inters.is_spike_p() && inters.is_spike_q() )
|
if ( inters.is_spike_p() && inters.is_spike_q() )
|
||||||
{
|
{
|
||||||
tp.operations[0].operation = operation_union;
|
tp.operations[0].operation = operation_union;
|
||||||
tp.operations[1].operation = operation_union;
|
tp.operations[1].operation = operation_union;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -188,7 +188,7 @@ struct get_turn_info_linear_linear
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tp.operations[0].operation = operation_union;
|
tp.operations[0].operation = operation_union;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -207,7 +207,7 @@ struct get_turn_info_linear_linear
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tp.operations[1].operation = operation_union;
|
tp.operations[1].operation = operation_union;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -223,7 +223,7 @@ struct get_turn_info_linear_linear
|
|||||||
&& inters.is_spike_p() )
|
&& inters.is_spike_p() )
|
||||||
{
|
{
|
||||||
tp.operations[0].operation = operation_union;
|
tp.operations[0].operation = operation_union;
|
||||||
tp.operations[1].operation = operation_union;
|
tp.operations[1].operation = operation_union;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( tp.operations[0].operation == operation_none
|
else if ( tp.operations[0].operation == operation_none
|
||||||
@ -379,7 +379,7 @@ struct get_turn_info_linear_linear
|
|||||||
// transform turn
|
// transform turn
|
||||||
turn_transformer_ec transformer(method_replace);
|
turn_transformer_ec transformer(method_replace);
|
||||||
transformer(tp);
|
transformer(tp);
|
||||||
|
|
||||||
// conditionally handle spikes
|
// conditionally handle spikes
|
||||||
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
||||||
|| ! append_collinear_spikes(tp, inters,
|
|| ! append_collinear_spikes(tp, inters,
|
||||||
@ -524,7 +524,7 @@ struct get_turn_info_linear_linear
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -567,9 +567,9 @@ struct get_turn_info_linear_linear
|
|||||||
{
|
{
|
||||||
tp.operations[0].is_collinear = true;
|
tp.operations[0].is_collinear = true;
|
||||||
tp.operations[1].is_collinear = false;
|
tp.operations[1].is_collinear = false;
|
||||||
|
|
||||||
BOOST_GEOMETRY_ASSERT(inters.i_info().count > 1);
|
BOOST_GEOMETRY_ASSERT(inters.i_info().count > 1);
|
||||||
|
|
||||||
base_turn_handler::assign_point(tp, method_touch_interior,
|
base_turn_handler::assign_point(tp, method_touch_interior,
|
||||||
inters.i_info(), 1);
|
inters.i_info(), 1);
|
||||||
}
|
}
|
||||||
@ -598,7 +598,7 @@ struct get_turn_info_linear_linear
|
|||||||
{
|
{
|
||||||
tp.operations[0].is_collinear = false;
|
tp.operations[0].is_collinear = false;
|
||||||
tp.operations[1].is_collinear = true;
|
tp.operations[1].is_collinear = true;
|
||||||
|
|
||||||
BOOST_GEOMETRY_ASSERT(inters.i_info().count > 0);
|
BOOST_GEOMETRY_ASSERT(inters.i_info().count > 0);
|
||||||
|
|
||||||
base_turn_handler::assign_point(tp, method_touch_interior, inters.i_info(), 0);
|
base_turn_handler::assign_point(tp, method_touch_interior, inters.i_info(), 0);
|
||||||
@ -613,7 +613,7 @@ struct get_turn_info_linear_linear
|
|||||||
|
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ struct intersection_box_box
|
|||||||
// Set dimensions of output coordinate
|
// Set dimensions of output coordinate
|
||||||
set<min_corner, Dimension>(box_out, min1 < min2 ? min2 : min1);
|
set<min_corner, Dimension>(box_out, min1 < min2 ? min2 : min1);
|
||||||
set<max_corner, Dimension>(box_out, max1 > max2 ? max2 : max1);
|
set<max_corner, Dimension>(box_out, max1 > max2 ? max2 : max1);
|
||||||
|
|
||||||
return intersection_box_box<Dimension + 1, DimensionCount>
|
return intersection_box_box<Dimension + 1, DimensionCount>
|
||||||
::apply(box1, box2, robust_policy, box_out, strategy);
|
::apply(box1, box2, robust_policy, box_out, strategy);
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ struct intersection_of_linestring_with_areal
|
|||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BOOST_GEOMETRY_DEBUG_FOLLOW)
|
#if defined(BOOST_GEOMETRY_DEBUG_FOLLOW)
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for(typename std::deque<turn_info>::const_iterator
|
for(typename std::deque<turn_info>::const_iterator
|
||||||
@ -1543,7 +1543,7 @@ inline OutputIterator intersection_insert(Geometry1 const& geometry1,
|
|||||||
<
|
<
|
||||||
Geometry1, Geometry2
|
Geometry1, Geometry2
|
||||||
>::type strategy_type;
|
>::type strategy_type;
|
||||||
|
|
||||||
return intersection_insert<GeometryOut>(geometry1, geometry2, out,
|
return intersection_insert<GeometryOut>(geometry1, geometry2, out,
|
||||||
strategy_type());
|
strategy_type());
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MultiPolygon const& m_multipolygon;
|
MultiPolygon const& m_multipolygon;
|
||||||
OutputIterator& m_oit;
|
OutputIterator& m_oit;
|
||||||
Strategy const& m_strategy;
|
Strategy const& m_strategy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ inline int range_in_geometry(Point1 const& first_point1,
|
|||||||
// check points of geometry1 until point inside/outside is found
|
// check points of geometry1 until point inside/outside is found
|
||||||
// NOTE: skip first point because it should be already tested above
|
// NOTE: skip first point because it should be already tested above
|
||||||
result = range_in_geometry(geometry1, geometry2, strategy, true);
|
result = range_in_geometry(geometry1, geometry2, strategy, true);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ inline void select_rings(Geometry1 const& geometry1, Geometry2 const& geometry2,
|
|||||||
{
|
{
|
||||||
typedef typename geometry::tag<Geometry1>::type tag1;
|
typedef typename geometry::tag<Geometry1>::type tag1;
|
||||||
typedef typename geometry::tag<Geometry2>::type tag2;
|
typedef typename geometry::tag<Geometry2>::type tag2;
|
||||||
|
|
||||||
RingPropertyMap all_ring_properties;
|
RingPropertyMap all_ring_properties;
|
||||||
dispatch::select_rings<tag1, Geometry1>::apply(geometry1, geometry2,
|
dispatch::select_rings<tag1, Geometry1>::apply(geometry1, geometry2,
|
||||||
ring_identifier(0, -1, -1), all_ring_properties,
|
ring_identifier(0, -1, -1), all_ring_properties,
|
||||||
|
@ -356,7 +356,7 @@ struct self_get_turn_points<Reverse, AssignPolicy, Strategy, false>
|
|||||||
namespace detail { namespace self_get_turn_points
|
namespace detail { namespace self_get_turn_points
|
||||||
{
|
{
|
||||||
|
|
||||||
// Version where Reverse can be specified manually. TODO:
|
// Version where Reverse can be specified manually. TODO:
|
||||||
// can most probably be merged with self_get_turn_points::get_turn
|
// can most probably be merged with self_get_turn_points::get_turn
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
namespace boost { namespace geometry
|
namespace boost { namespace geometry
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace de9im
|
namespace de9im
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ public:
|
|||||||
inline explicit mask(const char* code)
|
inline explicit mask(const char* code)
|
||||||
: base_type(code)
|
: base_type(code)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief The constructor.
|
\brief The constructor.
|
||||||
\param code The mask pattern.
|
\param code The mask pattern.
|
||||||
|
@ -208,7 +208,7 @@ struct gc_gc
|
|||||||
{
|
{
|
||||||
tuple1_t tuple1;
|
tuple1_t tuple1;
|
||||||
tuple2_t tuple2;
|
tuple2_t tuple2;
|
||||||
|
|
||||||
// Create MPts, MLss and MPos containing all gc elements from this group
|
// Create MPts, MLss and MPos containing all gc elements from this group
|
||||||
// They may potentially intersect each other
|
// They may potentially intersect each other
|
||||||
for (auto const& id : inters_group)
|
for (auto const& id : inters_group)
|
||||||
@ -269,7 +269,7 @@ struct gc_gc
|
|||||||
|
|
||||||
// If needed divide MLss into two parts:
|
// If needed divide MLss into two parts:
|
||||||
// - inside Areal of other GC
|
// - inside Areal of other GC
|
||||||
// - outside of other GC Areal to check WRT Linear of other GC
|
// - outside of other GC Areal to check WRT Linear of other GC
|
||||||
mls2_t mls2_diff_mpo1, mls2_inters_mpo1;
|
mls2_t mls2_diff_mpo1, mls2_inters_mpo1;
|
||||||
bool is_mls2_divided = false;
|
bool is_mls2_divided = false;
|
||||||
mls1_t mls1_diff_mpo2, mls1_inters_mpo2;
|
mls1_t mls1_diff_mpo2, mls1_inters_mpo2;
|
||||||
@ -284,7 +284,7 @@ struct gc_gc
|
|||||||
geometry::intersection(mls2, mpo1, mls2_inters_mpo1);
|
geometry::intersection(mls2, mpo1, mls2_inters_mpo1);
|
||||||
is_mls2_divided = true;
|
is_mls2_divided = true;
|
||||||
}
|
}
|
||||||
// L/LA
|
// L/LA
|
||||||
if (! geometry::is_empty(mpo2))
|
if (! geometry::is_empty(mpo2))
|
||||||
{
|
{
|
||||||
geometry::difference(mls1, mpo2, mls1_diff_mpo2);
|
geometry::difference(mls1, mpo2, mls1_diff_mpo2);
|
||||||
|
@ -214,7 +214,7 @@ struct relate<default_strategy, false>
|
|||||||
Geometry1,
|
Geometry1,
|
||||||
Geometry2
|
Geometry2
|
||||||
>::type strategy_type;
|
>::type strategy_type;
|
||||||
|
|
||||||
dispatch::relate
|
dispatch::relate
|
||||||
<
|
<
|
||||||
Geometry1,
|
Geometry1,
|
||||||
|
@ -275,7 +275,7 @@ inline bool calculate_from_inside(Geometry1 const& geometry1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto const& range1 = sub_range(geometry1, turn.operations[op_id].seg_id);
|
auto const& range1 = sub_range(geometry1, turn.operations[op_id].seg_id);
|
||||||
|
|
||||||
using range2_view = detail::closed_clockwise_view<typename ring_type<Geometry2>::type const>;
|
using range2_view = detail::closed_clockwise_view<typename ring_type<Geometry2>::type const>;
|
||||||
using range2_iterator = typename boost::range_iterator<range2_view const>::type;
|
using range2_iterator = typename boost::range_iterator<range2_view const>::type;
|
||||||
range2_view const range2(sub_range(geometry2, turn.operations[other_op_id].seg_id));
|
range2_view const range2(sub_range(geometry2, turn.operations[other_op_id].seg_id));
|
||||||
|
@ -515,7 +515,7 @@ struct linear_linear
|
|||||||
bool const other_b = is_ip_on_boundary(it->point,
|
bool const other_b = is_ip_on_boundary(it->point,
|
||||||
it->operations[other_op_id],
|
it->operations[other_op_id],
|
||||||
other_boundary_checker);
|
other_boundary_checker);
|
||||||
|
|
||||||
// if current IP is on boundary of the geometry
|
// if current IP is on boundary of the geometry
|
||||||
if ( this_b )
|
if ( this_b )
|
||||||
{
|
{
|
||||||
|
@ -160,7 +160,7 @@ struct multi_point_geometry_eb<Geometry, multi_linestring_tag>
|
|||||||
typedef std::vector<point_type> points_type;
|
typedef std::vector<point_type> points_type;
|
||||||
typedef geometry::less<void, -1, typename Strategy::cs_tag> less_type;
|
typedef geometry::less<void, -1, typename Strategy::cs_tag> less_type;
|
||||||
|
|
||||||
points_type points(boost::begin(multi_point), boost::end(multi_point));
|
points_type points(boost::begin(multi_point), boost::end(multi_point));
|
||||||
std::sort(points.begin(), points.end(), less_type());
|
std::sort(points.begin(), points.end(), less_type());
|
||||||
|
|
||||||
boundary_visitor<points_type> visitor(points);
|
boundary_visitor<points_type> visitor(points);
|
||||||
@ -183,7 +183,7 @@ struct multi_point_single_geometry
|
|||||||
{
|
{
|
||||||
typedef typename point_type<SingleGeometry>::type point2_type;
|
typedef typename point_type<SingleGeometry>::type point2_type;
|
||||||
typedef model::box<point2_type> box2_type;
|
typedef model::box<point2_type> box2_type;
|
||||||
|
|
||||||
box2_type box2;
|
box2_type box2;
|
||||||
geometry::envelope(single_geometry, box2, strategy);
|
geometry::envelope(single_geometry, box2, strategy);
|
||||||
geometry::detail::expand_by_epsilon(box2);
|
geometry::detail::expand_by_epsilon(box2);
|
||||||
|
@ -169,7 +169,7 @@ struct geometry_point
|
|||||||
// //}
|
// //}
|
||||||
// return result("F0FFFF**T");
|
// return result("F0FFFF**T");
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// /*if ( box_has_interior<Box>::apply(box) )
|
// /*if ( box_has_interior<Box>::apply(box) )
|
||||||
// {
|
// {
|
||||||
@ -195,7 +195,7 @@ struct geometry_point
|
|||||||
// return result("0FTFFTFFT");
|
// return result("0FTFFTFFT");
|
||||||
// else if ( geometry::covered_by(point, box) )
|
// else if ( geometry::covered_by(point, box) )
|
||||||
// return result("FF*0F*FFT");
|
// return result("FF*0F*FFT");
|
||||||
// else
|
// else
|
||||||
// return result("FF*FFT0FT");
|
// return result("FF*FFT0FT");
|
||||||
// }
|
// }
|
||||||
//};
|
//};
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
static const std::size_t static_width = Width;
|
static const std::size_t static_width = Width;
|
||||||
static const std::size_t static_height = Height;
|
static const std::size_t static_height = Height;
|
||||||
static const std::size_t static_size = Width * Height;
|
static const std::size_t static_size = Width * Height;
|
||||||
|
|
||||||
inline matrix()
|
inline matrix()
|
||||||
{
|
{
|
||||||
std::fill_n(m_array, static_size, 'F');
|
std::fill_n(m_array, static_size, 'F');
|
||||||
@ -117,7 +117,7 @@ public:
|
|||||||
{
|
{
|
||||||
return static_size;
|
return static_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const char * data() const
|
inline const char * data() const
|
||||||
{
|
{
|
||||||
return m_array;
|
return m_array;
|
||||||
@ -358,7 +358,7 @@ struct may_update_dispatch
|
|||||||
BOOST_STATIC_ASSERT('0' <= D && D <= '9');
|
BOOST_STATIC_ASSERT('0' <= D && D <= '9');
|
||||||
|
|
||||||
char const m = mask.template get<F1, F2>();
|
char const m = mask.template get<F1, F2>();
|
||||||
|
|
||||||
if ( m == 'F' )
|
if ( m == 'F' )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@ -647,7 +647,7 @@ struct static_mask
|
|||||||
|
|
||||||
BOOST_STATIC_ASSERT(
|
BOOST_STATIC_ASSERT(
|
||||||
std::size_t(util::sequence_size<Seq>::value) == static_size);
|
std::size_t(util::sequence_size<Seq>::value) == static_size);
|
||||||
|
|
||||||
template <detail::relate::field F1, detail::relate::field F2>
|
template <detail::relate::field F1, detail::relate::field F2>
|
||||||
struct static_get
|
struct static_get
|
||||||
{
|
{
|
||||||
@ -744,7 +744,7 @@ struct static_interrupt_dispatch<StaticMask, V, F1, F2, true, IsSequence>
|
|||||||
static const char mask_el = StaticMask::template static_get<F1, F2>::value;
|
static const char mask_el = StaticMask::template static_get<F1, F2>::value;
|
||||||
|
|
||||||
static const bool value
|
static const bool value
|
||||||
= ( V >= '0' && V <= '9' ) ?
|
= ( V >= '0' && V <= '9' ) ?
|
||||||
( mask_el == 'F' || ( mask_el < V && mask_el >= '0' && mask_el <= '9' ) ) :
|
( mask_el == 'F' || ( mask_el < V && mask_el >= '0' && mask_el <= '9' ) ) :
|
||||||
( ( V == 'T' ) ? mask_el == 'F' : false );
|
( ( V == 'T' ) ? mask_el == 'F' : false );
|
||||||
};
|
};
|
||||||
@ -930,7 +930,7 @@ struct static_check_dispatch
|
|||||||
&& per_one<exterior, boundary>::apply(matrix)
|
&& per_one<exterior, boundary>::apply(matrix)
|
||||||
&& per_one<exterior, exterior>::apply(matrix);
|
&& per_one<exterior, exterior>::apply(matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <field F1, field F2>
|
template <field F1, field F2>
|
||||||
struct per_one
|
struct per_one
|
||||||
{
|
{
|
||||||
|
@ -200,7 +200,7 @@ private:
|
|||||||
<
|
<
|
||||||
typename boost::range_value<MultiLinestring const>::type const
|
typename boost::range_value<MultiLinestring const>::type const
|
||||||
>::type point_reference;
|
>::type point_reference;
|
||||||
|
|
||||||
point_reference front_pt = range::front(ls);
|
point_reference front_pt = range::front(ls);
|
||||||
point_reference back_pt = range::back(ls);
|
point_reference back_pt = range::back(ls);
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ struct topology_check<MultiPolygon, Strategy, multi_polygon_tag>
|
|||||||
: topology_check_areal
|
: topology_check_areal
|
||||||
{
|
{
|
||||||
topology_check(MultiPolygon const&, Strategy const&) {}
|
topology_check(MultiPolygon const&, Strategy const&) {}
|
||||||
|
|
||||||
template <typename Point>
|
template <typename Point>
|
||||||
static bool check_boundary_point(Point const& ) { return true; }
|
static bool check_boundary_point(Point const& ) { return true; }
|
||||||
};
|
};
|
||||||
|
@ -249,7 +249,7 @@ struct less_op_areal_areal
|
|||||||
else if ( right_operation.operation == overlay::operation_intersection )
|
else if ( right_operation.operation == overlay::operation_intersection )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return op_to_int_iuxc(left_operation) < op_to_int_iuxc(right_operation);
|
return op_to_int_iuxc(left_operation) < op_to_int_iuxc(right_operation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ struct preceding_check<0, Geometry, spherical_tag>
|
|||||||
calc_t const value = get<0>(point);
|
calc_t const value = get<0>(point);
|
||||||
calc_t const other_min = get<min_corner, 0>(other_box);
|
calc_t const other_min = get<min_corner, 0>(other_box);
|
||||||
calc_t const other_max = get<max_corner, 0>(other_box);
|
calc_t const other_max = get<max_corner, 0>(other_box);
|
||||||
|
|
||||||
bool const pt_covered = strategy::within::detail::covered_by_range
|
bool const pt_covered = strategy::within::detail::covered_by_range
|
||||||
<
|
<
|
||||||
Point, 0, spherical_tag
|
Point, 0, spherical_tag
|
||||||
|
@ -87,7 +87,7 @@ struct box_box_loop
|
|||||||
{
|
{
|
||||||
touch = true;
|
touch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return box_box_loop
|
return box_box_loop
|
||||||
<
|
<
|
||||||
Dimension + 1,
|
Dimension + 1,
|
||||||
|
@ -389,7 +389,7 @@ struct output_geometry_access<TupledOut, Tag, DefaultTag, void>
|
|||||||
>::value;
|
>::value;
|
||||||
|
|
||||||
typedef typename geometry::tuples::element<index, TupledOut>::type type;
|
typedef typename geometry::tuples::element<index, TupledOut>::type type;
|
||||||
|
|
||||||
template <typename Tuple>
|
template <typename Tuple>
|
||||||
static typename geometry::tuples::element<index, Tuple>::type&
|
static typename geometry::tuples::element<index, Tuple>::type&
|
||||||
get(Tuple & tup)
|
get(Tuple & tup)
|
||||||
|
@ -140,7 +140,7 @@ struct multi_point_single_geometry
|
|||||||
typedef decltype(strategy.covered_by(*it, box)) point_in_box_type;
|
typedef decltype(strategy.covered_by(*it, box)) point_in_box_type;
|
||||||
|
|
||||||
int in_val = 0;
|
int in_val = 0;
|
||||||
|
|
||||||
// exterior of box and of geometry
|
// exterior of box and of geometry
|
||||||
if (! point_in_box_type::apply(*it, box)
|
if (! point_in_box_type::apply(*it, box)
|
||||||
|| (in_val = point_in_geometry(*it, linear_or_areal, strategy)) < 0)
|
|| (in_val = point_in_geometry(*it, linear_or_areal, strategy)) < 0)
|
||||||
|
@ -204,7 +204,7 @@ struct point_in_geometry<Polygon, polygon_tag>
|
|||||||
{
|
{
|
||||||
typename interior_return_type<Polygon const>::type
|
typename interior_return_type<Polygon const>::type
|
||||||
rings = interior_rings(polygon);
|
rings = interior_rings(polygon);
|
||||||
|
|
||||||
for (typename detail::interior_iterator<Polygon const>::type
|
for (typename detail::interior_iterator<Polygon const>::type
|
||||||
it = boost::begin(rings);
|
it = boost::begin(rings);
|
||||||
it != boost::end(rings);
|
it != boost::end(rings);
|
||||||
|
@ -431,7 +431,7 @@ private:
|
|||||||
{
|
{
|
||||||
traits::iter_visit<Geometry2>::apply([&](auto const& g2)
|
traits::iter_visit<Geometry2>::apply([&](auto const& g2)
|
||||||
{
|
{
|
||||||
multi_out_minus_g2(out, g2, strategy);
|
multi_out_minus_g2(out, g2, strategy);
|
||||||
}, qit->second);
|
}, qit->second);
|
||||||
|
|
||||||
if (boost::empty(out))
|
if (boost::empty(out))
|
||||||
@ -563,7 +563,7 @@ struct difference<Strategy, false>
|
|||||||
Strategy const& strategy)
|
Strategy const& strategy)
|
||||||
{
|
{
|
||||||
using strategies::relate::services::strategy_converter;
|
using strategies::relate::services::strategy_converter;
|
||||||
|
|
||||||
difference
|
difference
|
||||||
<
|
<
|
||||||
decltype(strategy_converter<Strategy>::get(strategy))
|
decltype(strategy_converter<Strategy>::get(strategy))
|
||||||
@ -586,7 +586,7 @@ struct difference<default_strategy, false>
|
|||||||
Geometry1,
|
Geometry1,
|
||||||
Geometry2
|
Geometry2
|
||||||
>::type strategy_type;
|
>::type strategy_type;
|
||||||
|
|
||||||
difference
|
difference
|
||||||
<
|
<
|
||||||
strategy_type
|
strategy_type
|
||||||
|
@ -187,7 +187,7 @@ struct multi_range_multi_range
|
|||||||
|
|
||||||
boost::geometry::detail::throw_on_empty_input(mrng1);
|
boost::geometry::detail::throw_on_empty_input(mrng1);
|
||||||
boost::geometry::detail::throw_on_empty_input(mrng2);
|
boost::geometry::detail::throw_on_empty_input(mrng2);
|
||||||
|
|
||||||
size_type n = boost::size(mrng1);
|
size_type n = boost::size(mrng1);
|
||||||
result_type haus_dis = 0;
|
result_type haus_dis = 0;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ namespace dispatch
|
|||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Geometry1, typename Geometry2,
|
typename Geometry1, typename Geometry2,
|
||||||
typename Tag1 = typename tag_cast
|
typename Tag1 = typename tag_cast
|
||||||
<
|
<
|
||||||
typename tag<Geometry1>::type,
|
typename tag<Geometry1>::type,
|
||||||
|
@ -288,9 +288,9 @@ struct fe_segment_range_with_closure<open>
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
--end;
|
--end;
|
||||||
|
|
||||||
if (begin == end)
|
if (begin == end)
|
||||||
{
|
{
|
||||||
// single point ranges already handled in closed case above
|
// single point ranges already handled in closed case above
|
||||||
|
@ -81,8 +81,8 @@ struct multi_is_empty
|
|||||||
template <typename MultiGeometry>
|
template <typename MultiGeometry>
|
||||||
static inline bool apply(MultiGeometry const& multigeometry)
|
static inline bool apply(MultiGeometry const& multigeometry)
|
||||||
{
|
{
|
||||||
return std::all_of(boost::begin(multigeometry),
|
return std::all_of(boost::begin(multigeometry),
|
||||||
boost::end(multigeometry),
|
boost::end(multigeometry),
|
||||||
[]( auto const& range ){ return Policy::apply(range); });
|
[]( auto const& range ){ return Policy::apply(range); });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -259,7 +259,7 @@ struct line_interpolate<Strategy, false>
|
|||||||
Distance const& max_distance,
|
Distance const& max_distance,
|
||||||
Pointlike & pointlike,
|
Pointlike & pointlike,
|
||||||
Strategy const& strategy)
|
Strategy const& strategy)
|
||||||
{
|
{
|
||||||
using strategies::line_interpolate::services::strategy_converter;
|
using strategies::line_interpolate::services::strategy_converter;
|
||||||
|
|
||||||
dispatch::line_interpolate
|
dispatch::line_interpolate
|
||||||
@ -278,7 +278,7 @@ struct line_interpolate<default_strategy, false>
|
|||||||
Distance const& max_distance,
|
Distance const& max_distance,
|
||||||
Pointlike & pointlike,
|
Pointlike & pointlike,
|
||||||
default_strategy)
|
default_strategy)
|
||||||
{
|
{
|
||||||
typedef typename strategies::line_interpolate::services::default_strategy
|
typedef typename strategies::line_interpolate::services::default_strategy
|
||||||
<
|
<
|
||||||
Geometry
|
Geometry
|
||||||
|
@ -892,7 +892,7 @@ struct simplify_insert<default_strategy, false>
|
|||||||
<
|
<
|
||||||
Geometry
|
Geometry
|
||||||
>::type strategy_type;
|
>::type strategy_type;
|
||||||
|
|
||||||
simplify_insert
|
simplify_insert
|
||||||
<
|
<
|
||||||
strategy_type
|
strategy_type
|
||||||
@ -935,7 +935,7 @@ struct simplify<GeometryIn, GeometryOut, dynamic_geometry_tag, dynamic_geometry_
|
|||||||
traits::visit<GeometryIn>::apply([&](auto const& g)
|
traits::visit<GeometryIn>::apply([&](auto const& g)
|
||||||
{
|
{
|
||||||
using geom_t = util::remove_cref_t<decltype(g)>;
|
using geom_t = util::remove_cref_t<decltype(g)>;
|
||||||
using detail::simplify::static_geometry_type;
|
using detail::simplify::static_geometry_type;
|
||||||
using geom_out_t = typename static_geometry_type<geom_t, GeometryOut>::type;
|
using geom_out_t = typename static_geometry_type<geom_t, GeometryOut>::type;
|
||||||
geom_out_t o;
|
geom_out_t o;
|
||||||
simplify<geom_t, geom_out_t>::apply(g, o, max_distance, strategy);
|
simplify<geom_t, geom_out_t>::apply(g, o, max_distance, strategy);
|
||||||
@ -956,7 +956,7 @@ struct simplify<GeometryIn, GeometryOut, geometry_collection_tag, geometry_colle
|
|||||||
detail::visit_breadth_first([&](auto const& g)
|
detail::visit_breadth_first([&](auto const& g)
|
||||||
{
|
{
|
||||||
using geom_t = util::remove_cref_t<decltype(g)>;
|
using geom_t = util::remove_cref_t<decltype(g)>;
|
||||||
using detail::simplify::static_geometry_type;
|
using detail::simplify::static_geometry_type;
|
||||||
using geom_out_t = typename static_geometry_type<geom_t, GeometryOut>::type;
|
using geom_out_t = typename static_geometry_type<geom_t, GeometryOut>::type;
|
||||||
geom_out_t o;
|
geom_out_t o;
|
||||||
simplify<geom_t, geom_out_t>::apply(g, o, max_distance, strategy);
|
simplify<geom_t, geom_out_t>::apply(g, o, max_distance, strategy);
|
||||||
|
@ -706,7 +706,7 @@ struct sym_difference<default_strategy, false>
|
|||||||
|
|
||||||
namespace resolve_dynamic
|
namespace resolve_dynamic
|
||||||
{
|
{
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Geometry1, typename Geometry2,
|
typename Geometry1, typename Geometry2,
|
||||||
@ -781,7 +781,7 @@ struct sym_difference<DynamicGeometry1, DynamicGeometry2, dynamic_geometry_tag,
|
|||||||
}, geometry1, geometry2);
|
}, geometry1, geometry2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace resolve_dynamic
|
} // namespace resolve_dynamic
|
||||||
|
|
||||||
|
|
||||||
@ -850,7 +850,7 @@ inline void sym_difference(Geometry1 const& geometry1,
|
|||||||
<
|
<
|
||||||
Geometry1,
|
Geometry1,
|
||||||
Geometry2
|
Geometry2
|
||||||
>::apply(geometry1, geometry2, output_collection, default_strategy());
|
>::apply(geometry1, geometry2, output_collection, default_strategy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ struct union_
|
|||||||
{
|
{
|
||||||
detail::random_access_view<Geometry1 const> gc1_view(geometry1);
|
detail::random_access_view<Geometry1 const> gc1_view(geometry1);
|
||||||
detail::random_access_view<Geometry2 const> gc2_view(geometry2);
|
detail::random_access_view<Geometry2 const> gc2_view(geometry2);
|
||||||
|
|
||||||
detail::gc_group_elements(gc1_view, gc2_view, strategy,
|
detail::gc_group_elements(gc1_view, gc2_view, strategy,
|
||||||
[&](auto const& inters_group)
|
[&](auto const& inters_group)
|
||||||
{
|
{
|
||||||
@ -763,7 +763,7 @@ struct union_<default_strategy, false>
|
|||||||
|
|
||||||
namespace resolve_dynamic
|
namespace resolve_dynamic
|
||||||
{
|
{
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Geometry1, typename Geometry2,
|
typename Geometry1, typename Geometry2,
|
||||||
@ -853,7 +853,7 @@ struct union_<DynamicGeometry1, DynamicGeometry2, dynamic_geometry_tag, dynamic_
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace resolve_dynamic
|
} // namespace resolve_dynamic
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ struct dot_product_maker<P1, P2, DimensionCount, DimensionCount>
|
|||||||
\param p1 first point
|
\param p1 first point
|
||||||
\param p2 second point
|
\param p2 second point
|
||||||
\return the dot product
|
\return the dot product
|
||||||
|
|
||||||
\qbk{[heading Examples]}
|
\qbk{[heading Examples]}
|
||||||
\qbk{[dot_product] [dot_product_output]}
|
\qbk{[dot_product] [dot_product_output]}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ inline bool vec_normalize(Point & pt, typename coordinate_type<Point>::type & le
|
|||||||
|
|
||||||
coord_t const c0 = 0;
|
coord_t const c0 = 0;
|
||||||
len = vec_length(pt);
|
len = vec_length(pt);
|
||||||
|
|
||||||
if (math::equals(len, c0))
|
if (math::equals(len, c0))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -68,13 +68,13 @@ namespace detail { namespace shapefile
|
|||||||
template <typename IStream, typename T>
|
template <typename IStream, typename T>
|
||||||
inline void read_native(IStream & is, T & v)
|
inline void read_native(IStream & is, T & v)
|
||||||
{
|
{
|
||||||
is.read(reinterpret_cast<char*>(&v), sizeof(T));
|
is.read(reinterpret_cast<char*>(&v), sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename IStream, typename T>
|
template <typename IStream, typename T>
|
||||||
inline void read_big(IStream & is, T & v)
|
inline void read_big(IStream & is, T & v)
|
||||||
{
|
{
|
||||||
is.read(reinterpret_cast<char*>(&v), sizeof(T));
|
is.read(reinterpret_cast<char*>(&v), sizeof(T));
|
||||||
boost::endian::big_to_native_inplace(v);
|
boost::endian::big_to_native_inplace(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ inline void double_endianness_check()
|
|||||||
c[7] = 0xc0;
|
c[7] = 0xc0;
|
||||||
|
|
||||||
boost::endian::little_to_native_inplace(*i);
|
boost::endian::little_to_native_inplace(*i);
|
||||||
|
|
||||||
if (static_cast<int>(d) != -149)
|
if (static_cast<int>(d) != -149)
|
||||||
{
|
{
|
||||||
BOOST_THROW_EXCEPTION(read_shapefile_exception("Unexpected endianness of double, please contact developers."));
|
BOOST_THROW_EXCEPTION(read_shapefile_exception("Unexpected endianness of double, please contact developers."));
|
||||||
@ -140,7 +140,7 @@ inline boost::int32_t reset_and_read_header(IStream & is)
|
|||||||
|
|
||||||
// 5 unused, length, version
|
// 5 unused, length, version
|
||||||
is.seekg(7 * sizeof(boost::int32_t), IStream::cur);
|
is.seekg(7 * sizeof(boost::int32_t), IStream::cur);
|
||||||
|
|
||||||
boost::int32_t type = 0;
|
boost::int32_t type = 0;
|
||||||
read_little(is, type);
|
read_little(is, type);
|
||||||
|
|
||||||
@ -376,7 +376,7 @@ struct read_point_policy
|
|||||||
|
|
||||||
read_m(is);
|
read_m(is);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! is.good())
|
if (! is.good())
|
||||||
{
|
{
|
||||||
BOOST_THROW_EXCEPTION(read_shapefile_exception("Read error"));
|
BOOST_THROW_EXCEPTION(read_shapefile_exception("Read error"));
|
||||||
@ -470,7 +470,7 @@ struct read_polyline_policy
|
|||||||
}
|
}
|
||||||
|
|
||||||
read_parts(is, parts, num_parts);
|
read_parts(is, parts, num_parts);
|
||||||
|
|
||||||
for (boost::int32_t i = 0; i < num_parts; ++i)
|
for (boost::int32_t i = 0; i < num_parts; ++i)
|
||||||
{
|
{
|
||||||
boost::int32_t f = parts[i];
|
boost::int32_t f = parts[i];
|
||||||
@ -484,9 +484,9 @@ struct read_polyline_policy
|
|||||||
range::push_back(linestrings, ls_type());
|
range::push_back(linestrings, ls_type());
|
||||||
ls_type & ls = range::back(linestrings);
|
ls_type & ls = range::back(linestrings);
|
||||||
|
|
||||||
std::size_t ls_size = l - f;
|
std::size_t ls_size = l - f;
|
||||||
range::resize(ls, ls_size);
|
range::resize(ls, ls_size);
|
||||||
|
|
||||||
read_and_set_points(is, ls, ls_size);
|
read_and_set_points(is, ls, ls_size);
|
||||||
|
|
||||||
if (type == shape_type::polyline_z || type == shape_type::polyline_m)
|
if (type == shape_type::polyline_z || type == shape_type::polyline_m)
|
||||||
@ -681,7 +681,7 @@ struct read_polygon_policy
|
|||||||
// unexpected, file corrupted, bug or numerical error
|
// unexpected, file corrupted, bug or numerical error
|
||||||
BOOST_THROW_EXCEPTION(read_shapefile_exception("Exterior ring expected"));
|
BOOST_THROW_EXCEPTION(read_shapefile_exception("Exterior ring expected"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! is.good())
|
if (! is.good())
|
||||||
{
|
{
|
||||||
BOOST_THROW_EXCEPTION(read_shapefile_exception("Read error"));
|
BOOST_THROW_EXCEPTION(read_shapefile_exception("Read error"));
|
||||||
@ -784,7 +784,7 @@ struct read_shapefile<Geometry, point_tag>
|
|||||||
static inline void apply(IStream &is, Points & points, Strategy const& strategy)
|
static inline void apply(IStream &is, Points & points, Strategy const& strategy)
|
||||||
{
|
{
|
||||||
namespace shp = detail::shapefile;
|
namespace shp = detail::shapefile;
|
||||||
|
|
||||||
boost::int32_t const type = shp::reset_and_read_header(is);
|
boost::int32_t const type = shp::reset_and_read_header(is);
|
||||||
|
|
||||||
if (type == shp::shape_type::point
|
if (type == shp::shape_type::point
|
||||||
@ -809,7 +809,7 @@ struct read_shapefile<Geometry, multi_point_tag>
|
|||||||
static inline void apply(IStream &is, MultiPoints & multi_points, Strategy const& strategy)
|
static inline void apply(IStream &is, MultiPoints & multi_points, Strategy const& strategy)
|
||||||
{
|
{
|
||||||
namespace shp = detail::shapefile;
|
namespace shp = detail::shapefile;
|
||||||
|
|
||||||
boost::int32_t const type = shp::reset_and_read_header(is);
|
boost::int32_t const type = shp::reset_and_read_header(is);
|
||||||
|
|
||||||
if (type == shp::shape_type::point
|
if (type == shp::shape_type::point
|
||||||
|
@ -144,8 +144,8 @@ struct geometry_type_impl<Geometry, OgcType, 3>
|
|||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Geometry,
|
typename Geometry,
|
||||||
typename CheckPolicy = ogc_policy,
|
typename CheckPolicy = ogc_policy,
|
||||||
typename Tag = typename tag<Geometry>::type
|
typename Tag = typename tag<Geometry>::type
|
||||||
>
|
>
|
||||||
struct geometry_type : not_implemented<Tag>
|
struct geometry_type : not_implemented<Tag>
|
||||||
|
@ -129,7 +129,7 @@ template <typename Geometry>
|
|||||||
struct geometry_type_parser
|
struct geometry_type_parser
|
||||||
{
|
{
|
||||||
template <typename Iterator>
|
template <typename Iterator>
|
||||||
static bool parse(Iterator& it, Iterator end,
|
static bool parse(Iterator& it, Iterator end,
|
||||||
byte_order_type::enum_t order)
|
byte_order_type::enum_t order)
|
||||||
{
|
{
|
||||||
boost::uint32_t value;
|
boost::uint32_t value;
|
||||||
@ -147,7 +147,7 @@ template <typename P,
|
|||||||
struct parsing_assigner
|
struct parsing_assigner
|
||||||
{
|
{
|
||||||
template <typename Iterator>
|
template <typename Iterator>
|
||||||
static void run(Iterator& it, Iterator end, P& point,
|
static void run(Iterator& it, Iterator end, P& point,
|
||||||
byte_order_type::enum_t order)
|
byte_order_type::enum_t order)
|
||||||
{
|
{
|
||||||
typedef typename coordinate_type<P>::type coordinate_type;
|
typedef typename coordinate_type<P>::type coordinate_type;
|
||||||
@ -186,7 +186,7 @@ template <typename P>
|
|||||||
struct point_parser
|
struct point_parser
|
||||||
{
|
{
|
||||||
template <typename Iterator>
|
template <typename Iterator>
|
||||||
static bool parse(Iterator& it, Iterator end, P& point,
|
static bool parse(Iterator& it, Iterator end, P& point,
|
||||||
byte_order_type::enum_t order)
|
byte_order_type::enum_t order)
|
||||||
{
|
{
|
||||||
if (geometry_type_parser<P>::parse(it, end, order))
|
if (geometry_type_parser<P>::parse(it, end, order))
|
||||||
@ -205,7 +205,7 @@ template <typename C>
|
|||||||
struct point_container_parser
|
struct point_container_parser
|
||||||
{
|
{
|
||||||
template <typename Iterator>
|
template <typename Iterator>
|
||||||
static bool parse(Iterator& it, Iterator end, C& container,
|
static bool parse(Iterator& it, Iterator end, C& container,
|
||||||
byte_order_type::enum_t order)
|
byte_order_type::enum_t order)
|
||||||
{
|
{
|
||||||
typedef typename point_type<C>::type point_type;
|
typedef typename point_type<C>::type point_type;
|
||||||
@ -215,7 +215,7 @@ struct point_container_parser
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
|
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
|
||||||
if(num_points > (std::numeric_limits<boost::uint32_t>::max)() )
|
if(num_points > (std::numeric_limits<boost::uint32_t>::max)() )
|
||||||
{
|
{
|
||||||
@ -256,7 +256,7 @@ template <typename L>
|
|||||||
struct linestring_parser
|
struct linestring_parser
|
||||||
{
|
{
|
||||||
template <typename Iterator>
|
template <typename Iterator>
|
||||||
static bool parse(Iterator& it, Iterator end, L& linestring,
|
static bool parse(Iterator& it, Iterator end, L& linestring,
|
||||||
byte_order_type::enum_t order)
|
byte_order_type::enum_t order)
|
||||||
{
|
{
|
||||||
if (!geometry_type_parser<L>::parse(it, end, order))
|
if (!geometry_type_parser<L>::parse(it, end, order))
|
||||||
@ -268,7 +268,7 @@ struct linestring_parser
|
|||||||
{
|
{
|
||||||
throw boost::geometry::read_wkb_exception();
|
throw boost::geometry::read_wkb_exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
return point_container_parser<L>::parse(it, end, linestring, order);
|
return point_container_parser<L>::parse(it, end, linestring, order);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -277,7 +277,7 @@ template <typename Polygon>
|
|||||||
struct polygon_parser
|
struct polygon_parser
|
||||||
{
|
{
|
||||||
template <typename Iterator>
|
template <typename Iterator>
|
||||||
static bool parse(Iterator& it, Iterator end, Polygon& polygon,
|
static bool parse(Iterator& it, Iterator end, Polygon& polygon,
|
||||||
byte_order_type::enum_t order)
|
byte_order_type::enum_t order)
|
||||||
{
|
{
|
||||||
if (!geometry_type_parser<Polygon>::parse(it, end, order))
|
if (!geometry_type_parser<Polygon>::parse(it, end, order))
|
||||||
@ -290,7 +290,7 @@ struct polygon_parser
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef typename boost::geometry::ring_return_type<Polygon>::type ring_type;
|
typedef typename boost::geometry::ring_return_type<Polygon>::type ring_type;
|
||||||
|
|
||||||
std::size_t rings_parsed = 0;
|
std::size_t rings_parsed = 0;
|
||||||
@ -308,7 +308,7 @@ struct polygon_parser
|
|||||||
{
|
{
|
||||||
boost::geometry::range::resize(interior_rings(polygon), rings_parsed);
|
boost::geometry::range::resize(interior_rings(polygon), rings_parsed);
|
||||||
ring_type ringN = boost::geometry::range::back(interior_rings(polygon));
|
ring_type ringN = boost::geometry::range::back(interior_rings(polygon));
|
||||||
|
|
||||||
if (!point_container_parser<ring_type>::parse(it, end, ringN, order))
|
if (!point_container_parser<ring_type>::parse(it, end, ringN, order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -218,7 +218,7 @@ namespace detail { namespace wkb
|
|||||||
|
|
||||||
for(typename boost::range_iterator<ring_type const>::type
|
for(typename boost::range_iterator<ring_type const>::type
|
||||||
point_iter = boost::begin(*ring_iter);
|
point_iter = boost::begin(*ring_iter);
|
||||||
point_iter != boost::end(*ring_iter);
|
point_iter != boost::end(*ring_iter);
|
||||||
++point_iter)
|
++point_iter)
|
||||||
{
|
{
|
||||||
// write point's x, y, z
|
// write point's x, y, z
|
||||||
|
@ -29,7 +29,7 @@ namespace dispatch
|
|||||||
{
|
{
|
||||||
|
|
||||||
template <typename Tag, typename G>
|
template <typename Tag, typename G>
|
||||||
struct write_wkb
|
struct write_wkb
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -101,8 +101,8 @@ inline bool write_wkb(const G& geometry, OutputIterator iter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// template <typename G, typename OutputIterator>
|
// template <typename G, typename OutputIterator>
|
||||||
// inline bool write_wkb(G& geometry, OutputIterator iter,
|
// inline bool write_wkb(G& geometry, OutputIterator iter,
|
||||||
// detail::wkb::byte_order_type::enum_t source_byte_order,
|
// detail::wkb::byte_order_type::enum_t source_byte_order,
|
||||||
// detail::wkb::byte_order_type::enum_t target_byte_order)
|
// detail::wkb::byte_order_type::enum_t target_byte_order)
|
||||||
// {
|
// {
|
||||||
// // The WKB is written to an OutputIterator.
|
// // The WKB is written to an OutputIterator.
|
||||||
@ -112,7 +112,7 @@ inline bool write_wkb(const G& geometry, OutputIterator iter)
|
|||||||
// typename std::iterator_traits<OutputIterator>::iterator_category,
|
// typename std::iterator_traits<OutputIterator>::iterator_category,
|
||||||
// const std::output_iterator_tag&
|
// const std::output_iterator_tag&
|
||||||
// >::value));
|
// >::value));
|
||||||
//
|
//
|
||||||
// if
|
// if
|
||||||
// (
|
// (
|
||||||
// !dispatch::write_wkb
|
// !dispatch::write_wkb
|
||||||
@ -124,7 +124,7 @@ inline bool write_wkb(const G& geometry, OutputIterator iter)
|
|||||||
// {
|
// {
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return true;
|
// return true;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -43,40 +43,40 @@ struct multipoint_parser
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::uint32_t num_points(0);
|
boost::uint32_t num_points(0);
|
||||||
if (!value_parser<boost::uint32_t>::parse(it, end, num_points, order))
|
if (!value_parser<boost::uint32_t>::parse(it, end, num_points, order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the number of double values in the stream is equal
|
// Check that the number of double values in the stream is equal
|
||||||
// or greater than the number of expected values in the multipoint
|
// or greater than the number of expected values in the multipoint
|
||||||
|
|
||||||
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
|
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
|
||||||
|
|
||||||
typedef typename point_type<MultiPoint>::type point_type;
|
typedef typename point_type<MultiPoint>::type point_type;
|
||||||
|
|
||||||
size_type const container_byte_size = dimension<point_type>::value * num_points * sizeof(double)
|
size_type const container_byte_size = dimension<point_type>::value * num_points * sizeof(double)
|
||||||
+ num_points * sizeof(boost::uint8_t)
|
+ num_points * sizeof(boost::uint8_t)
|
||||||
+ num_points * sizeof(boost::uint32_t);
|
+ num_points * sizeof(boost::uint32_t);
|
||||||
|
|
||||||
size_type const stream_byte_size = std::distance(it,end);
|
size_type const stream_byte_size = std::distance(it,end);
|
||||||
|
|
||||||
if(stream_byte_size < container_byte_size)
|
if(stream_byte_size < container_byte_size)
|
||||||
{
|
{
|
||||||
throw boost::geometry::read_wkb_exception();
|
throw boost::geometry::read_wkb_exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
point_type point_buffer;
|
point_type point_buffer;
|
||||||
std::back_insert_iterator<MultiPoint> output(std::back_inserter(multipoint));
|
std::back_insert_iterator<MultiPoint> output(std::back_inserter(multipoint));
|
||||||
|
|
||||||
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
|
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
|
||||||
if(num_points > (std::numeric_limits<boost::uint32_t>::max)() )
|
if(num_points > (std::numeric_limits<boost::uint32_t>::max)() )
|
||||||
{
|
{
|
||||||
throw boost::geometry::read_wkb_exception();
|
throw boost::geometry::read_wkb_exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type points_parsed = 0;
|
size_type points_parsed = 0;
|
||||||
while (points_parsed < num_points && it != end)
|
while (points_parsed < num_points && it != end)
|
||||||
{
|
{
|
||||||
@ -85,16 +85,16 @@ struct multipoint_parser
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!geometry_type_parser<point_type>::parse(it, end, point_byte_order))
|
if (!geometry_type_parser<point_type>::parse(it, end, point_byte_order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
parsing_assigner<point_type, 0, dimension<point_type>::value>::run(it, end, point_buffer, point_byte_order);
|
parsing_assigner<point_type, 0, dimension<point_type>::value>::run(it, end, point_buffer, point_byte_order);
|
||||||
|
|
||||||
output = point_buffer;
|
output = point_buffer;
|
||||||
|
|
||||||
++output;
|
++output;
|
||||||
++points_parsed;
|
++points_parsed;
|
||||||
}
|
}
|
||||||
@ -110,49 +110,49 @@ struct multilinestring_parser
|
|||||||
{
|
{
|
||||||
typedef typename MultiLinestring::value_type linestring_type;
|
typedef typename MultiLinestring::value_type linestring_type;
|
||||||
typedef typename point_type<MultiLinestring>::type point_type;
|
typedef typename point_type<MultiLinestring>::type point_type;
|
||||||
|
|
||||||
if (!geometry_type_parser<MultiLinestring>::parse(it, end, order))
|
if (!geometry_type_parser<MultiLinestring>::parse(it, end, order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::uint32_t num_linestrings(0);
|
boost::uint32_t num_linestrings(0);
|
||||||
if (!value_parser<boost::uint32_t>::parse(it, end, num_linestrings, order))
|
if (!value_parser<boost::uint32_t>::parse(it, end, num_linestrings, order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::back_insert_iterator<MultiLinestring> output(std::back_inserter(multilinestring));
|
std::back_insert_iterator<MultiLinestring> output(std::back_inserter(multilinestring));
|
||||||
|
|
||||||
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
|
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
|
||||||
if(num_linestrings > (std::numeric_limits<boost::uint32_t>::max)() )
|
if(num_linestrings > (std::numeric_limits<boost::uint32_t>::max)() )
|
||||||
{
|
{
|
||||||
throw boost::geometry::read_wkb_exception();
|
throw boost::geometry::read_wkb_exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type linestrings_parsed = 0;
|
size_type linestrings_parsed = 0;
|
||||||
while (linestrings_parsed < num_linestrings && it != end)
|
while (linestrings_parsed < num_linestrings && it != end)
|
||||||
{
|
{
|
||||||
linestring_type linestring_buffer;
|
linestring_type linestring_buffer;
|
||||||
|
|
||||||
detail::wkb::byte_order_type::enum_t linestring_byte_order;
|
detail::wkb::byte_order_type::enum_t linestring_byte_order;
|
||||||
if (!detail::wkb::byte_order_parser::parse(it, end, linestring_byte_order))
|
if (!detail::wkb::byte_order_parser::parse(it, end, linestring_byte_order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!geometry_type_parser<linestring_type>::parse(it, end, order))
|
if (!geometry_type_parser<linestring_type>::parse(it, end, order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!point_container_parser<linestring_type>::parse(it, end, linestring_buffer, linestring_byte_order))
|
if(!point_container_parser<linestring_type>::parse(it, end, linestring_buffer, linestring_byte_order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
output = linestring_buffer;
|
output = linestring_buffer;
|
||||||
|
|
||||||
++output;
|
++output;
|
||||||
++linestrings_parsed;
|
++linestrings_parsed;
|
||||||
}
|
}
|
||||||
@ -167,44 +167,44 @@ struct multipolygon_parser
|
|||||||
static bool parse(Iterator& it, Iterator end, MultiPolygon& multipolygon, byte_order_type::enum_t order)
|
static bool parse(Iterator& it, Iterator end, MultiPolygon& multipolygon, byte_order_type::enum_t order)
|
||||||
{
|
{
|
||||||
typedef typename boost::range_value<MultiPolygon>::type polygon_type;
|
typedef typename boost::range_value<MultiPolygon>::type polygon_type;
|
||||||
|
|
||||||
if (!geometry_type_parser<MultiPolygon>::parse(it, end, order))
|
if (!geometry_type_parser<MultiPolygon>::parse(it, end, order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::uint32_t num_polygons(0);
|
boost::uint32_t num_polygons(0);
|
||||||
if (!value_parser<boost::uint32_t>::parse(it, end, num_polygons, order))
|
if (!value_parser<boost::uint32_t>::parse(it, end, num_polygons, order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::back_insert_iterator<MultiPolygon> output(std::back_inserter(multipolygon));
|
std::back_insert_iterator<MultiPolygon> output(std::back_inserter(multipolygon));
|
||||||
|
|
||||||
std::size_t polygons_parsed = 0;
|
std::size_t polygons_parsed = 0;
|
||||||
while(polygons_parsed < num_polygons && it != end)
|
while(polygons_parsed < num_polygons && it != end)
|
||||||
{
|
{
|
||||||
polygon_type polygon_buffer;
|
polygon_type polygon_buffer;
|
||||||
|
|
||||||
detail::wkb::byte_order_type::enum_t polygon_byte_order;
|
detail::wkb::byte_order_type::enum_t polygon_byte_order;
|
||||||
if (!detail::wkb::byte_order_parser::parse(it, end, polygon_byte_order))
|
if (!detail::wkb::byte_order_parser::parse(it, end, polygon_byte_order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!geometry_type_parser<polygon_type>::parse(it, end, order))
|
if (!geometry_type_parser<polygon_type>::parse(it, end, order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::uint32_t num_rings(0);
|
boost::uint32_t num_rings(0);
|
||||||
if (!value_parser<boost::uint32_t>::parse(it, end, num_rings, polygon_byte_order))
|
if (!value_parser<boost::uint32_t>::parse(it, end, num_rings, polygon_byte_order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t rings_parsed = 0;
|
std::size_t rings_parsed = 0;
|
||||||
|
|
||||||
while (rings_parsed < num_rings && it != end)
|
while (rings_parsed < num_rings && it != end)
|
||||||
{
|
{
|
||||||
typedef typename boost::geometry::ring_return_type<polygon_type>::type ring_type;
|
typedef typename boost::geometry::ring_return_type<polygon_type>::type ring_type;
|
||||||
@ -212,7 +212,7 @@ struct multipolygon_parser
|
|||||||
if (0 == rings_parsed)
|
if (0 == rings_parsed)
|
||||||
{
|
{
|
||||||
ring_type ring0 = exterior_ring(polygon_buffer);
|
ring_type ring0 = exterior_ring(polygon_buffer);
|
||||||
|
|
||||||
if (!point_container_parser<ring_type>::parse(it, end, ring0, polygon_byte_order))
|
if (!point_container_parser<ring_type>::parse(it, end, ring0, polygon_byte_order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -222,7 +222,7 @@ struct multipolygon_parser
|
|||||||
{
|
{
|
||||||
boost::geometry::range::resize(interior_rings(polygon_buffer), rings_parsed);
|
boost::geometry::range::resize(interior_rings(polygon_buffer), rings_parsed);
|
||||||
ring_type ringN = boost::geometry::range::back(interior_rings(polygon_buffer));
|
ring_type ringN = boost::geometry::range::back(interior_rings(polygon_buffer));
|
||||||
|
|
||||||
if (!point_container_parser<ring_type>::parse(it, end, ringN, polygon_byte_order))
|
if (!point_container_parser<ring_type>::parse(it, end, ringN, polygon_byte_order))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -230,11 +230,11 @@ struct multipolygon_parser
|
|||||||
}
|
}
|
||||||
++rings_parsed;
|
++rings_parsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
output = polygon_buffer;
|
output = polygon_buffer;
|
||||||
++output;
|
++output;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -62,9 +62,9 @@ namespace detail { namespace wkb
|
|||||||
// write num points
|
// write num points
|
||||||
uint32_t num_points = boost::size(multipoint);
|
uint32_t num_points = boost::size(multipoint);
|
||||||
value_writer<uint32_t>::write(num_points, iter, byte_order);
|
value_writer<uint32_t>::write(num_points, iter, byte_order);
|
||||||
|
|
||||||
typedef typename point_type<MultiPoint>::type point_type;
|
typedef typename point_type<MultiPoint>::type point_type;
|
||||||
|
|
||||||
for(typename boost::range_iterator<MultiPoint const>::type
|
for(typename boost::range_iterator<MultiPoint const>::type
|
||||||
point_iter = boost::begin(multipoint);
|
point_iter = boost::begin(multipoint);
|
||||||
point_iter != boost::end(multipoint);
|
point_iter != boost::end(multipoint);
|
||||||
@ -95,9 +95,9 @@ namespace detail { namespace wkb
|
|||||||
// write num linestrings
|
// write num linestrings
|
||||||
uint32_t num_linestrings = boost::size(multilinestring);
|
uint32_t num_linestrings = boost::size(multilinestring);
|
||||||
value_writer<uint32_t>::write(num_linestrings, iter, byte_order);
|
value_writer<uint32_t>::write(num_linestrings, iter, byte_order);
|
||||||
|
|
||||||
typedef typename boost::range_value<MultiLinestring>::type linestring_type;
|
typedef typename boost::range_value<MultiLinestring>::type linestring_type;
|
||||||
|
|
||||||
for(typename boost::range_iterator<MultiLinestring const>::type
|
for(typename boost::range_iterator<MultiLinestring const>::type
|
||||||
linestring_iter = boost::begin(multilinestring);
|
linestring_iter = boost::begin(multilinestring);
|
||||||
linestring_iter != boost::end(multilinestring);
|
linestring_iter != boost::end(multilinestring);
|
||||||
@ -128,9 +128,9 @@ namespace detail { namespace wkb
|
|||||||
// write num polygons
|
// write num polygons
|
||||||
uint32_t num_polygons = boost::size(multipolygon);
|
uint32_t num_polygons = boost::size(multipolygon);
|
||||||
value_writer<uint32_t>::write(num_polygons, iter, byte_order);
|
value_writer<uint32_t>::write(num_polygons, iter, byte_order);
|
||||||
|
|
||||||
typedef typename boost::range_value<MultiPolygon>::type polygon_type;
|
typedef typename boost::range_value<MultiPolygon>::type polygon_type;
|
||||||
|
|
||||||
for(typename boost::range_iterator<MultiPolygon const>::type
|
for(typename boost::range_iterator<MultiPolygon const>::type
|
||||||
polygon_iter = boost::begin(multipolygon);
|
polygon_iter = boost::begin(multipolygon);
|
||||||
polygon_iter != boost::end(multipolygon);
|
polygon_iter != boost::end(multipolygon);
|
||||||
|
@ -56,7 +56,7 @@ inline bool box_in_circle(B const& b, C const& c, S const& strategy)
|
|||||||
// Currently only implemented for 2d geometries
|
// Currently only implemented for 2d geometries
|
||||||
assert_dimension<point_type, 2>();
|
assert_dimension<point_type, 2>();
|
||||||
assert_dimension<C, 2>();
|
assert_dimension<C, 2>();
|
||||||
|
|
||||||
// Box: all four points must lie within circle
|
// Box: all four points must lie within circle
|
||||||
point_type const p0 = geometry::make<point_type>(get<min_corner, 0>(b), get<min_corner, 1>(b));
|
point_type const p0 = geometry::make<point_type>(get<min_corner, 0>(b), get<min_corner, 1>(b));
|
||||||
point_type const p1 = geometry::make<point_type>(get<max_corner, 0>(b), get<max_corner, 1>(b));
|
point_type const p1 = geometry::make<point_type>(get<max_corner, 0>(b), get<max_corner, 1>(b));
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
|
|
||||||
CT sin_bet1 = one_minus_f * sin_lat1;
|
CT sin_bet1 = one_minus_f * sin_lat1;
|
||||||
CT sin_bet2 = one_minus_f * sin_lat2;
|
CT sin_bet2 = one_minus_f * sin_lat2;
|
||||||
|
|
||||||
// equator
|
// equator
|
||||||
if (math::equals(sin_bet1, c0) && math::equals(sin_bet2, c0))
|
if (math::equals(sin_bet1, c0) && math::equals(sin_bet2, c0))
|
||||||
{
|
{
|
||||||
@ -80,7 +80,7 @@ public:
|
|||||||
CT m12 = azi_sign * sin(sig_12) * b;
|
CT m12 = azi_sign * sin(sig_12) * b;
|
||||||
reduced_length = m12;
|
reduced_length = m12;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BOOST_GEOMETRY_CONDITION(EnableGeodesicScale))
|
if (BOOST_GEOMETRY_CONDITION(EnableGeodesicScale))
|
||||||
{
|
{
|
||||||
CT M12 = cos(sig_12);
|
CT M12 = cos(sig_12);
|
||||||
@ -180,11 +180,11 @@ private:
|
|||||||
{
|
{
|
||||||
return cos_alp0_sqr * f * L1;
|
return cos_alp0_sqr * f * L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CT const sin_4sig1 = c2 * sin_2sig1 * (math::sqr(cos_sig1) - math::sqr(sin_sig1)); // sin(4sig1)
|
CT const sin_4sig1 = c2 * sin_2sig1 * (math::sqr(cos_sig1) - math::sqr(sin_sig1)); // sin(4sig1)
|
||||||
CT const sin_4sig2 = c2 * sin_2sig2 * (math::sqr(cos_sig2) - math::sqr(sin_sig2)); // sin(4sig2)
|
CT const sin_4sig2 = c2 * sin_2sig2 * (math::sqr(cos_sig2) - math::sqr(sin_sig2)); // sin(4sig2)
|
||||||
CT const sin_4sig_12 = sin_4sig2 - sin_4sig1;
|
CT const sin_4sig_12 = sin_4sig2 - sin_4sig1;
|
||||||
|
|
||||||
CT const c8 = 8;
|
CT const c8 = 8;
|
||||||
CT const c12 = 12;
|
CT const c12 = 12;
|
||||||
CT const c16 = 16;
|
CT const c16 = 16;
|
||||||
@ -266,11 +266,11 @@ private:
|
|||||||
|
|
||||||
CT const c8 = 8;
|
CT const c8 = 8;
|
||||||
CT const c64 = 64;
|
CT const c64 = 64;
|
||||||
|
|
||||||
CT const sin_4sig1 = c2 * sin_2sig1 * (math::sqr(cos_sig1) - math::sqr(sin_sig1)); // sin(4sig1)
|
CT const sin_4sig1 = c2 * sin_2sig1 * (math::sqr(cos_sig1) - math::sqr(sin_sig1)); // sin(4sig1)
|
||||||
CT const sin_4sig2 = c2 * sin_2sig2 * (math::sqr(cos_sig2) - math::sqr(sin_sig2)); // sin(4sig2)
|
CT const sin_4sig2 = c2 * sin_2sig2 * (math::sqr(cos_sig2) - math::sqr(sin_sig2)); // sin(4sig2)
|
||||||
CT const sin_4sig_12 = sin_4sig2 - sin_4sig1;
|
CT const sin_4sig_12 = sin_4sig2 - sin_4sig1;
|
||||||
|
|
||||||
CT const L2 = (sin_4sig_12 - c8 * sin_2sig_12 + 12 * sig_12) / c64;
|
CT const L2 = (sin_4sig_12 - c8 * sin_2sig_12 + 12 * sig_12) / c64;
|
||||||
|
|
||||||
if (Order == 2)
|
if (Order == 2)
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include <boost/geometry/util/select_coordinate_type.hpp>
|
#include <boost/geometry/util/select_coordinate_type.hpp>
|
||||||
|
|
||||||
namespace boost { namespace geometry {
|
namespace boost { namespace geometry {
|
||||||
|
|
||||||
namespace formula {
|
namespace formula {
|
||||||
|
|
||||||
template <typename Point3d, typename PointGeo, typename Spheroid>
|
template <typename Point3d, typename PointGeo, typename Spheroid>
|
||||||
@ -107,11 +107,11 @@ inline PointGeo cart3d_to_geo(Point3d const& point_3d, Spheroid const& spheroid)
|
|||||||
calc_t const xy_l = math::sqrt(math::sqr(x) + math::sqr(y));
|
calc_t const xy_l = math::sqrt(math::sqr(x) + math::sqr(y));
|
||||||
|
|
||||||
calc_t const lonr = atan2(y, x);
|
calc_t const lonr = atan2(y, x);
|
||||||
|
|
||||||
// NOTE: Alternative version
|
// NOTE: Alternative version
|
||||||
// http://www.iag-aig.org/attach/989c8e501d9c5b5e2736955baf2632f5/V60N2_5FT.pdf
|
// http://www.iag-aig.org/attach/989c8e501d9c5b5e2736955baf2632f5/V60N2_5FT.pdf
|
||||||
// calc_t const lonr = c2 * atan2(y, x + xy_l);
|
// calc_t const lonr = c2 * atan2(y, x + xy_l);
|
||||||
|
|
||||||
calc_t const latr = atan2(z, (c1 - e_sqr) * xy_l);
|
calc_t const latr = atan2(z, (c1 - e_sqr) * xy_l);
|
||||||
|
|
||||||
// NOTE: If h is equal to 0 then there is no need to improve value of latitude
|
// NOTE: If h is equal to 0 then there is no need to improve value of latitude
|
||||||
@ -141,8 +141,8 @@ inline PointGeo cart3d_to_geo(Point3d const& point_3d, Spheroid const& spheroid)
|
|||||||
template <typename Point3d, typename Spheroid>
|
template <typename Point3d, typename Spheroid>
|
||||||
inline Point3d projected_to_xy(Point3d const& point_3d, Spheroid const& spheroid)
|
inline Point3d projected_to_xy(Point3d const& point_3d, Spheroid const& spheroid)
|
||||||
{
|
{
|
||||||
typedef typename coordinate_type<Point3d>::type coord_t;
|
typedef typename coordinate_type<Point3d>::type coord_t;
|
||||||
|
|
||||||
// len_xy = sqrt(x^2 + y^2)
|
// len_xy = sqrt(x^2 + y^2)
|
||||||
// r = len_xy - |z / tan(lat)|
|
// r = len_xy - |z / tan(lat)|
|
||||||
// assuming h = 0
|
// assuming h = 0
|
||||||
@ -151,7 +151,7 @@ inline Point3d projected_to_xy(Point3d const& point_3d, Spheroid const& spheroid
|
|||||||
// r = e^2 * len_xy
|
// r = e^2 * len_xy
|
||||||
// x_res = r * cos(lon) = e^2 * len_xy * x / len_xy = e^2 * x
|
// x_res = r * cos(lon) = e^2 * len_xy * x / len_xy = e^2 * x
|
||||||
// y_res = r * sin(lon) = e^2 * len_xy * y / len_xy = e^2 * y
|
// y_res = r * sin(lon) = e^2 * len_xy * y / len_xy = e^2 * y
|
||||||
|
|
||||||
coord_t const c0 = 0;
|
coord_t const c0 = 0;
|
||||||
coord_t const e_sqr = formula::eccentricity_sqr<coord_t>(spheroid);
|
coord_t const e_sqr = formula::eccentricity_sqr<coord_t>(spheroid);
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ inline Point3d projected_to_surface(Point3d const& direction, Spheroid const& sp
|
|||||||
//(x*x+y*y)/(a*a) + z*z/(b*b) = 1
|
//(x*x+y*y)/(a*a) + z*z/(b*b) = 1
|
||||||
// x = d.x * t
|
// x = d.x * t
|
||||||
// y = d.y * t
|
// y = d.y * t
|
||||||
// z = d.z * t
|
// z = d.z * t
|
||||||
coord_t const dx = get<0>(direction);
|
coord_t const dx = get<0>(direction);
|
||||||
coord_t const dy = get<1>(direction);
|
coord_t const dy = get<1>(direction);
|
||||||
coord_t const dz = get<2>(direction);
|
coord_t const dz = get<2>(direction);
|
||||||
@ -217,7 +217,7 @@ inline bool projected_to_surface(Point3d const& origin, Point3d const& direction
|
|||||||
//(x*x+y*y)/(a*a) + z*z/(b*b) = 1
|
//(x*x+y*y)/(a*a) + z*z/(b*b) = 1
|
||||||
// x = o.x + d.x * t
|
// x = o.x + d.x * t
|
||||||
// y = o.y + d.y * t
|
// y = o.y + d.y * t
|
||||||
// z = o.z + d.z * t
|
// z = o.z + d.z * t
|
||||||
coord_t const ox = get<0>(origin);
|
coord_t const ox = get<0>(origin);
|
||||||
coord_t const oy = get<1>(origin);
|
coord_t const oy = get<1>(origin);
|
||||||
coord_t const oz = get<2>(origin);
|
coord_t const oz = get<2>(origin);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user