Skip to content

Instantly share code, notes, and snippets.

@PratyushTripathy
Last active April 24, 2020 03:56
Show Gist options
  • Save PratyushTripathy/f7a6a4f86ec88198d2514c02447e2db5 to your computer and use it in GitHub Desktop.
Save PratyushTripathy/f7a6a4f86ec88198d2514c02447e2db5 to your computer and use it in GitHub Desktop.
predicted = model.predict(featuresHyderabad)
predicted = predicted[:,1]
#Export raster
prediction = np.reshape(predicted, (ds.RasterYSize, ds.RasterXSize))
outFile = 'Hyderabad_2011_BuiltupNN_predicted.tif'
raster.export(prediction, ds3, filename=outFile, dtype='float')
@foranastes
Copy link

ds is not defined

@PratyushTripathy
Copy link
Author

PratyushTripathy commented Apr 24, 2020

@foranastes this is only the gist to embed code snippets in the Medium post. You have to use the full code available here https://github.com/PratyushTripathy/Landsat-Classification-Using-Neural-Network?files=1
However, a quick fix to the issue could be reading a dummy raster and use its ds as the data source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment