Skip to content

Commit

Permalink
Fixed a bug when extracting data from a file with cut streets (with m…
Browse files Browse the repository at this point in the history
…issing nodes).
  • Loading branch information
jordanmarkov committed Oct 2, 2015
1 parent 8f8bd05 commit 4d29573
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions extractor/extraction_containers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,16 @@ void ExtractionContainers::PrepareEdges(lua_State *segment_state)
edge_iterator->source_coordinate.lon = node_iterator->lon;
++edge_iterator;
}

// Fixed: all edges left after the loop are invalid
// This happens when smaller area is cut through the streets with
// osmosis.
while (edge_iterator != all_edges_list_end)
{
SimpleLogger().Write(LogLevel::logWARNING) << "Found invalid node reference " << edge_iterator->result.source;
edge_iterator->result.source = SPECIAL_NODEID;
++edge_iterator;
}
TIMER_STOP(set_start_coords);
std::cout << "ok, after " << TIMER_SEC(set_start_coords) << "s" << std::endl;

Expand Down Expand Up @@ -347,6 +357,16 @@ void ExtractionContainers::PrepareEdges(lua_State *segment_state)
}
++edge_iterator;
}

// Fixed: all edges left after the loop are invalid
// This happens when smaller area is cut through the streets with
// osmosis
while (edge_iterator != all_edges_list_end_)
{
SimpleLogger().Write(LogLevel::logWARNING) << "Found invalid node reference " << edge_iterator->result.source;
edge_iterator->result.target = SPECIAL_NODEID;
++edge_iterator;
}
TIMER_STOP(compute_weights);
std::cout << "ok, after " << TIMER_SEC(compute_weights) << "s" << std::endl;

Expand Down

0 comments on commit 4d29573

Please sign in to comment.