Compress outputs on export, simplify options list

pull/1147/head
Piero Toffanin 2022-02-28 14:23:51 -05:00
rodzic b10fc806d5
commit f373bb4bcb
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -43,6 +43,7 @@ def export_raster(input, output, **opts):
# Output format # Output format
driver = "GTiff" driver = "GTiff"
compress = None
max_bands = 9999 max_bands = 9999
with_alpha = True with_alpha = True
rgb = False rgb = False
@ -62,7 +63,7 @@ def export_raster(input, output, **opts):
if export_format == "jpg": if export_format == "jpg":
driver = "JPEG" driver = "JPEG"
profile.update(quality=70) profile.update(quality=90)
band_count = 3 band_count = 3
with_alpha = False with_alpha = False
rgb = True rgb = True
@ -71,11 +72,18 @@ def export_raster(input, output, **opts):
band_count = 4 band_count = 4
rgb = True rgb = True
elif export_format == "gtiff-rgb": elif export_format == "gtiff-rgb":
compress = "JPEG"
profile.update(jpeg_quality=90)
band_count = 4 band_count = 4
rgb = True rgb = True
else: else:
compress = "DEFLATE"
band_count = src.count band_count = src.count
if compress is not None:
profile.update(compress=compress)
profile.update(predictor=2 if compress == "DEFLATE" else 1)
if rgb and rescale is None: if rgb and rescale is None:
# Compute min max # Compute min max
nodata = None nodata = None

Wyświetl plik

@ -12,7 +12,7 @@ if (!Object.values) {
} }
// Do not apply to WebODM, can cause confusion // Do not apply to WebODM, can cause confusion
const OPTS_BLACKLIST = ['orthophoto-png', 'orthophoto-kmz', 'pc-las', 'pc-ply', 'pc-csv', 'pc-ept', 'cog']; const OPTS_BLACKLIST = ['build-overviews', 'orthophoto-no-tiled', 'orthophoto-compression', 'orthophoto-png', 'orthophoto-kmz', 'pc-las', 'pc-ply', 'pc-csv', 'pc-ept', 'cog'];
class EditPresetDialog extends React.Component { class EditPresetDialog extends React.Component {
static defaultProps = { static defaultProps = {