mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
Added maxspeed OSM related warnings.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
c2c68c4a76
commit
4f6455d6f8
@@ -87,10 +87,14 @@ class MaxspeedsMwmCollector
|
|||||||
return m_graph->GetRoadGeometry(fid);
|
return m_graph->GetRoadGeometry(fid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OSM data related warning tag for convenient grep.
|
||||||
|
std::string m_logTag;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MaxspeedsMwmCollector(string const & dataPath, FeatureIdToOsmId const & ft2osm, IndexGraph * graph)
|
MaxspeedsMwmCollector(string const & dataPath, FeatureIdToOsmId const & ft2osm, IndexGraph * graph)
|
||||||
: m_dataPath(dataPath), m_ft2osm(ft2osm), m_graph(graph)
|
: m_dataPath(dataPath), m_ft2osm(ft2osm), m_graph(graph)
|
||||||
, m_converter(MaxspeedConverter::Instance())
|
, m_converter(MaxspeedConverter::Instance())
|
||||||
|
, m_logTag("SpeedsBuilder")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,6 +271,13 @@ public:
|
|||||||
|
|
||||||
void AddSpeed(uint32_t featureID, uint64_t osmID, Maxspeed const & speed)
|
void AddSpeed(uint32_t featureID, uint64_t osmID, Maxspeed const & speed)
|
||||||
{
|
{
|
||||||
|
MaxspeedType constexpr kMaxReasonableSpeed = 280;
|
||||||
|
if ((speed.GetSpeedKmPH(true) >= kMaxReasonableSpeed) ||
|
||||||
|
(speed.IsBidirectional() && speed.GetSpeedKmPH(false) >= kMaxReasonableSpeed))
|
||||||
|
{
|
||||||
|
LOG(LWARNING, (m_logTag, "Very big speed", speed, "for way", osmID));
|
||||||
|
}
|
||||||
|
|
||||||
// Add converted macro speed.
|
// Add converted macro speed.
|
||||||
SpeedInUnits const forward(speed.GetForward(), speed.GetUnits());
|
SpeedInUnits const forward(speed.GetForward(), speed.GetUnits());
|
||||||
CHECK(forward.IsValid(), ());
|
CHECK(forward.IsValid(), ());
|
||||||
@@ -278,12 +289,12 @@ public:
|
|||||||
|
|
||||||
if (ftSpeed.m_forward == SpeedMacro::Undefined)
|
if (ftSpeed.m_forward == SpeedMacro::Undefined)
|
||||||
{
|
{
|
||||||
LOG(LWARNING, ("Undefined forward speed macro", forward, "for way", osmID));
|
LOG(LWARNING, (m_logTag, "Undefined forward speed macro", forward, "for way", osmID));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (backward.IsValid() && backwardMacro == SpeedMacro::Undefined)
|
if (backward.IsValid() && backwardMacro == SpeedMacro::Undefined)
|
||||||
{
|
{
|
||||||
LOG(LWARNING, ("Undefined backward speed macro", backward, "for way", osmID));
|
LOG(LWARNING, (m_logTag, "Undefined backward speed macro", backward, "for way", osmID));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_maxspeeds.push_back(ftSpeed);
|
m_maxspeeds.push_back(ftSpeed);
|
||||||
@@ -311,7 +322,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LOG(LWARNING, ("Undefined HighwayType for way", osmID));
|
LOG(LWARNING, (m_logTag, "Undefined HighwayType for way", osmID));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SerializeMaxspeeds() const
|
void SerializeMaxspeeds() const
|
||||||
|
|||||||
Reference in New Issue
Block a user