Skip to content

Instantly share code, notes, and snippets.

@mhweber
Created May 6, 2016 21:06
Show Gist options
  • Save mhweber/539aca5f0f44d503b1c215c28b61397d to your computer and use it in GitHub Desktop.
Save mhweber/539aca5f0f44d503b1c215c28b61397d to your computer and use it in GitHub Desktop.
Testing out the georasters package
import georasters as gr
import matplotlib.pyplot as plt
r1 = gr.from_file('wshed1')
NDV, xsize, ysize, GeoT, Projection, DataType = gr.get_geo_info('wshed1')
# change the data type from uint8 to uint32
r1.datatype=4
r1 = r1*2546909
r2 = gr.from_file('wshed2')
r2.datatype=4
r2 = r2*2572639
r3 = gr.from_file('wshed3')
r3.datatype=4
r3 = r3*2553330
# merge all 3 rasters
r4 = gr.merge([r1,r2,r3])
plt.figure(figsize=(12,8))
r4.plot()
# write it out
r4.to_tiff('test12')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment