Skip to content

Commit

Permalink
update compressor with new code from sean gilles.
Browse files Browse the repository at this point in the history
  • Loading branch information
00krishna committed Oct 23, 2020
1 parent 4dac3ca commit 59ee33e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
15 changes: 8 additions & 7 deletions nyuki/geotiff_compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import click
import rasterio
from rasterio.warp import calculate_default_transform, reproject, Resampling

import shutil

def compressor(sourcefile, target_compression='LZW', yes=False):

Expand Down Expand Up @@ -43,14 +43,15 @@ def compressor(sourcefile, target_compression='LZW', yes=False):
# the new file's profile, we start with the profile of the source

# specify compression standard
profile.update(
compress=target_compression,
BIGTIFF = "YES")
# profile.update(
# compress=target_compression,
# BIGTIFF = "YES")

with rasterio.open(targetfile, 'w', **profile) as dst:
for ji, window in dat.block_windows(1):
dst.write(dat.read(window=window), window=window)
# with rasterio.open(targetfile, 'w', **profile) as dst:
# for ji, window in dat.block_windows(1):
# dst.write(dat.read(window=window), window=window)

rasterio.shutil.copy(dat, target_file, compress=target_compression, BIGTIFF="IF_SAFER")
click.echo('[INFO] Task complete.')

return targetfile
1 change: 0 additions & 1 deletion packaging/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{% set name = "nyuki" %}
{% set version = "0.0.3" %}

Expand Down

0 comments on commit 59ee33e

Please sign in to comment.