From 9f36e8e9489dc73d97990dd1732e20febeb0b32f Mon Sep 17 00:00:00 2001 From: Mike C Date: Tue, 12 Jan 2016 17:20:07 -0500 Subject: [PATCH] Added on-disk processing of maps due to in-memory being "too big" for "large" map processing --- .gitignore | 1 + process_maps.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b3b8a8b..eb0cdd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ out/ test/ +tmp/ *.swp diff --git a/process_maps.py b/process_maps.py index 95586de..238f05c 100755 --- a/process_maps.py +++ b/process_maps.py @@ -26,6 +26,8 @@ if __name__ == '__main__': map_list.append(line.strip()) print('Creating working directories') + if not os.path.exists('tmp'): + os.makedirs('tmp') if not os.path.exists('out'): os.makedirs('out') os.chdir('out') @@ -58,7 +60,7 @@ if __name__ == '__main__': print(' Found map: ', end='') print(os.path.join(dirpath, file)) files_to_process.append(os.path.join(dirpath, file)) - osmosis_cmd = [os.path.join(base_path, 'bin', 'osmosis', 'bin', 'osmosis')] + osmosis_cmd = [os.path.join(base_path, 'bin', 'osmosis', 'bin', 'osmosis', '-Djava.io.tmpdir=' + os.path.join(base_path), 'tmp')] for file in files_to_process: if file.endswith('osm'): osmosis_cmd.extend(['--rx', 'file=' + file]) @@ -66,6 +68,6 @@ if __name__ == '__main__': osmosis_cmd.extend(['--rb', 'file=' + file]) for x in range(0, len(files_to_process) - 1): osmosis_cmd.append('--merge') - osmosis_cmd.extend(['--mapfile-writer', 'file=output.map']) + osmosis_cmd.extend(['--mapfile-writer', 'file=output.map', 'type=hd']) subprocess.run(osmosis_cmd)