Implements a vector tileserver so you can see what's going on inside

OSRM.
This commit is contained in:
Daniel Patterson
2016-02-16 10:51:04 -08:00
committed by Patrick Niklaus
parent 33403efc8e
commit 5dc7b79bb6
18 changed files with 709 additions and 14 deletions
@@ -76,6 +76,9 @@ template <class EdgeDataT> class BaseDataFacade
virtual extractor::TravelMode GetTravelModeForEdgeID(const unsigned id) const = 0;
virtual std::vector<RTreeLeaf> GetEdgesInBox(const util::FixedPointCoordinate & south_west,
const util::FixedPointCoordinate & north_east) = 0;
virtual std::vector<PhantomNodeWithDistance>
NearestPhantomNodesInRange(const util::FixedPointCoordinate input_coordinate,
const float max_distance,
@@ -15,6 +15,7 @@
#include "util/range_table.hpp"
#include "util/graph_loader.hpp"
#include "util/simple_logger.hpp"
#include "util/rectangle.hpp"
#include "osrm/coordinate.hpp"
@@ -357,6 +358,20 @@ template <class EdgeDataT> class InternalDataFacade final : public BaseDataFacad
return m_travel_mode_list.at(id);
}
std::vector<RTreeLeaf> GetEdgesInBox(const util::FixedPointCoordinate & south_west,
const util::FixedPointCoordinate & north_east)
override final
{
if (!m_static_rtree.get())
{
LoadRTree();
BOOST_ASSERT(m_geospatial_query.get());
}
util::RectangleInt2D bbox = {south_west.lon, north_east.lon,
south_west.lat, north_east.lat};
return m_geospatial_query->Search(bbox);
}
std::vector<PhantomNodeWithDistance>
NearestPhantomNodesInRange(const util::FixedPointCoordinate input_coordinate,
const float max_distance,
@@ -13,6 +13,7 @@
#include "util/static_rtree.hpp"
#include "util/make_unique.hpp"
#include "util/simple_logger.hpp"
#include "util/rectangle.hpp"
#include <cstddef>
@@ -407,6 +408,20 @@ template <class EdgeDataT> class SharedDataFacade final : public BaseDataFacade<
return m_travel_mode_list.at(id);
}
std::vector<RTreeLeaf> GetEdgesInBox(const util::FixedPointCoordinate & south_west,
const util::FixedPointCoordinate & north_east)
override final
{
if (!m_static_rtree.get() || CURRENT_TIMESTAMP != m_static_rtree->first)
{
LoadRTree();
BOOST_ASSERT(m_geospatial_query.get());
}
util::RectangleInt2D bbox = {south_west.lon, north_east.lon,
south_west.lat, north_east.lat};
return m_geospatial_query->Search(bbox);
}
std::vector<PhantomNodeWithDistance>
NearestPhantomNodesInRange(const util::FixedPointCoordinate input_coordinate,
const float max_distance,