Skip to content

Instantly share code, notes, and snippets.

@BishopGIS
Created December 26, 2020 12:52
Show Gist options
  • Save BishopGIS/926866c9bf92b561ee0d9e1f9fd21ec7 to your computer and use it in GitHub Desktop.
Save BishopGIS/926866c9bf92b561ee0d9e1f9fd21ec7 to your computer and use it in GitHub Desktop.
Test warp
from osgeo import gdal
import os
ds = gdal.Warp('', 'small.tif', format='MEM', warpOptions=["INIT_DEST=NO_DATA", "UNIFIED_SRC_NODATA=YES"], srcNodata=0, dstAlpha=True)
try:
os.remove('nd5.tiff')
except OSError:
pass
gdal.GetDriverByName('GTiff').CreateCopy('nd5.tiff', ds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment