[generator] Fixed possible bug in MaxspeedsMwmCollector.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako 2022-03-07 22:34:46 +01:00 committed by Konstantin Pastbin
parent 87949cdb8e
commit d9de3eee6e
2 changed files with 7 additions and 0 deletions

View file

@ -165,6 +165,12 @@ public:
auto const osmID = GetOsmID(fid).GetSerialId();
if (ft.GetGeomType() != GeomType::Line)
{
LOG(LWARNING, ("Non linear road with speed for way", osmID));
return;
}
#define LOG_MAX_SPEED(msg) if (false) LOG(LINFO, msg)
LOG_MAX_SPEED(("Start osmid =", osmID));

View file

@ -157,6 +157,7 @@ void RoadGeometry::Load(VehicleModelInterface const & vehicleModel, FeatureType
geometry::Altitudes const * altitudes, RoadAttrsGetter & attrs)
{
size_t const count = feature.GetPointsCount();
CHECK_GREATER(count, 1, ());
CHECK(altitudes == nullptr || altitudes->size() == count, ());
feature::TypesHolder types(feature);