fix all the big(tiff) problems

pull/1489/head
Stephen Vincent Mather 2022-06-29 15:38:27 -04:00
rodzic d97c2fae1e
commit 12dac7cd20
6 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -381,7 +381,7 @@ with rasterio.open(dem_path) as dem_raster:
if not outfile.endswith(".tif"): if not outfile.endswith(".tif"):
outfile = outfile + ".tif" outfile = outfile + ".tif"
with rasterio.open(outfile, 'w', **profile) as wout: with rasterio.open(outfile, 'w', BIGTIFF="IF_SAFER", **profile) as wout:
for b in range(num_bands): for b in range(num_bands):
wout.write(imgout[b], b + 1) wout.write(imgout[b], b + 1)
if with_alpha: if with_alpha:

Wyświetl plik

@ -88,7 +88,7 @@ try:
elif typ == 'tgi': elif typ == 'tgi':
indeks = calcTgi(red, green, blue) indeks = calcTgi(red, green, blue)
with rasterio.open(outFileName, 'w', **profile) as dst: with rasterio.open(outFileName, 'w', BIGTIFF="IF_SAFER", **profile) as dst:
dst.write(indeks.astype(rasterio.float32), 1) dst.write(indeks.astype(rasterio.float32), 1)
except rasterio.errors.RasterioIOError: except rasterio.errors.RasterioIOError:
print bcolors.FAIL + 'Orthophoto file not found or access denied' + bcolors.ENDC print bcolors.FAIL + 'Orthophoto file not found or access denied' + bcolors.ENDC

Wyświetl plik

@ -35,7 +35,7 @@ def write_raster(data, file):
'crs': None 'crs': None
} }
with rasterio.open(file, 'w', **profile) as wout: with rasterio.open(file, 'w', BIGTIFF="IF_SAFER", **profile) as wout:
wout.write(data, 1) wout.write(data, 1)
def compute_cutline(orthophoto_file, crop_area_file, destination, max_concurrency=1, scale=1): def compute_cutline(orthophoto_file, crop_area_file, destination, max_concurrency=1, scale=1):

Wyświetl plik

@ -328,7 +328,7 @@ def median_smoothing(geotiff_path, output_path, smoothing_iterations=1):
arr[nodata_locs] = nodata arr[nodata_locs] = nodata
# write output # write output
with rasterio.open(output_path, 'w', **img.profile) as imgout: with rasterio.open(output_path, 'w', BIGTIFF="IF_SAFER", **img.profile) as imgout:
imgout.write(arr, 1) imgout.write(arr, 1)
log.ODM_INFO('Completed smoothing to create %s in %s' % (output_path, datetime.now() - start)) log.ODM_INFO('Completed smoothing to create %s in %s' % (output_path, datetime.now() - start))

Wyświetl plik

@ -92,7 +92,7 @@ def euclidean_merge_dems(input_dems, output_dem, creation_options={}, euclidean_
profile.update(creation_options) profile.update(creation_options)
# create destination file # create destination file
with rasterio.open(output_dem, "w", **profile) as dstrast: with rasterio.open(output_dem, "w", BIGTIFF="IF_SAFER", **profile) as dstrast:
for idx, dst_window in dstrast.block_windows(): for idx, dst_window in dstrast.block_windows():

Wyświetl plik

@ -129,7 +129,7 @@ def compute_mask_raster(input_raster, vector_mask, output_raster, blend_distance
else: else:
log.ODM_WARNING("%s does not have an alpha band, cannot blend cutline!" % input_raster) log.ODM_WARNING("%s does not have an alpha band, cannot blend cutline!" % input_raster)
with rasterio.open(output_raster, 'w', **rast.profile) as dst: with rasterio.open(output_raster, 'w', BIGTIFF="IF_SAFER", **rast.profile) as dst:
dst.colorinterp = rast.colorinterp dst.colorinterp = rast.colorinterp
dst.write(out_image) dst.write(out_image)
@ -154,7 +154,7 @@ def feather_raster(input_raster, output_raster, blend_distance=20):
else: else:
log.ODM_WARNING("%s does not have an alpha band, cannot feather raster!" % input_raster) log.ODM_WARNING("%s does not have an alpha band, cannot feather raster!" % input_raster)
with rasterio.open(output_raster, 'w', **rast.profile) as dst: with rasterio.open(output_raster, 'w', BIGTIFF="IF_SAFER", **rast.profile) as dst:
dst.colorinterp = rast.colorinterp dst.colorinterp = rast.colorinterp
dst.write(out_image) dst.write(out_image)
@ -230,7 +230,7 @@ def merge(input_ortho_and_ortho_cuts, output_orthophoto, orthophoto_vars={}):
profile.update() profile.update()
# create destination file # create destination file
with rasterio.open(output_orthophoto, "w", **profile) as dstrast: with rasterio.open(output_orthophoto, "w", BIGTIFF="IF_SAFER", **profile) as dstrast:
dstrast.colorinterp = colorinterp dstrast.colorinterp = colorinterp
for idx, dst_window in dstrast.block_windows(): for idx, dst_window in dstrast.block_windows():
left, bottom, right, top = dstrast.window_bounds(dst_window) left, bottom, right, top = dstrast.window_bounds(dst_window)