| 131 | } |
| 132 | |
| 133 | bool JsonParser::parseBoundary(const std::string& jsonStr, txLaneBoundaries& boundaries) { |
| 134 | neb::CJsonObject jP; |
| 135 | jP.Parse(jsonStr); |
| 136 | |
| 137 | neb::CJsonObject& jBoundaries = jP["boundary"]; |
| 138 | size_t boundarySize = jBoundaries.GetArraySize(); |
| 139 | for (size_t i = 0; i < boundarySize; ++i) { |
| 140 | std::string id; |
| 141 | jBoundaries[i].Get("id", id); |
| 142 | laneboundarypkid boundaryId = laneboundarypkid(std::stoll(id)); |
| 143 | |
| 144 | uint32_t mrk; |
| 145 | jBoundaries[i].Get("mark", mrk); |
| 146 | |
| 147 | neb::CJsonObject& geoms = jBoundaries[i]["geom"]; |
| 148 | PointVec curve; |
| 149 | size_t geomSize = geoms.GetArraySize(); |
| 150 | for (size_t j = 0; j < geomSize; ++j) { |
| 151 | txPoint p; |
| 152 | geoms[j].Get("x", p.x); |
| 153 | geoms[j].Get("y", p.y); |
| 154 | geoms[j].Get("z", p.z); |
| 155 | curve.push_back(p); |
| 156 | } |
| 157 | |
| 158 | txLaneBoundaryPtr boundaryPtr(new txLaneBoundary); |
| 159 | boundaryPtr->setId(boundaryId).setLaneMark(LANE_MARK(mrk)).setGeometry(curve, COORD_WGS84); |
| 160 | |
| 161 | boundaries.push_back(boundaryPtr); |
| 162 | } |
| 163 | return true; |
| 164 | } |
| 165 | |
| 166 | bool JsonParser::parseLink(const std::string& jsonStr, txLaneLinks& links) { |
| 167 | neb::CJsonObject jP; |