[traffic] Calculate filter list for active MWMs

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-05-17 17:31:21 +03:00
parent e3f5dd3ca8
commit a7897e2347
5 changed files with 72 additions and 3 deletions

View File

@@ -643,4 +643,16 @@ bool ParseTraff(pugi::xml_document const & document, TraffFeed & feed)
}
return result;
}
std::string FiltersToXml(std::vector<m2::RectD> & bboxRects)
{
std::ostringstream os;
for (auto rect : bboxRects)
os << std::format("<filter bbox=\"{} {} {} {}\"/>\n",
mercator::YToLat(rect.minY()),
mercator::XToLon(rect.minX()),
mercator::YToLat(rect.maxY()),
mercator::XToLon(rect.maxX()));
return os.str();
}
} // namespace openlr