Split QueryNode into coordinates and osm id
This commit is contained in:
committed by
Patrick Niklaus
parent
786a3d8919
commit
7f6e0c478b
+8
-17
@@ -1,7 +1,6 @@
|
||||
#include "storage/storage.hpp"
|
||||
|
||||
#include "storage/io.hpp"
|
||||
#include "storage/serialization.hpp"
|
||||
#include "storage/shared_datatype.hpp"
|
||||
#include "storage/shared_memory.hpp"
|
||||
#include "storage/shared_memory_ownership.hpp"
|
||||
@@ -64,8 +63,7 @@ namespace storage
|
||||
{
|
||||
|
||||
using RTreeLeaf = engine::datafacade::BaseDataFacade::RTreeLeaf;
|
||||
using RTreeNode = util::
|
||||
StaticRTree<RTreeLeaf, util::vector_view<util::Coordinate>, storage::Ownership::View>::TreeNode;
|
||||
using RTreeNode = util:: StaticRTree<RTreeLeaf, storage::Ownership::View>::TreeNode;
|
||||
using QueryGraph = util::StaticGraph<contractor::QueryEdge::EdgeData>;
|
||||
using EdgeBasedGraph = util::StaticGraph<extractor::EdgeBasedEdge::EdgeData>;
|
||||
|
||||
@@ -281,9 +279,7 @@ void Storage::PopulateLayout(DataLayout &layout)
|
||||
}
|
||||
|
||||
{
|
||||
// allocate space in shared memory for profile properties
|
||||
const auto properties_size = serialization::readPropertiesCount();
|
||||
layout.SetBlockSize<extractor::ProfileProperties>(DataLayout::PROPERTIES, properties_size);
|
||||
layout.SetBlockSize<extractor::ProfileProperties>(DataLayout::PROPERTIES, 1);
|
||||
}
|
||||
|
||||
// read timestampsize
|
||||
@@ -323,14 +319,14 @@ void Storage::PopulateLayout(DataLayout &layout)
|
||||
|
||||
// load coordinate size
|
||||
{
|
||||
io::FileReader node_file(config.nodes_data_path, io::FileReader::HasNoFingerprint);
|
||||
io::FileReader node_file(config.nodes_data_path, io::FileReader::VerifyFingerprint);
|
||||
const auto coordinate_list_size = node_file.ReadElementCount64();
|
||||
layout.SetBlockSize<util::Coordinate>(DataLayout::COORDINATE_LIST, coordinate_list_size);
|
||||
// we'll read a list of OSM node IDs from the same data, so set the block size for the same
|
||||
// number of items:
|
||||
layout.SetBlockSize<std::uint64_t>(
|
||||
DataLayout::OSM_NODE_ID_LIST,
|
||||
util::PackedVector<OSMNodeID>::elements_to_blocks(coordinate_list_size));
|
||||
util::PackedVectorView<OSMNodeID>::elements_to_blocks(coordinate_list_size));
|
||||
}
|
||||
|
||||
// load geometries sizes
|
||||
@@ -690,20 +686,15 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
|
||||
|
||||
// Loading list of coordinates
|
||||
{
|
||||
io::FileReader nodes_file(config.nodes_data_path, io::FileReader::HasNoFingerprint);
|
||||
nodes_file.Skip<std::uint64_t>(1); // node_count
|
||||
const auto coordinates_ptr =
|
||||
layout.GetBlockPtr<util::Coordinate, true>(memory_ptr, DataLayout::COORDINATE_LIST);
|
||||
const auto osmnodeid_ptr =
|
||||
layout.GetBlockPtr<std::uint64_t, true>(memory_ptr, DataLayout::OSM_NODE_ID_LIST);
|
||||
util::PackedVector<OSMNodeID, storage::Ownership::View> osmnodeid_list;
|
||||
util::vector_view<util::Coordinate> coordinates(coordinates_ptr, layout.num_entries[DataLayout::COORDINATE_LIST]);
|
||||
util::PackedVectorView<OSMNodeID> osm_node_ids;
|
||||
osm_node_ids.reset(osmnodeid_ptr, layout.num_entries[DataLayout::OSM_NODE_ID_LIST]);
|
||||
|
||||
osmnodeid_list.reset(osmnodeid_ptr, layout.num_entries[DataLayout::OSM_NODE_ID_LIST]);
|
||||
|
||||
serialization::readNodes(nodes_file,
|
||||
coordinates_ptr,
|
||||
osmnodeid_list,
|
||||
layout.num_entries[DataLayout::COORDINATE_LIST]);
|
||||
extractor::files::readNodes<storage::Ownership::View>(config.nodes_data_path, coordinates, osm_node_ids);
|
||||
}
|
||||
|
||||
// load turn weight penalties
|
||||
|
||||
Reference in New Issue
Block a user