diff --git a/generator/osm2type.cpp b/generator/osm2type.cpp index 25a843ecf3..cee5142db1 100644 --- a/generator/osm2type.cpp +++ b/generator/osm2type.cpp @@ -1248,7 +1248,7 @@ void GetNameAndType(OsmElement * p, FeatureBuilderParams & params, }}, {"ref", "*", [¶ms](string & k, string & v) { - // Get reference (we process road numbers only). + // Get reference; its used for selected types only, see FeatureBuilder::PreSerialize(). params.ref = std::move(v); }}, {"layer", "*", [¶ms](string & k, string & v) @@ -1334,6 +1334,20 @@ void GetNameAndType(OsmElement * p, FeatureBuilderParams & params, params.SetPostcode(std::move(addrPostcode)); params.SetHouseNumberAndHouseName(std::move(houseNumber), std::move(houseName)); + // Fetch piste:name and piste:ref if there are no other name/ref values. + TagProcessor(p).ApplyRules( + { + {"piste:ref", "*", [¶ms](string & k, string & v) + { + if (params.ref.empty()) + params.ref = std::move(v); + }}, + {"piste:name", "*", [¶ms](string & k, string & v) + { + params.SetDefaultNameIfEmpty(std::move(v)); + }}, + }); + // Stage4: Match tags to classificator feature types via mapcss-mapping.csv. MatchTypes(p, params, filterType);