Empty CSV entries (nodeA,nodeA) can be treated as non-fatal as long as we don't try to update any matching artificial segments.
This commit is contained in:
parent
6bae070091
commit
c1ad275e71
@ -44,8 +44,8 @@ SegmentLookupTable readSegmentValues(const std::vector<std::string> &paths)
|
|||||||
});
|
});
|
||||||
if (found_inconsistency != std::end(result.lookup))
|
if (found_inconsistency != std::end(result.lookup))
|
||||||
{
|
{
|
||||||
throw util::exception("empty segment in CSV with node " +
|
util::Log(logWARNING) << "Empty segment in CSV with node " +
|
||||||
std::to_string(found_inconsistency->first.from) + " " + SOURCE_REF);
|
std::to_string(found_inconsistency->first.from);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -221,6 +221,12 @@ updateSegmentData(const UpdaterConfig &config,
|
|||||||
{
|
{
|
||||||
auto u = osm_node_ids[nodes_range[segment_offset]];
|
auto u = osm_node_ids[nodes_range[segment_offset]];
|
||||||
auto v = osm_node_ids[nodes_range[segment_offset + 1]];
|
auto v = osm_node_ids[nodes_range[segment_offset + 1]];
|
||||||
|
|
||||||
|
// Self-loops are artifical segments (e.g. traffic light nodes), do not
|
||||||
|
// waste time updating them with traffic data
|
||||||
|
if (u == v)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (auto value = segment_speed_lookup({u, v}))
|
if (auto value = segment_speed_lookup({u, v}))
|
||||||
{
|
{
|
||||||
auto segment_length = segment_lengths[segment_offset];
|
auto segment_length = segment_lengths[segment_offset];
|
||||||
@ -254,6 +260,12 @@ updateSegmentData(const UpdaterConfig &config,
|
|||||||
{
|
{
|
||||||
auto u = osm_node_ids[nodes_range[segment_offset]];
|
auto u = osm_node_ids[nodes_range[segment_offset]];
|
||||||
auto v = osm_node_ids[nodes_range[segment_offset + 1]];
|
auto v = osm_node_ids[nodes_range[segment_offset + 1]];
|
||||||
|
|
||||||
|
// Self-loops are artifical segments (e.g. traffic light nodes), do not
|
||||||
|
// waste time updating them with traffic data
|
||||||
|
if (u == v)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (auto value = segment_speed_lookup({v, u}))
|
if (auto value = segment_speed_lookup({v, u}))
|
||||||
{
|
{
|
||||||
auto segment_length = segment_lengths[segment_offset];
|
auto segment_length = segment_lengths[segment_offset];
|
||||||
|
Loading…
Reference in New Issue
Block a user