From 40bda5bd7affbce892ad964b8718bbafc84f903d Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Tue, 24 Nov 2020 08:25:12 -0500 Subject: [PATCH] Fixed bigtiff bug in DEM generation --- VERSION | 2 +- opendm/dem/commands.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c043eea7..276cbf9e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.1 +2.3.0 diff --git a/opendm/dem/commands.py b/opendm/dem/commands.py index de1a0a26..a12e79e0 100755 --- a/opendm/dem/commands.py +++ b/opendm/dem/commands.py @@ -214,12 +214,14 @@ def create_dem(input_point_cloud, dem_type, output_type='max', radiuses=['0.56'] # so we need to convert to GeoTIFF first. run('gdal_translate ' '-co NUM_THREADS={threads} ' + '-co BIGTIFF=IF_SAFER ' '--config GDAL_CACHEMAX {max_memory}% ' '{tiles_vrt} {geotiff_tmp}'.format(**kwargs)) # Scale to 10% size run('gdal_translate ' '-co NUM_THREADS={threads} ' + '-co BIGTIFF=IF_SAFER ' '--config GDAL_CACHEMAX {max_memory}% ' '-outsize 10% 0 ' '{geotiff_tmp} {geotiff_small}'.format(**kwargs)) @@ -227,6 +229,7 @@ def create_dem(input_point_cloud, dem_type, output_type='max', radiuses=['0.56'] # Fill scaled run('gdal_fillnodata.py ' '-co NUM_THREADS={threads} ' + '-co BIGTIFF=IF_SAFER ' '--config GDAL_CACHEMAX {max_memory}% ' '-b 1 ' '-of GTiff ' @@ -237,6 +240,7 @@ def create_dem(input_point_cloud, dem_type, output_type='max', radiuses=['0.56'] run('gdal_translate ' '-co NUM_THREADS={threads} ' '-co TILED=YES ' + '-co BIGTIFF=IF_SAFER ' '-co COMPRESS=DEFLATE ' '--config GDAL_CACHEMAX {max_memory}% ' '{merged_vrt} {geotiff}'.format(**kwargs)) @@ -244,6 +248,7 @@ def create_dem(input_point_cloud, dem_type, output_type='max', radiuses=['0.56'] run('gdal_translate ' '-co NUM_THREADS={threads} ' '-co TILED=YES ' + '-co BIGTIFF=IF_SAFER ' '-co COMPRESS=DEFLATE ' '--config GDAL_CACHEMAX {max_memory}% ' '{tiles_vrt} {geotiff}'.format(**kwargs))