summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-08-13 15:15:53 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-08-13 15:15:53 (GMT)
commitb139ca1a8f6e6d9be385b17b80ea6022ac5fb410 (patch)
tree095f9602dcb7c98bfc40ad8166e58e22dc0efc7d
parent9d00e02fb961c0803e5e091d2b0826362e8619b2 (diff)
Allow choosing a different file format than osm xml.
-rw-r--r--tools/osm-simplify/main.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/osm-simplify/main.cpp b/tools/osm-simplify/main.cpp
index 5337f84..848d498 100644
--- a/tools/osm-simplify/main.cpp
+++ b/tools/osm-simplify/main.cpp
@@ -147,6 +147,13 @@ int main(int argc, char *argv[])
{"o", "output"},
QCoreApplication::translate("main", "Generates an output .osmfile based on other flags. If the cut-to-tiles flag is set, then this needs to be a directory."),
QCoreApplication::translate("main", "output_file.osm")
+ },
+
+ {
+ {"e", "extension"},
+ QCoreApplication::translate("main", "Output file type: osm (default), o5m or kml"),
+ QCoreApplication::translate("main", "osm"),
+ "osm"
}
});
@@ -162,6 +169,7 @@ int main(int argc, char *argv[])
QString inputFileName = args.at(0);
QString mergeFileName = parser.value("merge");
+ QString const extension = parser.value("extension");
bool debug = parser.isSet("debug");
bool silent = parser.isSet("silent");
unsigned int zoomLevel = parser.value("zoom-level").toInt();
@@ -224,9 +232,9 @@ int main(int argc, char *argv[])
QString outputFile;
if(parser.isSet("output")) {
- outputFile = QString("%1/%2/%3/%4.osm").arg(outputName).arg(zoomLevel).arg(x).arg(y);
+ outputFile = QString("%1/%2/%3/%4.%5").arg(outputName).arg(zoomLevel).arg(x).arg(y).arg(extension);
} else {
- outputFile = QString("%1/%2/%3.osm").arg(zoomLevel).arg(x).arg(y);
+ outputFile = QString("%1/%2/%3.%4").arg(zoomLevel).arg(x).arg(y).arg(extension);
}
QDir dir;
@@ -279,9 +287,9 @@ int main(int argc, char *argv[])
QString outputFile;
if(parser.isSet("output")) {
- outputFile = QString("%1/%2/%3/%4.osm").arg(outputName).arg(zoomLevel).arg(x).arg(y);
+ outputFile = QString("%1/%2/%3/%4.%5").arg(outputName).arg(zoomLevel).arg(x).arg(y).arg(extension);
} else {
- outputFile = QString("%1/%2/%3.osm").arg(zoomLevel).arg(x).arg(y);
+ outputFile = QString("%1/%2/%3.%4").arg(zoomLevel).arg(x).arg(y).arg(extension);
}
QDir dir;
@@ -331,9 +339,9 @@ int main(int argc, char *argv[])
QString outputFile;
if(parser.isSet("output")) {
- outputFile = QString("%1/%2/%3/%4.osm").arg(outputName).arg(zoomLevel).arg(x).arg(y);
+ outputFile = QString("%1/%2/%3/%4.%5").arg(outputName).arg(zoomLevel).arg(x).arg(y).arg(extension);
} else {
- outputFile = QString("%1/%2/%3.osm").arg(zoomLevel).arg(x).arg(y);
+ outputFile = QString("%1/%2/%3.%4").arg(zoomLevel).arg(x).arg(y).arg(extension);
}
QDir dir;