rtree.h Source File
|
CPP API
|
rtree.h
Go to the documentation of this file.
48 std::is_floating_point_v<decltype(loc.get_latitude())> && std::is_floating_point_v<decltype(loc.get_longitude())>;
101 std::vector<size_t> nearest_neighbor_indices(const IsSphericalLocation auto& location, size_t number) const
108 query(m_rtree, nearest(point, number), mio::back_inserter_second_element<std::vector<size_t>, Node>{indices});
119 std::vector<size_t> in_range_indices_approximate(const IsSphericalLocation auto& location, Distance radius) const
126 query(m_rtree, covered_by(circle), mio::back_inserter_second_element<std::vector<size_t>, Node>{indices});
137 std::vector<std::vector<size_t>> in_range_indices_query(const IsSphericalLocation auto& location,
173 std::vector<size_t> in_range_indices(const IsSphericalLocation auto& location, Distance radius) const
196 using Point = boost::geometry::model::point<double, 2, boost::geometry::cs::geographic<boost::geometry::degree>>;
200 using MultiPolygon = boost::geometry::model::multi_polygon<boost::geometry::model::polygon<Point>>;
209 MultiPolygon create_circle_approximation(const IsSphericalLocation auto& location, Distance radius,
223 boost::geometry::buffer(midpoint, circle, distance_strategy, side_strategy, join_strategy, end_strategy,
230 boost::geometry::index::rtree<Node, boost::geometry::index::rstar<m_max_number_of_elements_per_tree_node>> m_rtree;
All Locations in the simulated Model where Persons gather.
Definition: location.h:92
ScalarType meters() const
return distance in meters.
Definition: distance.h:63
R-tree for spatial queries of geographical locations on the sphere.
Definition: rtree.h:61
constexpr static size_t m_max_number_of_elements_per_tree_node
Definition: rtree.h:229
std::vector< size_t > nearest_neighbor_indices(const IsSphericalLocation auto &location, size_t number) const
Return the indices of the k nearest neighbors (i.e.
Definition: rtree.h:101
std::vector< size_t > in_range_indices(const IsSphericalLocation auto &location, Distance radius) const
Return the indices of the points within a given radius.
Definition: rtree.h:173
std::vector< std::vector< size_t > > in_range_indices_query(const IsSphericalLocation auto &location, const std::vector< Distance > &radii) const
Return the indices of the points within each given radius for multiple radii at the same time.
Definition: rtree.h:137
std::vector< size_t > in_range_indices_approximate(const IsSphericalLocation auto &location, Distance radius) const
Return the indices of the points within a given radius (in kilometers) where the circle is approximat...
Definition: rtree.h:119
MultiPolygon create_circle_approximation(const IsSphericalLocation auto &location, Distance radius, size_t approximation_points=36) const
Create a circle approximation object.
Definition: rtree.h:209
std::pair< Point, size_t > Node
Node stores a point and its associated index.
Definition: rtree.h:198
auto size() const
Return the number of data points stored in the RTree.
Definition: rtree.h:89
boost::geometry::model::point< double, 2, boost::geometry::cs::geographic< boost::geometry::degree > > Point
Point stores longitude and latitude in this order.
Definition: rtree.h:196
boost::geometry::index::rtree< Node, boost::geometry::index::rstar< m_max_number_of_elements_per_tree_node > > m_rtree
Definition: rtree.h:230
RTree(const std::vector< Location > &locations)
Construct a new RTree object with data given in a vector.
Definition: rtree.h:75
boost::geometry::model::multi_polygon< boost::geometry::model::polygon< Point > > MultiPolygon
MultiPolygon type for circle approximation.
Definition: rtree.h:200
concept IsSphericalLocation
Concept for spherical location types.
Definition: rtree.h:47
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
requires(!std::is_trivial_v< T >) void BinarySerializerObject
Definition: binary_serializer.h:333
Back inserter that ignores the first element of pairs given to it.
Definition: back_inserter_second_element.h:33
Generated by