26 {
27 const tinyxml2::XMLElement* junction_node =
28 xml_node.FirstChildElement("junction");
29 while (junction_node) {
30
31 std::string junction_id;
32 int checker =
34 if (checker != tinyxml2::XML_SUCCESS) {
35 std::string err_msg = "Error parse junction id";
37 }
38
39
40 const tinyxml2::XMLElement* sub_node =
41 junction_node->FirstChildElement("outline");
42 if (!sub_node) {
43 std::string err_msg = "Error parse junction outline";
45 }
46
48 junction.mutable_id()->set_id(junction_id);
49 PbPolygon* polygon = junction.mutable_polygon();
51
52 JunctionInternal junction_internal;
53 junction_internal.junction = junction;
54
55
56 sub_node = junction_node->FirstChildElement("objectOverlapGroup");
57 if (sub_node) {
58 sub_node = sub_node->FirstChildElement("objectReference");
59 while (sub_node) {
60 std::string object_id;
61 checker =
63 if (checker != tinyxml2::XML_SUCCESS) {
64 std::string err_msg = "Error parse junction overlap id";
66 }
67
68 OverlapWithJunction overlap_with_juntion;
69 overlap_with_juntion.object_id = object_id;
70 junction_internal.overlap_with_junctions.push_back(
71 overlap_with_juntion);
72
73 sub_node = sub_node->NextSiblingElement("objectReference");
74 }
75 }
76
77 junctions->push_back(junction_internal);
78 junction_node = junction_node->NextSiblingElement("junction");
79 }
81}
static Status OK()
generate a success status.
static tinyxml2::XMLError QueryStringAttribute(const tinyxml2::XMLElement &xml_node, const std::string &name, std::string *value)
static Status ParseOutline(const tinyxml2::XMLElement &xml_node, PbPolygon *polygon)
#define RETURN_IF_ERROR(expr)
apollo::hdmap::Junction PbJunction
apollo::hdmap::Polygon PbPolygon