Reintroduce location for NodeRef in luabinding

This commit is contained in:
FILLAU Jean-Maxime 2017-07-26 15:57:33 +02:00 committed by Daniel J. H
parent a8db269fd5
commit a420169109

View File

@ -396,8 +396,12 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
"target_restricted", "target_restricted",
&ExtractionTurn::target_restricted); &ExtractionTurn::target_restricted);
// Keep in mind .location is undefined since we're not using libosmium's location cache // Keep in mind .location is available only if .pbf is preprocessed to set the location with the
context.state.new_usertype<osmium::NodeRef>("NodeRef", "id", &osmium::NodeRef::ref); // ref using osmium command "osmium add-locations-to-ways"
context.state.new_usertype<osmium::NodeRef>(
"NodeRef", "id", &osmium::NodeRef::ref, "location", [](const osmium::NodeRef &nref) {
return nref.location();
});
context.state.new_usertype<InternalExtractorEdge>("EdgeSource", context.state.new_usertype<InternalExtractorEdge>("EdgeSource",
"source_coordinate", "source_coordinate",