summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-10-02 10:12:26 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-10-02 10:12:26 (GMT)
commit7360d426783a5f9d581593717afd937e563ee8ad (patch)
treedff8e32cab39a46de208e8e4d8dff2852243ac04
parent6bf2fd045fec880cfd4aa989135da2cce7a98059 (diff)
Extract landmass file if needed
-rw-r--r--tools/vectorosm-tilecreator/TileDirectory.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/vectorosm-tilecreator/TileDirectory.cpp b/tools/vectorosm-tilecreator/TileDirectory.cpp
index 2f7a044..aad3917 100644
--- a/tools/vectorosm-tilecreator/TileDirectory.cpp
+++ b/tools/vectorosm-tilecreator/TileDirectory.cpp
@@ -45,12 +45,15 @@ TileDirectory::TileDirectory(TileType tileType, const QString &cacheDir, Parsing
if (m_tileType == Landmass) {
m_zoomLevel = 7;
m_baseDir = QString("%1/landmass/%2").arg(cacheDir).arg(m_zoomLevel);
- m_inputFile = QString("%1/land-polygons-split-4326/land_polygons.shp").arg(cacheDir);
+ QString const landmassDir = QString("%1/land-polygons-split-4326").arg(cacheDir);
+ m_inputFile = QString("%1/land_polygons.shp").arg(landmassDir);
auto const landmassZip = QString("%1/%2").arg(m_cacheDir).arg(m_landmassFile);
if (!QFileInfo(landmassZip).exists()) {
QString const url = QString("http://data.openstreetmapdata.com/%1").arg(m_landmassFile);
download(url, landmassZip);
+ }
+ if (!QFileInfo(landmassDir).exists()) {
MarbleZipReader unzip(landmassZip);
if (!unzip.extractAll(m_cacheDir)) {
qWarning() << "Failed to extract" << landmassZip << "to" << m_cacheDir;