diff --git a/include/boost/geometry/extensions/index/filters/nearest_filter.hpp b/include/boost/geometry/extensions/index/filters/nearest_filter.hpp index ec6fcd9e0..adc871b7c 100644 --- a/include/boost/geometry/extensions/index/filters/nearest_filter.hpp +++ b/include/boost/geometry/extensions/index/filters/nearest_filter.hpp @@ -10,7 +10,9 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_NEAREST_FILTER_HPP #define BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_NEAREST_FILTER_HPP -namespace boost { namespace geometry { namespace index { namespace filters { +namespace boost { namespace geometry { namespace index { + +namespace filters { template class nearest_filter @@ -64,7 +66,7 @@ detail::nearest_filtered nearest_filtered( return detail::nearest_filtered(p, distance); } -}}}} // namespace boost::geometry::index::filters +} // namespace filters template boost::geometry::index::filters::nearest_filter @@ -75,4 +77,6 @@ boost::geometry::index::filters::nearest_filter return boost::geometry::index::filters::nearest_filter(si, f.point(), f.distance()); } +}}} // namespace boost::geometry::index + #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_NEAREST_FILTER_HPP diff --git a/include/boost/geometry/extensions/index/filters/spacial_filter.hpp b/include/boost/geometry/extensions/index/filters/spacial_filter.hpp index 7e8b69a6c..7790471e0 100644 --- a/include/boost/geometry/extensions/index/filters/spacial_filter.hpp +++ b/include/boost/geometry/extensions/index/filters/spacial_filter.hpp @@ -10,7 +10,9 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_SPACIAL_FILTER_HPP #define BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_SPACIAL_FILTER_HPP -namespace boost { namespace geometry { namespace index { namespace filters { +namespace boost { namespace geometry { namespace index { + +namespace filters { template class spatial_filter @@ -49,15 +51,17 @@ detail::spatially_filtered spatially_filtered(Geometry const& geom) return detail::spatially_filtered(geom); } -}}}} // namespace boost::geometry::index::filters +} // namespace filters template -boost::geometry::index::filters::spatial_filter +index::filters::spatial_filter operator|( SpacialIndex const& si, - boost::geometry::index::filters::detail::spatially_filtered const& f) + index::filters::detail::spatially_filtered const& f) { - return boost::geometry::index::filters::spatial_filter(si, f.geometry()); + return index::filters::spatial_filter(si, f.geometry()); } +}}} // namespace boost::geometry::index + #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_SPACIAL_FILTER_HPP diff --git a/include/boost/geometry/extensions/index/rtree/filters.hpp b/include/boost/geometry/extensions/index/rtree/filters.hpp index dcd598152..1f3a610b4 100644 --- a/include/boost/geometry/extensions/index/rtree/filters.hpp +++ b/include/boost/geometry/extensions/index/rtree/filters.hpp @@ -31,17 +31,17 @@ class spatial_filter< index::rtree > public: typedef typename std::deque::iterator iterator; typedef typename std::deque::const_iterator const_iterator; - + template - spatial_filter(index::rtree const& rtree, Geometry const& geom) + inline spatial_filter(index::rtree const& rtree, Geometry const& geom) { rtree.find(geom, std::back_inserter(m_result)); } - iterator begin() { return m_result.begin(); } - iterator end() { return m_result.end(); } - const_iterator begin() const { return m_result.begin(); } - const_iterator end() const { return m_result.end(); } + inline iterator begin() { return m_result.begin(); } + inline iterator end() { return m_result.end(); } + inline const_iterator begin() const { return m_result.begin(); } + inline const_iterator end() const { return m_result.end(); } private: std::deque m_result; @@ -49,6 +49,19 @@ private: } // namespace filters +// TODO: awulkiew - filter may be implemented in operator| + +//template +//std::deque +//operator|( +// index::rtree const& si, +// index::filters::detail::spatially_filtered const& f) +//{ +// std::deque result; +// si.find(f.geometry(), std::back_inserter(result)); +// return result; +//} + }}} // namespace boost::geometry::index #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_FILTERS_HPP