diff options
Diffstat (limited to 'transit')
-rw-r--r-- | transit/transit_schedule.cpp | 6 | ||||
-rw-r--r-- | transit/world_feed/world_feed.cpp | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/transit/transit_schedule.cpp b/transit/transit_schedule.cpp index 37e581627b..a0c26bc4cf 100644 --- a/transit/transit_schedule.cpp +++ b/transit/transit_schedule.cpp @@ -277,8 +277,10 @@ FrequencyIntervals::FrequencyIntervals(gtfs::Frequencies const & frequencies) { for (auto const & freq : frequencies) { - CHECK_GREATER(freq.headway_secs, 0, ()); - m_intervals.emplace(TimeInterval(freq.start_time, freq.end_time), freq.headway_secs); + if (freq.headway_secs > 0) + m_intervals.emplace(TimeInterval(freq.start_time, freq.end_time), freq.headway_secs); + else + LOG(LINFO, ("Bad headway_secs:", freq.headway_secs)); } } diff --git a/transit/world_feed/world_feed.cpp b/transit/world_feed/world_feed.cpp index 9a1b956087..3c655d15a2 100644 --- a/transit/world_feed/world_feed.cpp +++ b/transit/world_feed/world_feed.cpp @@ -475,7 +475,11 @@ bool WorldFeed::FillRoutes() continue; auto const itAgencyHash = m_gtfsIdToHash[FieldIdx::AgencyIdx].find(route.agency_id); - CHECK(itAgencyHash != m_gtfsIdToHash[FieldIdx::AgencyIdx].end(), (route.agency_id)); + if (itAgencyHash == m_gtfsIdToHash[FieldIdx::AgencyIdx].end()) + { + LOG(LINFO, ("Unknown agency", route.agency_id)); + continue; + } auto const & agencyHash = itAgencyHash->second; CHECK(!agencyHash.empty(), ("Empty hash for agency id:", route.agency_id)); @@ -927,7 +931,7 @@ std::optional<Direction> WorldFeed::ProjectStopsToShape( CHECK(itStop != m_stops.m_data.end(), (stopId)); auto const & stop = itStop->second; - size_t const prevIdx = i == 0 ? (direction == Direction::Forward ? 0 : shape.size()) + size_t const prevIdx = i == 0 ? (direction == Direction::Forward ? 0 : shape.size() - 1) : stopsToIndexes[stopIds[i - 1]].back(); auto const [curIdx, pointInserted] = PrepareNearestPointOnTrack(stop.m_point, prevPoint, prevIdx, direction, shape); @@ -1932,12 +1936,13 @@ void WorldFeed::SplitLinesBasedData() auto const edgeFirst = m_edges.m_data.at( EdgeId(lineData.m_stopIds[firstStopIdx], lineData.m_stopIds[firstStopIdx + 1], lineId)); - CHECK(!(edgeFirst.m_shapeLink.m_startIndex == 0 && edgeFirst.m_shapeLink.m_endIndex == 0), - ()); + if (edgeFirst.m_shapeLink.m_startIndex == 0 && edgeFirst.m_shapeLink.m_endIndex == 0) + continue; auto const edgeLast = m_edges.m_data.at( EdgeId(lineData.m_stopIds[lastStopIdx - 1], lineData.m_stopIds[lastStopIdx], lineId)); - CHECK(!(edgeLast.m_shapeLink.m_startIndex == 0 && edgeLast.m_shapeLink.m_endIndex == 0), ()); + if (edgeLast.m_shapeLink.m_startIndex == 0 && edgeLast.m_shapeLink.m_endIndex == 0) + continue; lineInRegion.m_shapeLink.m_startIndex = std::min(edgeFirst.m_shapeLink.m_startIndex, edgeLast.m_shapeLink.m_endIndex); |