Store and pass segregated flag to the data facade.
This commit is contained in:
parent
ee7912f882
commit
ac5e095d17
@ -885,6 +885,11 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
|||||||
// TODO: can be moved to a data block indexed by GeometryID
|
// TODO: can be moved to a data block indexed by GeometryID
|
||||||
return edge_based_node_data.IsLeftHandDriving(id);
|
return edge_based_node_data.IsLeftHandDriving(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsSegregated(const NodeID id) const override final
|
||||||
|
{
|
||||||
|
return edge_based_node_data.IsSegregated(id);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename AlgorithmT> class ContiguousInternalMemoryDataFacade;
|
template <typename AlgorithmT> class ContiguousInternalMemoryDataFacade;
|
||||||
|
@ -13,6 +13,7 @@ struct EdgeBasedNode
|
|||||||
GeometryID geometry_id;
|
GeometryID geometry_id;
|
||||||
ComponentID component_id;
|
ComponentID component_id;
|
||||||
AnnotationID annotation_id;
|
AnnotationID annotation_id;
|
||||||
|
bool segregated;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
|
@ -77,6 +77,8 @@ template <storage::Ownership Ownership> class EdgeBasedNodeDataContainerImpl
|
|||||||
return annotation_data[nodes[node_id].annotation_id].is_left_hand_driving;
|
return annotation_data[nodes[node_id].annotation_id].is_left_hand_driving;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsSegregated(const NodeID node_id) const { return nodes[node_id].segregated; }
|
||||||
|
|
||||||
NameID GetNameID(const NodeID node_id) const
|
NameID GetNameID(const NodeID node_id) const
|
||||||
{
|
{
|
||||||
return annotation_data[nodes[node_id].annotation_id].name_id;
|
return annotation_data[nodes[node_id].annotation_id].name_id;
|
||||||
@ -105,13 +107,8 @@ template <storage::Ownership Ownership> class EdgeBasedNodeDataContainerImpl
|
|||||||
// between a large set of nodes
|
// between a large set of nodes
|
||||||
AnnotationID NumberOfAnnotations() const { return annotation_data.size(); }
|
AnnotationID NumberOfAnnotations() const { return annotation_data.size(); }
|
||||||
|
|
||||||
EdgeBasedNode &GetNode(const NodeID node_id) { return nodes[node_id]; }
|
|
||||||
EdgeBasedNode const &GetNode(const NodeID node_id) const { return nodes[node_id]; }
|
EdgeBasedNode const &GetNode(const NodeID node_id) const { return nodes[node_id]; }
|
||||||
|
|
||||||
NodeBasedEdgeAnnotation &GetAnnotation(const AnnotationID annotation)
|
|
||||||
{
|
|
||||||
return annotation_data[annotation];
|
|
||||||
}
|
|
||||||
NodeBasedEdgeAnnotation const &GetAnnotation(const AnnotationID annotation) const
|
NodeBasedEdgeAnnotation const &GetAnnotation(const AnnotationID annotation) const
|
||||||
{
|
{
|
||||||
return annotation_data[annotation];
|
return annotation_data[annotation];
|
||||||
|
@ -164,13 +164,19 @@ NBGToEBG EdgeBasedGraphFactory::InsertEdgeBasedNode(const NodeID node_u, const N
|
|||||||
forward_data.geometry_id;
|
forward_data.geometry_id;
|
||||||
m_edge_based_node_container.nodes[nbe_to_ebn_mapping[edge_id_1]].annotation_id =
|
m_edge_based_node_container.nodes[nbe_to_ebn_mapping[edge_id_1]].annotation_id =
|
||||||
forward_data.annotation_data;
|
forward_data.annotation_data;
|
||||||
|
m_edge_based_node_container.nodes[nbe_to_ebn_mapping[edge_id_1]].segregated =
|
||||||
|
forward_data.segregated;
|
||||||
|
|
||||||
if (nbe_to_ebn_mapping[edge_id_2] != SPECIAL_EDGEID)
|
if (nbe_to_ebn_mapping[edge_id_2] != SPECIAL_EDGEID)
|
||||||
{
|
{
|
||||||
m_edge_based_node_container.nodes[nbe_to_ebn_mapping[edge_id_2]].geometry_id =
|
m_edge_based_node_container.nodes[nbe_to_ebn_mapping[edge_id_2]].geometry_id =
|
||||||
reverse_data.geometry_id;
|
reverse_data.geometry_id;
|
||||||
m_edge_based_node_container.nodes[nbe_to_ebn_mapping[edge_id_2]].annotation_id =
|
m_edge_based_node_container.nodes[nbe_to_ebn_mapping[edge_id_2]].annotation_id =
|
||||||
reverse_data.annotation_data;
|
reverse_data.annotation_data;
|
||||||
|
m_edge_based_node_container.nodes[nbe_to_ebn_mapping[edge_id_2]].segregated =
|
||||||
|
reverse_data.segregated;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add segments of edge-based nodes
|
// Add segments of edge-based nodes
|
||||||
for (const auto i : util::irange(std::size_t{0}, segment_count))
|
for (const auto i : util::irange(std::size_t{0}, segment_count))
|
||||||
{
|
{
|
||||||
@ -365,6 +371,7 @@ EdgeBasedGraphFactory::GenerateEdgeExpandedNodes(const WayRestrictionMap &way_re
|
|||||||
edge_data.geometry_id;
|
edge_data.geometry_id;
|
||||||
m_edge_based_node_container.nodes[edge_based_node_id].annotation_id =
|
m_edge_based_node_container.nodes[edge_based_node_id].annotation_id =
|
||||||
edge_data.annotation_data;
|
edge_data.annotation_data;
|
||||||
|
m_edge_based_node_container.nodes[edge_based_node_id].segregated = edge_data.segregated;
|
||||||
|
|
||||||
m_edge_based_node_weights.push_back(m_edge_based_node_weights[eid]);
|
m_edge_based_node_weights.push_back(m_edge_based_node_weights[eid]);
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ exports.three_test_coordinates = [[7.41337, 43.72956],
|
|||||||
|
|
||||||
exports.two_test_coordinates = exports.three_test_coordinates.slice(0, 2)
|
exports.two_test_coordinates = exports.three_test_coordinates.slice(0, 2)
|
||||||
|
|
||||||
exports.test_tile = {'at': [17059, 11948, 15], 'size': 167159};
|
exports.test_tile = {'at': [17059, 11948, 15], 'size': 167254};
|
||||||
|
|
||||||
|
|
||||||
// Test files generated by the routing engine; check test/data
|
// Test files generated by the routing engine; check test/data
|
||||||
|
Loading…
Reference in New Issue
Block a user