Skip to content

Instantly share code, notes, and snippets.

@nmathewa
Created March 4, 2021 14:59
Show Gist options
  • Save nmathewa/391a72d32191a174f222c76284a0e209 to your computer and use it in GitHub Desktop.
Save nmathewa/391a72d32191a174f222c76284a0e209 to your computer and use it in GitHub Desktop.
use_gdal_py
"""
Created on Thu Mar 4 19:14:00 2021
@author: nma
"""
import os
raster_f = "A_raster_file.tif"
raster_s = "B_raster_file.tif"
out_ = "outfile.tif"
os.system("gdal_calc.py -A "+str(raster_f)+" "" -B "+str(raster_s)+" --outfile="+str(out__)+" --calc='(A-B)'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment