Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions include/extractor/extraction_segment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ struct ExtractionSegment
double distance_,
double weight_,
double duration_,
const NodeBasedEdgeClassification flags_)
const NodeBasedEdgeClassification flags_,
const OSMNodeID osm_source_id_,
const OSMNodeID osm_target_id_)
: source(source_), target(target_), distance(distance_), weight(weight_),
duration(duration_), flags(flags_)
duration(duration_), flags(flags_), osm_source_id(osm_source_id_),
osm_target_id(osm_target_id_)
{
}

Expand All @@ -26,6 +29,8 @@ struct ExtractionSegment
double weight;
double duration;
const NodeBasedEdgeClassification flags;
const OSMNodeID osm_source_id;
const OSMNodeID osm_target_id;
};
} // namespace osrm::extractor

Expand Down
4 changes: 3 additions & 1 deletion src/extractor/extraction_containers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,9 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm
distance,
weight,
duration,
edge_iterator->result.flags);
edge_iterator->result.flags,
edge_iterator->result.osm_source_id,
node_iterator->node_id);
scripting_environment.ProcessSegment(segment);

auto &edge = edge_iterator->result;
Expand Down
6 changes: 5 additions & 1 deletion src/extractor/scripting_environment_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,11 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
"duration",
&ExtractionSegment::duration,
"flags",
&ExtractionSegment::flags);
&ExtractionSegment::flags,
"osm_source_id",
&ExtractionSegment::osm_source_id,
"osm_target_id",
&ExtractionSegment::osm_target_id);

// Keep in mind .location is available only if .pbf is preprocessed to set the location with the
// ref using osmium command "osmium add-locations-to-ways"
Expand Down
Loading