From c4b65ada73f4602d0b2bcec25ebaeeb77466d6d7 Mon Sep 17 00:00:00 2001 From: Mike C Date: Sun, 25 Feb 2018 14:01:12 -0500 Subject: [PATCH] Add ability to specify output file names --- process_maps.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/process_maps.py b/process_maps.py index d6cacc7..7af9328 100755 --- a/process_maps.py +++ b/process_maps.py @@ -34,6 +34,8 @@ if __name__ == '__main__': help='use RAM for mapsforge processing -- WARNING mapsforge uses 10x the map size in RAM for processing (ie. 100Mb map = 1Gb RAM usage), you want a LOT of RAM for this option') parser.add_argument('--max-heap-space', action='store', default='4g', help='set the max heap space for the JVM, use standard -Xmx values, default (4g) should be fine if not using --use-ram argument') + parser.add_argument('--output-map-name', action='store', default='output', + help='set the output .map and .poi file names') #TODO: Add argument to pass path to osmosis #TODO: Add argument to pass path to output dir args = parser.parse_args() @@ -91,7 +93,7 @@ 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=' + args.output_map_name + '.map']) if args.use_ram: osmosis_cmd.extend(['type=ram']) else: @@ -108,7 +110,7 @@ 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(['--poi-writer', 'file=output.poi', 'tag-conf-file=' + os.path.join(base_path, 'poi-mapping.xml')]) + osmosis_cmd.extend(['--poi-writer', 'file=' + args.output_map_name + '.poi', 'tag-conf-file=' + os.path.join(base_path, 'poi-mapping.xml')]) cmd = subprocess.Popen(osmosis_cmd, env=env) cmd.wait()