Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlga Khlopkova <o.khlopkova@corp.mail.ru>2020-10-26 10:12:44 +0300
committerMaksim Andrianov <maksimandrianov1@gmail.com>2020-10-29 10:35:29 +0300
commit127b880343232810df16592ec1d872abbefbb802 (patch)
tree64aa3d5974e0a1b98e770e486cb4a4754fd5fac8 /transit
parent5f8fd1f6f1b633445245b2283a1f5d83508581e3 (diff)
[transit] Changed default feature id for edgeData.
Diffstat (limited to 'transit')
-rw-r--r--transit/experimental/transit_data.cpp2
-rw-r--r--transit/transit_entities.hpp2
-rw-r--r--transit/world_feed/world_feed.cpp10
3 files changed, 8 insertions, 6 deletions
diff --git a/transit/experimental/transit_data.cpp b/transit/experimental/transit_data.cpp
index 8a7525a054..a94c1ae53a 100644
--- a/transit/experimental/transit_data.cpp
+++ b/transit/experimental/transit_data.cpp
@@ -425,7 +425,7 @@ void Read(base::Json const & obj, std::vector<Edge> & edges, EdgeIdToFeatureId &
FromJSONObjectOptionalField(obj.get(), "line_id", lineId);
TransitId featureId = kInvalidFeatureId;
- FromJSONObjectOptionalField(obj.get(), "feature_id", featureId);
+ FromJSONObject(obj.get(), "feature_id", featureId);
if (lineId == 0)
{
diff --git a/transit/transit_entities.hpp b/transit/transit_entities.hpp
index 1e53674f70..58c9d49499 100644
--- a/transit/transit_entities.hpp
+++ b/transit/transit_entities.hpp
@@ -158,7 +158,7 @@ struct EdgeData
// Feature id for cross-mwm transit section. It is used in Segment class as a feature id for
// transit routing case.
- uint32_t m_featureId = 0;
+ uint32_t m_featureId = std::numeric_limits<uint32_t>::max();
};
struct LineSegment
diff --git a/transit/world_feed/world_feed.cpp b/transit/world_feed/world_feed.cpp
index 9370a13f13..8b9de3c060 100644
--- a/transit/world_feed/world_feed.cpp
+++ b/transit/world_feed/world_feed.cpp
@@ -1569,8 +1569,9 @@ void Edges::Write(IdEdgeSet const & ids, std::ofstream & stream) const
ToJSONObject(*node, "stop_id_from", edgeId.m_fromStopId);
ToJSONObject(*node, "stop_id_to", edgeId.m_toStopId);
- if (edge.m_featureId != 0)
- ToJSONObject(*node, "feature_id", edge.m_featureId);
+ CHECK_NOT_EQUAL(edge.m_featureId, std::numeric_limits<uint32_t>::max(),
+ (edgeId.m_lineId, edgeId.m_fromStopId, edgeId.m_toStopId));
+ ToJSONObject(*node, "feature_id", edge.m_featureId);
CHECK_GREATER(edge.m_weight, 0, (edgeId.m_fromStopId, edgeId.m_toStopId, edgeId.m_lineId));
ToJSONObject(*node, "weight", edge.m_weight);
@@ -1592,8 +1593,9 @@ void EdgesTransfer::Write(IdEdgeTransferSet const & ids, std::ofstream & stream)
ToJSONObject(*node, "stop_id_to", edgeTransferId.m_toStopId);
ToJSONObject(*node, "weight", edgeData.m_weight);
- if (edgeData.m_featureId != 0)
- ToJSONObject(*node, "feature_id", edgeData.m_featureId);
+ CHECK_NOT_EQUAL(edgeData.m_featureId, std::numeric_limits<uint32_t>::max(),
+ (edgeTransferId.m_fromStopId, edgeTransferId.m_toStopId));
+ ToJSONObject(*node, "feature_id", edgeData.m_featureId);
WriteJson(node.get(), stream);
}