mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
WIP: [traffic] Implement basic TraFF parsing, currently from hardcoded path
Not feature complete, produces incorrect results for some test cases Some parts of the implementation are not very elegant yet Inefficient as the whole set of messages is parsed on update Lots of verbose debug logging Lots of dead code from old traffic module (#ifdef traffic_dead_code) Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -462,9 +462,14 @@ bool LocationFromXml(pugi::xml_node node, TraffLocation & location)
|
||||
location.m_via = OptionalPointFromXml(node.child("via"));
|
||||
location.m_notVia = OptionalPointFromXml(node.child("not_via"));
|
||||
|
||||
if (!location.m_from && !location.m_to && !location.m_at)
|
||||
int numPoints = 0;
|
||||
for (std::optional<Point> point : {location.m_from, location.m_to, location.m_at})
|
||||
if (point)
|
||||
numPoints++;
|
||||
// single-point locations are not supported, locations without points are not valid
|
||||
if (numPoints < 2)
|
||||
{
|
||||
LOG(LWARNING, ("Neither from, to nor at point is specified, ignoring location"));
|
||||
LOG(LWARNING, ("Only", numPoints, "points of from/to/at specified, ignoring location"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user