[generator] Don't store sidewalk names

177kb saving in greater london

Signed-off-by: Harry Bond <me@hbond.xyz>
This commit is contained in:
Harry Bond 2024-08-12 19:34:59 +01:00
parent d24eb11dad
commit 66d1b17517
2 changed files with 23 additions and 0 deletions

View file

@ -1458,6 +1458,22 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_OldName)
}
}
UNIT_CLASS_TEST(TestWithClassificator, OsmType_NoName)
{
{
Tags const tags = {
{"highway", "footway"},
{"footway", "sidewalk"},
{"name", "Testing Street"},
{"name:de", "Teststraße"},
};
auto const params = GetFeatureBuilderParams(tags);
TEST(params.name.IsEmpty(), ("Sidewalk names are queried at runtime, they shouldn't be in map data"));
}
}
UNIT_CLASS_TEST(TestWithClassificator, OsmType_AltName)
{
{

View file

@ -1483,6 +1483,13 @@ void GetNameAndType(OsmElement * p, FeatureBuilderParams & params,
// Stage4: Match tags to classificator feature types via mapcss-mapping.csv.
MatchTypes(p, params, filterType);
// Sidewalk names are queried at runtime, they shouldn't be in map data
if (params.IsTypeExist(classif().GetTypeByPath({"highway","footway","sidewalk"})))
{
params.ClearName();
}
//TODO: road names seem to be re-added in MatchTypes??
// Stage5: Postprocess feature types.
PostprocessElement(p, params);