From 5d793ce58e9b7318dfb6939a00b44c92c699477e Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 14 Sep 2020 14:44:45 +0000 Subject: [PATCH] Options choices syntax fix, changed DEM compression to DEFLATE Former-commit-id: 790088249f9d5fbd9f8c3a90c5478ab3f3131a04 --- opendm/config.py | 12 +++++------- opendm/dem/commands.py | 4 ++++ opendm/dem/utils.py | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/opendm/config.py b/opendm/config.py index b5623d7e..f8a91db8 100755 --- a/opendm/config.py +++ b/opendm/config.py @@ -144,7 +144,7 @@ def config(argv=None): default='sift', choices=['sift', 'hahog'], help=('Choose the algorithm for extracting keypoints and computing descriptors. ' - 'Can be one of: [sift, hahog]. Default: ' + 'Can be one of: %(choices)s. Default: ' '%(default)s')) parser.add_argument('--feature-quality', @@ -153,7 +153,7 @@ def config(argv=None): default='high', choices=['ultra', 'high', 'medium', 'low', 'lowest'], help=('Set feature extraction quality. Higher quality generates better features, but requires more memory and takes longer. ' - 'Can be one of: [ultra, high, medium, low, lowest]. Default: ' + 'Can be one of: %(choices)s. Default: ' '%(default)s')) parser.add_argument('--matcher-neighbors', @@ -204,7 +204,7 @@ def config(argv=None): help=('Set a camera projection type. Manually setting a value ' 'can help improve geometric undistortion. By default the application ' 'tries to determine a lens type from the images metadata. Can be ' - 'set to one of: [auto, perspective, brown, fisheye, spherical]. Default: ' + 'set to one of: %(choices)s. Default: ' '%(default)s')) parser.add_argument('--radiometric-calibration', @@ -217,7 +217,7 @@ def config(argv=None): 'to obtain reflectance values (otherwise you will get digital number values). ' '[camera] applies black level, vignetting, row gradient gain/exposure compensation (if appropriate EXIF tags are found). ' '[camera+sun] is experimental, applies all the corrections of [camera], plus compensates for spectral radiance registered via a downwelling light sensor (DLS) taking in consideration the angle of the sun. ' - 'Can be set to one of: [none, camera, camera+sun]. Default: ' + 'Can be set to one of: %(choices)s. Default: ' '%(default)s')) parser.add_argument('--max-concurrency', @@ -616,9 +616,7 @@ def config(argv=None): type=str, choices=['JPEG', 'LZW', 'PACKBITS', 'DEFLATE', 'LZMA', 'NONE'], default='DEFLATE', - help='Set the compression to use. Note that this could ' - 'break gdal_translate if you don\'t know what you ' - 'are doing. Options: %(choices)s.\nDefault: %(default)s') + help='Set the compression to use for orthophotos. Options: %(choices)s.\nDefault: %(default)s') parser.add_argument('--orthophoto-cutline', action=StoreTrue, diff --git a/opendm/dem/commands.py b/opendm/dem/commands.py index 5b2269a5..de1a0a26 100755 --- a/opendm/dem/commands.py +++ b/opendm/dem/commands.py @@ -236,11 +236,15 @@ def create_dem(input_point_cloud, dem_type, output_type='max', radiuses=['0.56'] run('gdalbuildvrt -resolution highest -r bilinear "%s" "%s" "%s"' % (merged_vrt_path, geotiff_small_filled_path, geotiff_tmp_path)) run('gdal_translate ' '-co NUM_THREADS={threads} ' + '-co TILED=YES ' + '-co COMPRESS=DEFLATE ' '--config GDAL_CACHEMAX {max_memory}% ' '{merged_vrt} {geotiff}'.format(**kwargs)) else: run('gdal_translate ' '-co NUM_THREADS={threads} ' + '-co TILED=YES ' + '-co COMPRESS=DEFLATE ' '--config GDAL_CACHEMAX {max_memory}% ' '{tiles_vrt} {geotiff}'.format(**kwargs)) diff --git a/opendm/dem/utils.py b/opendm/dem/utils.py index dbcc625f..9fb383a9 100644 --- a/opendm/dem/utils.py +++ b/opendm/dem/utils.py @@ -2,7 +2,7 @@ def get_dem_vars(args): return { 'TILED': 'YES', - 'COMPRESS': 'LZW', + 'COMPRESS': 'DEFLATE', 'BLOCKXSIZE': 512, 'BLOCKYSIZE': 512, 'BIGTIFF': 'IF_SAFER',