Skip to content

Instantly share code, notes, and snippets.

View amartyahatua's full-sized avatar

Amartya Hatua amartyahatua

  • Fidelity Investments
  • Boston
View GitHub Profile
import rasterio
def resize_image(infile, outfile):
# Register GDAL format drivers and configuration options with a
# context manager.
with rasterio.Env():
with rasterio.open(infile) as dataset:
data = dataset.read(1, out_shape=(st_img.shape[0], st_img.shape[1]), resampling=Resampling.bilinear)
# scale image transform