| 320 | } |
| 321 | |
| 322 | bool OpenDriveOutput::insertHeader(const hadmap::txPoint refPoint) { |
| 323 | tinyxml2::XMLElement* _header = doc->NewElement("header"); |
| 324 | _header->SetAttribute("revMajor", "1"); |
| 325 | _header->SetAttribute("revMinor", "4"); |
| 326 | _header->SetAttribute("name", ""); |
| 327 | _header->SetAttribute("version", "1.0"); |
| 328 | time_t now = time(NULL); |
| 329 | tm* tm_t = localtime(&now); |
| 330 | std::stringstream ss; |
| 331 | ss << tm_t->tm_year + 1900 << "-" << tm_t->tm_mon + 1 << "-" << tm_t->tm_mday; |
| 332 | _header->SetAttribute("date", std::string(ss.str()).c_str()); |
| 333 | _header->SetAttribute("north", std::to_string(refPoint.y).c_str()); |
| 334 | _header->SetAttribute("sourth", std::to_string(refPoint.y).c_str()); |
| 335 | _header->SetAttribute("west", std::to_string(refPoint.x).c_str()); |
| 336 | _header->SetAttribute("east", std::to_string(refPoint.x).c_str()); |
| 337 | _header->SetAttribute("vendor", ""); |
| 338 | // _header->InsertNewText("<![CDATA[+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 |
| 339 | // +units=m +nadgrids=@null +wktext +no_defs]]>"); |
| 340 | doc->FirstChildElement("OpenDRIVE")->InsertFirstChild(_header); |
| 341 | return true; |
| 342 | } |
| 343 | |
| 344 | bool OpenDriveOutput::insertRoads(const hadmap::txRoads& roads) { |
| 345 | for (auto it : roads) { |