|
24 | 24 | #include <osmium/osm/types.hpp>
|
25 | 25 |
|
26 | 26 | #include <algorithm>
|
27 |
| -#include <format> |
28 | 27 | #include <iterator>
|
29 | 28 |
|
30 | 29 | namespace osrm::extractor::area
|
@@ -62,8 +61,9 @@ void copy_tags(osmium::builder::Builder &parent, const osmium::TagList &tags)
|
62 | 61 | */
|
63 | 62 | std::string area_id(const osmium::Area &area)
|
64 | 63 | {
|
65 |
| - char type = area.id() % 2 == 1 ? 'r' : 'w'; |
66 |
| - return std::format("{}{}", type, area.orig_id()); |
| 64 | + std::stringstream strstream; |
| 65 | + strstream << (area.id() % 2 == 1 ? "r" : "w") << area.orig_id(); |
| 66 | + return strstream.str(); |
67 | 67 | }
|
68 | 68 |
|
69 | 69 | } // namespace
|
@@ -302,11 +302,12 @@ void AreaMesher::mesh_area(const osmium::Area &area,
|
302 | 302 | out_buffer.commit();
|
303 | 303 | };
|
304 | 304 |
|
305 |
| - const auto write_debug = [&](const char *filename, const std::set<OsmiumSegment> &segments) |
| 305 | + const auto write_debug = [&](const char *basename, const std::set<OsmiumSegment> &segments) |
306 | 306 | {
|
307 | 307 | // write debug file
|
308 |
| - std::filesystem::path path = std::filesystem::temp_directory_path() / |
309 |
| - std::format("{}-{}.osm", filename, area_id(area)); |
| 308 | + std::stringstream strstream; |
| 309 | + strstream << basename << "-" << area_id(area) << ".osm"; |
| 310 | + std::filesystem::path path = std::filesystem::temp_directory_path() / strstream.str(); |
310 | 311 | osmium::io::Writer writer(path, osmium::io::overwrite::allow);
|
311 | 312 | osmium::memory::Buffer debug_buffer{16 * 1024};
|
312 | 313 | add_to_buffer(segments, debug_buffer);
|
|
0 commit comments