remove zoom level from nearest neighbor calls
This commit is contained in:
parent
1bb3da0332
commit
2b63eb8243
@ -101,13 +101,11 @@ template <class EdgeDataT> class BaseDataFacade
|
||||
virtual bool
|
||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
||||
const unsigned zoom_level,
|
||||
const unsigned number_of_results) = 0;
|
||||
|
||||
virtual bool
|
||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||
PhantomNode &resulting_phantom_node,
|
||||
const unsigned zoom_leve) = 0;
|
||||
PhantomNode &resulting_phantom_node) = 0;
|
||||
|
||||
virtual unsigned GetCheckSum() const = 0;
|
||||
|
||||
|
@ -379,13 +379,11 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
||||
|
||||
bool
|
||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||
PhantomNode &resulting_phantom_node,
|
||||
const unsigned zoom_level) final
|
||||
PhantomNode &resulting_phantom_node) final
|
||||
{
|
||||
std::vector<PhantomNode> resulting_phantom_node_vector;
|
||||
auto result = IncrementalFindPhantomNodeForCoordinate(input_coordinate,
|
||||
resulting_phantom_node_vector,
|
||||
zoom_level,
|
||||
1);
|
||||
if (result)
|
||||
{
|
||||
@ -398,7 +396,6 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
||||
bool
|
||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
||||
const unsigned zoom_level,
|
||||
const unsigned number_of_results) final
|
||||
{
|
||||
if (!m_static_rtree.get())
|
||||
@ -407,7 +404,7 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
||||
}
|
||||
|
||||
return m_static_rtree->IncrementalFindPhantomNodeForCoordinate(
|
||||
input_coordinate, resulting_phantom_node_vector, zoom_level, number_of_results);
|
||||
input_coordinate, resulting_phantom_node_vector, number_of_results);
|
||||
}
|
||||
|
||||
unsigned GetCheckSum() const final { return m_check_sum; }
|
||||
|
@ -371,13 +371,11 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
||||
|
||||
bool
|
||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||
PhantomNode &resulting_phantom_node,
|
||||
const unsigned zoom_level) final
|
||||
PhantomNode &resulting_phantom_node) final
|
||||
{
|
||||
std::vector<PhantomNode> resulting_phantom_node_vector;
|
||||
auto result = IncrementalFindPhantomNodeForCoordinate(input_coordinate,
|
||||
resulting_phantom_node_vector,
|
||||
zoom_level,
|
||||
1);
|
||||
if (result)
|
||||
{
|
||||
@ -390,7 +388,6 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
||||
bool
|
||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
||||
const unsigned zoom_level,
|
||||
const unsigned number_of_results) final
|
||||
{
|
||||
if (!m_static_rtree.get() || CURRENT_TIMESTAMP != m_static_rtree->first)
|
||||
@ -399,7 +396,7 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
||||
}
|
||||
|
||||
return m_static_rtree->second->IncrementalFindPhantomNodeForCoordinate(
|
||||
input_coordinate, resulting_phantom_node_vector, zoom_level, number_of_results);
|
||||
input_coordinate, resulting_phantom_node_vector, number_of_results);
|
||||
}
|
||||
|
||||
unsigned GetCheckSum() const final { return m_check_sum; }
|
||||
|
@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "shared_memory_vector_wrapper.hpp"
|
||||
|
||||
#include "../Util/floating_point.hpp"
|
||||
#include "../Util/integer_range.hpp"
|
||||
#include "../Util/MercatorUtil.h"
|
||||
#include "../Util/OSRMException.h"
|
||||
#include "../Util/simple_logger.hpp"
|
||||
@ -649,21 +650,11 @@ class StaticRTree
|
||||
bool
|
||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||
std::vector<PhantomNode> &result_phantom_node_vector,
|
||||
const unsigned zoom_level,
|
||||
const unsigned number_of_results,
|
||||
const unsigned max_checked_segments = 4*LEAF_NODE_SIZE)
|
||||
{
|
||||
// TIMER_START(samet);
|
||||
// SimpleLogger().Write(logDEBUG) << "searching for " << number_of_results << " results";
|
||||
std::vector<float> min_found_distances(number_of_results, std::numeric_limits<float>::max());
|
||||
|
||||
// unsigned dequeues = 0;
|
||||
// unsigned inspected_mbrs = 0;
|
||||
// unsigned loaded_leafs = 0;
|
||||
unsigned inspected_segments = 0;
|
||||
// unsigned pruned_elements = 0;
|
||||
// unsigned ignored_segments = 0;
|
||||
// unsigned ignored_mbrs = 0;
|
||||
|
||||
unsigned number_of_results_found_in_big_cc = 0;
|
||||
unsigned number_of_results_found_in_tiny_cc = 0;
|
||||
@ -677,13 +668,9 @@ class StaticRTree
|
||||
const IncrementalQueryCandidate current_query_node = traversal_queue.top();
|
||||
traversal_queue.pop();
|
||||
|
||||
// ++dequeues;
|
||||
|
||||
const float current_min_dist = min_found_distances[number_of_results-1];
|
||||
|
||||
if (current_query_node.min_dist > current_min_dist)
|
||||
{
|
||||
// ++pruned_elements;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -692,13 +679,6 @@ class StaticRTree
|
||||
const TreeNode & current_tree_node = current_query_node.node.template get<TreeNode>();
|
||||
if (current_tree_node.child_is_on_disk)
|
||||
{
|
||||
// ++loaded_leafs;
|
||||
// SimpleLogger().Write(logDEBUG) << "loading leaf: " << current_tree_node.children[0] << " w/ mbr [" <<
|
||||
// current_tree_node.minimum_bounding_rectangle.min_lat/COORDINATE_PRECISION << "," <<
|
||||
// current_tree_node.minimum_bounding_rectangle.min_lon/COORDINATE_PRECISION << "," <<
|
||||
// current_tree_node.minimum_bounding_rectangle.max_lat/COORDINATE_PRECISION << "-" <<
|
||||
// current_tree_node.minimum_bounding_rectangle.max_lon/COORDINATE_PRECISION << "]";
|
||||
|
||||
LeafNode current_leaf_node;
|
||||
LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node);
|
||||
// Add all objects from leaf into queue
|
||||
@ -717,23 +697,10 @@ class StaticRTree
|
||||
{
|
||||
traversal_queue.emplace(current_perpendicular_distance, current_edge);
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// ++ignored_segments;
|
||||
// }
|
||||
}
|
||||
// SimpleLogger().Write(logDEBUG) << "added " << current_leaf_node.object_count << " roads into queue of " << traversal_queue.size();
|
||||
}
|
||||
else
|
||||
{
|
||||
// ++inspected_mbrs;
|
||||
// explore inner node
|
||||
// SimpleLogger().Write(logDEBUG) << "explore inner node w/ mbr [" <<
|
||||
// current_tree_node.minimum_bounding_rectangle.min_lat/COORDINATE_PRECISION << "," <<
|
||||
// current_tree_node.minimum_bounding_rectangle.min_lon/COORDINATE_PRECISION << "," <<
|
||||
// current_tree_node.minimum_bounding_rectangle.max_lat/COORDINATE_PRECISION << "-" <<
|
||||
// current_tree_node.minimum_bounding_rectangle.max_lon/COORDINATE_PRECISION << "," << "]";
|
||||
|
||||
// for each child mbr
|
||||
for (uint32_t i = 0; i < current_tree_node.child_count; ++i)
|
||||
{
|
||||
@ -750,12 +717,7 @@ class StaticRTree
|
||||
{
|
||||
traversal_queue.emplace(lower_bound_to_element, child_tree_node);
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// ++ignored_mbrs;
|
||||
// }
|
||||
}
|
||||
// SimpleLogger().Write(logDEBUG) << "added " << current_tree_node.child_count << " mbrs into queue of " << traversal_queue.size();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -866,7 +828,6 @@ class StaticRTree
|
||||
bool
|
||||
IncrementalFindPhantomNodeForCoordinateWithDistance(const FixedPointCoordinate &input_coordinate,
|
||||
std::vector<std::pair<PhantomNode, double>> &result_phantom_node_vector,
|
||||
const unsigned zoom_level,
|
||||
const unsigned number_of_results,
|
||||
const unsigned max_checked_segments = 4*LEAF_NODE_SIZE)
|
||||
{
|
||||
|
@ -90,7 +90,6 @@ template <class DataFacadeT> class DistanceTablePlugin final : public BasePlugin
|
||||
}
|
||||
facade->IncrementalFindPhantomNodeForCoordinate(route_parameters.coordinates[i],
|
||||
phantom_node_vector[i],
|
||||
route_parameters.zoom_level,
|
||||
1);
|
||||
|
||||
BOOST_ASSERT(phantom_node_vector[i].front().is_valid(facade->GetNumberOfNodes()));
|
||||
|
@ -60,7 +60,6 @@ template <class DataFacadeT> class NearestPlugin final : public BasePlugin
|
||||
std::vector<PhantomNode> phantom_node_vector;
|
||||
facade->IncrementalFindPhantomNodeForCoordinate(route_parameters.coordinates.front(),
|
||||
phantom_node_vector,
|
||||
route_parameters.zoom_level,
|
||||
static_cast<int>(number_of_results));
|
||||
|
||||
JSON::Object json_result;
|
||||
|
@ -93,8 +93,7 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin
|
||||
}
|
||||
}
|
||||
facade->IncrementalFindPhantomNodeForCoordinate(route_parameters.coordinates[i],
|
||||
phantom_node_vector[i],
|
||||
route_parameters.zoom_level);
|
||||
phantom_node_vector[i]);
|
||||
}
|
||||
|
||||
RawRouteData raw_route;
|
||||
|
Loading…
Reference in New Issue
Block a user