Skip to content

Commit

Permalink
fix: check for not extracted road files
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWillard committed Mar 23, 2024
1 parent 31a179d commit 2545016
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/geojsons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,19 @@ void writeRoads(

auto prefix = roads_pbo->get_prefix();

bool noRoadFilesExtracted = true;
for (auto& entry : roads_pbo->get_pbo().entries) {
if (boost::istarts_with((((fs::path)static_cast<std::string>(prefix)) / static_cast<std::string>(entry.filename)).string(), roadsPathDir)) {
roads_pbo->extract_single_file(static_cast<std::string>(entry.filename), basePathGeojsonTemp.string(), false);
noRoadFilesExtracted = false;
}
}

if (noRoadFilesExtracted) {
PLOG_ERROR << "Couldn't find or extract any road files. No roads will be exported!";
return;
}

auto gdalPath = getDllPath();
#ifdef _WIN32
// get appdata path
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ void extractMap(const std::string &worldName, const std::string &worldPath, std:
startMsg << "]";

prettyDiagLog(startMsg.str());
PLOG_INFO << startMsg.str();

if (!fs::exists(basePath))
{
Expand Down

0 comments on commit 2545016

Please sign in to comment.