Add BigTIFF creation option to odm_orthophoto

pull/525/head
Dakota Benjamin 2017-03-29 16:13:34 -04:00
rodzic 7b440295db
commit 3ce495c37b
3 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -344,6 +344,11 @@ def config():
'break gdal_translate if you don\'t know what you ' 'break gdal_translate if you don\'t know what you '
'are doing. Options: %(choices)s.\nDefault: %(default)s') 'are doing. Options: %(choices)s.\nDefault: %(default)s')
parser.add_argument('--orthophoto-bigtiff',
action='store_true',
default=False,
help='Set this parameter if you expect a big orthophoto.')
parser.add_argument('--zip-results', parser.add_argument('--zip-results',
action='store_true', action='store_true',
default=False, default=False,

Wyświetl plik

@ -76,6 +76,7 @@ class ODMApp(ecto.BlackBox):
t_srs=p.args.orthophoto_target_srs, t_srs=p.args.orthophoto_target_srs,
no_tiled=p.args.orthophoto_no_tiled, no_tiled=p.args.orthophoto_no_tiled,
compress=p.args.orthophoto_compression, compress=p.args.orthophoto_compression,
bigtiff=p.args.orthophoto_bigtiff,
verbose=p.args.verbose) verbose=p.args.verbose)
} }

Wyświetl plik

@ -13,6 +13,7 @@ class ODMOrthoPhotoCell(ecto.Cell):
params.declare("t_srs", 'Target SRS', None) params.declare("t_srs", 'Target SRS', None)
params.declare("no_tiled", 'Do not tile tiff', False) params.declare("no_tiled", 'Do not tile tiff', False)
params.declare("compress", 'Compression type', 'DEFLATE') params.declare("compress", 'Compression type', 'DEFLATE')
params.declare("bigtiff", 'Make BigTIFF orthophoto', False)
params.declare("verbose", 'print additional messages to console', False) params.declare("verbose", 'print additional messages to console', False)
def declare_io(self, params, inputs, outputs): def declare_io(self, params, inputs, outputs):
@ -102,13 +103,14 @@ class ODMOrthoPhotoCell(ecto.Cell):
['LZW', 'DEFLATE'] else '', ['LZW', 'DEFLATE'] else '',
'epsg': georef.epsg, 'epsg': georef.epsg,
't_srs': self.params.t_srs or "EPSG:{0}".format(georef.epsg), 't_srs': self.params.t_srs or "EPSG:{0}".format(georef.epsg),
'bigtiff': '-co BIGTIFF=YES ' if self.params.bigtiff else '',
'png': tree.odm_orthophoto_file, 'png': tree.odm_orthophoto_file,
'tiff': tree.odm_orthophoto_tif, 'tiff': tree.odm_orthophoto_tif,
'log': tree.odm_orthophoto_tif_log 'log': tree.odm_orthophoto_tif_log
} }
system.run('gdal_translate -a_ullr {ulx} {uly} {lrx} {lry} ' system.run('gdal_translate -a_ullr {ulx} {uly} {lrx} {lry} '
'{tiled} ' '{tiled} {bigtiff} '
'-co COMPRESS={compress} ' '-co COMPRESS={compress} '
'{predictor} ' '{predictor} '
'-co BLOCKXSIZE=512 ' '-co BLOCKXSIZE=512 '