Added on-disk processing of maps due to in-memory being "too big" for "large" map processing
This commit is contained in:
parent
c69f8515b2
commit
9f36e8e948
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
out/
|
||||
test/
|
||||
tmp/
|
||||
*.swp
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Reference in a new issue