Skip to content

Instantly share code, notes, and snippets.

@PratyushTripathy
Created January 23, 2020 09:04
Show Gist options
  • Save PratyushTripathy/baab29d2268dbbe8b3f22f19d3a89504 to your computer and use it in GitHub Desktop.
Save PratyushTripathy/baab29d2268dbbe8b3f22f19d3a89504 to your computer and use it in GitHub Desktop.
import os
from pyrsgis import raster
# Change the directory
os.chdir("E:\\BuiltUpPrediction")
# Assign file names
mxBangalore = 'l5_Bangalore2011_raw.tif'
builtupBangalore = 'l5_Bangalore2011_builtup.tif'
mxHyderabad = 'l5_Hyderabad2011_raw.tif'
# Read the rasters as array
ds1, featuresBangalore = raster.read(mxBangalore, bands='all')
ds2, labelBangalore = raster.read(builtupBangalore, bands=1)
ds3, featuresHyderabad = raster.read(mxHyderabad, bands='all')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment