| 423 | } |
| 424 | |
| 425 | void MatchTypes(OsmElement * p, FeatureBuilderParams & params, TypesFilterFnT const & filterType) |
| 426 | { |
| 427 | auto static const rules = generator::ParseMapCSS(GetPlatform().GetReader(MAPCSS_MAPPING_FILE)); |
| 428 | |
| 429 | std::vector<generator::TypeStrings> matchedTypes; |
| 430 | for (auto const & [typeString, rule] : rules) |
| 431 | if (rule.Matches(p->m_tags)) |
| 432 | matchedTypes.push_back(typeString); |
| 433 | |
| 434 | LeaveLongestTypes(matchedTypes); |
| 435 | |
| 436 | auto const & cl = classif(); |
| 437 | |
| 438 | bool buswayAdded = false; |
| 439 | for (size_t i = 0; i < matchedTypes.size(); ++i) |
| 440 | { |
| 441 | auto const & path = matchedTypes[i]; |
| 442 | uint32_t const type = cl.GetTypeByPath(path); |
| 443 | if (!filterType(type)) |
| 444 | continue; |
| 445 | |
| 446 | // "busway" and "service" can be matched together, keep busway only. |
| 447 | if (path[0] == "highway") |
| 448 | { |
| 449 | // busway goes before service, see LeaveLongestTypes.isBetter |
| 450 | if (path[1] == "busway") |
| 451 | buswayAdded = true; |
| 452 | else if (buswayAdded && path[1] == "service") |
| 453 | continue; |
| 454 | } |
| 455 | |
| 456 | params.AddType(type); |
| 457 | } |
| 458 | } |
| 459 | |
| 460 | string MatchCity(ms::LatLon const & ll) |
| 461 | { |
no test coverage detected