Formats all the files we touch..
This commit is contained in:
committed by
Patrick Niklaus
parent
8126793b18
commit
aeee565115
@@ -26,9 +26,10 @@ struct RectangleInt2D
|
||||
{
|
||||
}
|
||||
|
||||
RectangleInt2D(int32_t min_lon_, int32_t max_lon_, int32_t min_lat_, int32_t max_lat_) :
|
||||
min_lon(min_lon_), max_lon(max_lon_),
|
||||
min_lat(min_lat_), max_lat(max_lat_) {}
|
||||
RectangleInt2D(int32_t min_lon_, int32_t max_lon_, int32_t min_lat_, int32_t max_lat_)
|
||||
: min_lon(min_lon_), max_lon(max_lon_), min_lat(min_lat_), max_lat(max_lat_)
|
||||
{
|
||||
}
|
||||
|
||||
int32_t min_lon, max_lon;
|
||||
int32_t min_lat, max_lat;
|
||||
@@ -59,8 +60,8 @@ struct RectangleInt2D
|
||||
{
|
||||
// Standard box intersection test - check if boxes *don't* overlap,
|
||||
// and return the negative of that
|
||||
return ! (max_lon < other.min_lon || min_lon > other.max_lon
|
||||
|| max_lat < other.min_lat || min_lat > other.max_lat);
|
||||
return !(max_lon < other.min_lon || min_lon > other.max_lon || max_lat < other.min_lat ||
|
||||
min_lat > other.max_lat);
|
||||
}
|
||||
|
||||
double GetMinDist(const FixedPointCoordinate location) const
|
||||
|
||||
@@ -322,7 +322,7 @@ class StaticRTree
|
||||
}
|
||||
|
||||
/* Returns all features inside the bounding box */
|
||||
std::vector<EdgeDataT> SearchInBox(const Rectangle & search_rectangle)
|
||||
std::vector<EdgeDataT> SearchInBox(const Rectangle &search_rectangle)
|
||||
{
|
||||
|
||||
std::vector<EdgeDataT> results;
|
||||
@@ -345,11 +345,14 @@ class StaticRTree
|
||||
{
|
||||
const auto ¤t_edge = current_leaf_node.objects[i];
|
||||
|
||||
Rectangle bbox =
|
||||
{std::min((*m_coordinate_list)[current_edge.u].lon, (*m_coordinate_list)[current_edge.v].lon),
|
||||
std::max((*m_coordinate_list)[current_edge.u].lon, (*m_coordinate_list)[current_edge.v].lon),
|
||||
std::min((*m_coordinate_list)[current_edge.u].lat, (*m_coordinate_list)[current_edge.v].lat),
|
||||
std::max((*m_coordinate_list)[current_edge.u].lat, (*m_coordinate_list)[current_edge.v].lat)};
|
||||
Rectangle bbox = {std::min((*m_coordinate_list)[current_edge.u].lon,
|
||||
(*m_coordinate_list)[current_edge.v].lon),
|
||||
std::max((*m_coordinate_list)[current_edge.u].lon,
|
||||
(*m_coordinate_list)[current_edge.v].lon),
|
||||
std::min((*m_coordinate_list)[current_edge.u].lat,
|
||||
(*m_coordinate_list)[current_edge.v].lat),
|
||||
std::max((*m_coordinate_list)[current_edge.u].lat,
|
||||
(*m_coordinate_list)[current_edge.v].lat)};
|
||||
|
||||
if (bbox.Intersects(search_rectangle))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user