Removed unused geojson logging in partitioner
This commit is contained in:
parent
19651c3d91
commit
92b7d581ce
@ -38,65 +38,6 @@ namespace osrm
|
||||
{
|
||||
namespace partitioner
|
||||
{
|
||||
|
||||
void LogGeojson(const std::string &filename, const std::vector<std::uint32_t> &bisection_ids)
|
||||
{
|
||||
// reload graph, since we destroyed the old one
|
||||
auto compressed_node_based_graph = LoadCompressedNodeBasedGraph(filename);
|
||||
|
||||
util::Log() << "Loaded compressed node based graph: "
|
||||
<< compressed_node_based_graph.edges.size() << " edges, "
|
||||
<< compressed_node_based_graph.coordinates.size() << " nodes";
|
||||
|
||||
groupEdgesBySource(begin(compressed_node_based_graph.edges),
|
||||
end(compressed_node_based_graph.edges));
|
||||
|
||||
auto graph =
|
||||
makeBisectionGraph(compressed_node_based_graph.coordinates,
|
||||
adaptToBisectionEdge(std::move(compressed_node_based_graph.edges)));
|
||||
|
||||
const auto get_level = [](const std::uint32_t lhs, const std::uint32_t rhs) {
|
||||
auto xored = lhs ^ rhs;
|
||||
std::uint32_t level = log(xored) / log(2.0);
|
||||
return level;
|
||||
};
|
||||
|
||||
std::vector<std::vector<util::Coordinate>> border_vertices(33);
|
||||
|
||||
for (NodeID nid = 0; nid < graph.NumberOfNodes(); ++nid)
|
||||
{
|
||||
const auto source_id = bisection_ids[nid];
|
||||
for (const auto &edge : graph.Edges(nid))
|
||||
{
|
||||
const auto target_id = bisection_ids[edge.target];
|
||||
if (source_id != target_id)
|
||||
{
|
||||
auto level = get_level(source_id, target_id);
|
||||
border_vertices[level].push_back(graph.Node(nid).coordinate);
|
||||
border_vertices[level].push_back(graph.Node(edge.target).coordinate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
util::ScopedGeojsonLoggerGuard<util::CoordinateVectorToMultiPoint> guard(
|
||||
"border_vertices.geojson");
|
||||
std::size_t level = 0;
|
||||
for (auto &bv : border_vertices)
|
||||
{
|
||||
if (!bv.empty())
|
||||
{
|
||||
std::sort(bv.begin(), bv.end(), [](const auto lhs, const auto rhs) {
|
||||
return std::tie(lhs.lon, lhs.lat) < std::tie(rhs.lon, rhs.lat);
|
||||
});
|
||||
bv.erase(std::unique(bv.begin(), bv.end()), bv.end());
|
||||
|
||||
util::json::Object jslevel;
|
||||
jslevel.values["level"] = util::json::Number(level++);
|
||||
guard.Write(bv, jslevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto getGraphBisection(const PartitionerConfig &config)
|
||||
{
|
||||
auto compressed_node_based_graph =
|
||||
|
Loading…
Reference in New Issue
Block a user