diff --git a/tools/osm-simplify/main.cpp b/tools/osm-simplify/main.cpp --- a/tools/osm-simplify/main.cpp +++ b/tools/osm-simplify/main.cpp @@ -1,3 +1,13 @@ +// +// This file is part of the Marble Virtual Globe. +// +// This program is free software licensed under the GNU LGPL. You can +// find a copy of this license in LICENSE.txt in the top directory of +// the source code. +// +// Copyright 2016 David Kolozsvari +// + #include "OsmParser.h" #include "GeoWriter.h" @@ -46,7 +56,7 @@ } void usage() { - qDebug() << "Usage: osm-addresses [options] input.osm output.osm"; + qDebug() << "Usage: osm-simplify [options] input.osm output.osm"; qDebug() << "\t-q quiet"; qDebug() << "\t-v debug output"; } @@ -83,13 +93,14 @@ return 2; } - if ( file.fileName().endsWith( QLatin1String( ".osm" ) ) ) { + if ( file.suffix() == "osm") { QString error; Marble::GeoDataDocument* osmMap = OsmParser::parse(inputSrc, error); if(!error.isEmpty()) { qDebug() << error; + return 3; } Marble::GeoWriter writer; @@ -99,12 +110,15 @@ outputfile.open( QIODevice::WriteOnly ); if ( !writer.write( &outputfile, osmMap ) ) { qDebug() << "Could not write the file " << outputSrc; + return 4; } qDebug() << "Done."; } else { qDebug() << "Unsupported file format: " << outputSrc; - return 3; + return 5; } + + return 0; }