Guest User

Untitled

a guest
Jul 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. from osgeo import gdal, gdalconst
  2. import numpy as np
  3.  
  4. def raster2array(src_raster_uri):
  5.  
  6. dataset = gdal.Open(src_raster_uri, gdalconst.GA_ReadOnly)
  7. band = dataset.GetRasterBand(1)
  8. out_array = np.array(band.ReadAsArray())
  9.  
  10. return out_array
Add Comment
Please, Sign In to add comment