summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-09-24 13:57:34 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-09-24 13:57:57 (GMT)
commit4e7b699ecf10f59378fd23161b1e8ca3f04d201c (patch)
treed605bbb0770bb3639d422ecf8f0b0b71ea9df270
parent411dd30243c83148d91b32f7f17013351f3b37c1 (diff)
Cut landmass to input map region
-rw-r--r--tools/vectorosm-tilecreator/main.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/vectorosm-tilecreator/main.cpp b/tools/vectorosm-tilecreator/main.cpp
index f76ddf1..e1f7d1c 100644
--- a/tools/vectorosm-tilecreator/main.cpp
+++ b/tools/vectorosm-tilecreator/main.cpp
@@ -226,7 +226,7 @@ int main(int argc, char *argv[])
parser.addOptions({
{{"d","debug"}, "Debug output in the terminal."},
{{"s","silent"}, "Don't output to terminal."},
- {{"l","landmass"}, "Convert the given <landmass> file and reduce nodes"},
+ {{"l","landmass"}, "Convert the given <landmass> file and reduce nodes", "landmass"},
{{"m","merge"}, "Merge the main document with the file <file_to_merge_with>. This works together with the -c flag.", "file_to_merge_with"},
{{"z", "zoom-level"}, "Zoom level according to which OSM information has to be processed.", "number"},
{{"o", "output"}, "Output file or directory", "output"},
@@ -289,14 +289,15 @@ int main(int argc, char *argv[])
}
}
- NodeReducer reducer(map.data(), zoomLevel+1);
+ auto region = open(inputFileName, manager);
+ VectorClipper clipper(map.data());
+ auto target = clipper.clipTo(region->latLonAltBox());
+ //NodeReducer reducer(target, zoomLevel+1);
- QString const extension = parser.value("extension");
- QString const outputFile = QString("%1/landmass-level-%2.%3").arg(outputName).arg(zoomLevel).arg(extension);
- if (!GeoDataDocumentWriter::write(outputFile, *map)) {
+ if (!GeoDataDocumentWriter::write(outputName, *target)) {
return 4;
}
- qDebug() << "Landmass file " << outputFile << " done";
+ qDebug() << "Landmass file " << outputName << " done";
} else if (zoomLevel <= 9) {
auto map = open(inputFileName, manager);