summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-07-16 13:21:45 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-07-16 13:21:45 (GMT)
commit5154d7e805692ac11e2c0aa39410e63f34667127 (patch)
tree7919cb5b7fe7fe2d38f8e0e1f5233839dd549a7f
parent06a8ef68e9ccbdde6154fbe0766a421b2b6c9d52 (diff)
Revert "Fix cache directory usage"
This reverts commit 06a8ef68e9ccbdde6154fbe0766a421b2b6c9d52.
-rw-r--r--src/lib/marble/geodata/writer/GeoWriter.cpp4
-rw-r--r--src/plugins/runner/osm/CMakeLists.txt1
-rw-r--r--tools/kml2kml/kml2kml.cpp6
-rw-r--r--tools/natural-earth-vector-tiling/ne_tilegenerator.py14
-rwxr-xr-xtools/vectortilecreator/vectortilecreator.py6
5 files changed, 10 insertions, 21 deletions
diff --git a/src/lib/marble/geodata/writer/GeoWriter.cpp b/src/lib/marble/geodata/writer/GeoWriter.cpp
index b7160d1..2a126ff 100644
--- a/src/lib/marble/geodata/writer/GeoWriter.cpp
+++ b/src/lib/marble/geodata/writer/GeoWriter.cpp
@@ -29,10 +29,6 @@ GeoWriter::GeoWriter()
bool GeoWriter::write(QIODevice* device, const GeoNode *feature)
{
setDevice( device );
- if (m_documentType == "o5m") {
- return writeElement(feature);
- }
-
setAutoFormatting( true );
writeStartDocument();
diff --git a/src/plugins/runner/osm/CMakeLists.txt b/src/plugins/runner/osm/CMakeLists.txt
index 34b5c83..f5b27ec 100644
--- a/src/plugins/runner/osm/CMakeLists.txt
+++ b/src/plugins/runner/osm/CMakeLists.txt
@@ -17,7 +17,6 @@ set( osm_writers_SRCS
)
set( osm_translators_SRCS
translators/OsmDocumentTagTranslator.cpp
- translators/O5mWriter.cpp
)
set( osm_SRCS
diff --git a/tools/kml2kml/kml2kml.cpp b/tools/kml2kml/kml2kml.cpp
index 7260082..86209b1 100644
--- a/tools/kml2kml/kml2kml.cpp
+++ b/tools/kml2kml/kml2kml.cpp
@@ -36,7 +36,7 @@ int main(int argc, char** argv)
return 1;
}
- QString outputFilename = "output.o5m";
+ QString outputFilename = "output.kml";
int outputIndex = app.arguments().indexOf("-o");
if ( outputIndex > 0 && outputIndex + 1 < argc )
outputFilename = app.arguments().at( outputIndex + 1 );
@@ -55,7 +55,5 @@ int main(int argc, char** argv)
return 3;
}
- GeoWriter writer;
- writer.setDocumentType("o5m");
- writer.write(&output, dynamic_cast<GeoDataFeature*>(document));
+ GeoWriter().write(&output, dynamic_cast<GeoDataFeature*>(document));
}
diff --git a/tools/natural-earth-vector-tiling/ne_tilegenerator.py b/tools/natural-earth-vector-tiling/ne_tilegenerator.py
index 47cacf0..038b20a 100644
--- a/tools/natural-earth-vector-tiling/ne_tilegenerator.py
+++ b/tools/natural-earth-vector-tiling/ne_tilegenerator.py
@@ -21,9 +21,9 @@ import argparse
import urllib3
import zipfile
sys.path.append('../shp2osm')
+sys.path.append('../vectortilecreator')
import polyshp2osm
-from subprocess import call
-
+import vectortilecreator
def unzip_file(filename, in_dir):
print(in_dir)
@@ -124,13 +124,9 @@ if __name__ == "__main__":
path = os.path.join(args.in_dir, filename) + '/' + filename + '_shp.shp'
abs_file_paths.append(path)
print('Level has following SHP datasets: ', abs_file_paths)
- tinyPlanet = 'tiny_planet_{}'.format(level)
- if args.overwrite or not os.path.exists(tinyPlanet):
- polyshp2osm.run(abs_file_paths, 1, 5000000, tinyPlanet)
- print('Tiny planetosm for Level = {} complete.'.format(level))
+ polyshp2osm.run(abs_file_paths, 1, 5000000, 'tiny_planet_{}'.format(level))
+ print('Tiny planetosm for Level = {} complete.'.format(level))
f = open('bound_info_{}'.format(level), "w")
print('tiny_planet_{}.1.osm;Level;-180.0;-86.0;180.0;86.0'.format(level), file=f)
f.close()
- #vectortilecreator.run(['bound_info_{}'.format(level)], args.cache, args.refresh, args.out_dir, args.overwrite, [level])
- call(["osm-simplify", "-c", "-z", str(level), "-o", args.out_dir, '{}.1.osm'.format(tinyPlanet)])
-
+ vectortilecreator.run(['bound_info_{}'.format(level)], args.cache, args.refresh, args.out_dir, args.overwrite, [level])
diff --git a/tools/vectortilecreator/vectortilecreator.py b/tools/vectortilecreator/vectortilecreator.py
index bc61ba9..2273989 100755
--- a/tools/vectortilecreator/vectortilecreator.py
+++ b/tools/vectortilecreator/vectortilecreator.py
@@ -113,7 +113,7 @@ class InputProvider(object):
print ("Creating cut out region {}\r".format(cutted), end='')
self.__createdFiles.add(cutted)
inputFile = self.__zoomOut(tile, zoom - 2)
- call(["osmconvert", "-t={}/osmconvert_tmp-".format(self._cacheDirectory), "--complete-ways", "--complex-ways", "--drop-version", "-b={},{},{},{}".format(baseTile.west(), baseTile.south(), baseTile.east(), baseTile.north()), "-o={}".format(cutted), inputFile])
+ call(["osmconvert", "-t={}/osmconvert_tmp-".format(self._cacheDirectory), "--complete-ways", "--complex-ways", "--drop-version", "-b={},{},{},{}".format(baseTile.west(), baseTile.south(), baseTile.east(), baseTile.north()), "-o={}".format(cutted), os.path.join(self._cacheDirectory, inputFile)])
return cutted
@@ -176,9 +176,9 @@ def run(filenames, cache, refresh, directory, overwrite, zoomLevels):
print ("{} level {}: {}/{} {}\r".format(bounds[1], zoom, count, total, os.path.join(path, target)), end='')
filterLevel = "levels/{}.level".format(zoom)
if os.path.exists(filterLevel):
- call(["osmconvert", "-t={}/osmconvert_tmp-".format(cache), "--complete-ways", "--complex-ways", "--drop-version", boxString, cutted, "-o={}".format(os.path.join(cache, filterTarget))])
+ call(["osmconvert", "-t={}/osmconvert_tmp-".format(cache), "--complete-ways", "--complex-ways", "--drop-version", boxString, cutted, "-o={}".format(os.path.join(path, filterTarget))])
call(["osmfilter", "--parameter-file={}".format(filterLevel), os.path.join(path, filterTarget), "-o={}".format(os.path.join(path, target))])
- os.remove(os.path.join(cache, filterTarget))
+ os.remove(os.path.join(path, filterTarget))
else:
call(["osmconvert", "-t={}/osmconvert_tmp-".format(cache), "--complete-ways", "--complex-ways", "--drop-version", boxString, cutted, "-o={}".format(os.path.join(path, target))])
call(["chmod", "644", os.path.join(path, target)])