Last active
June 15, 2018 03:33
-
-
Save rafaqz/f43833deaffc37c8c50ff9cae6a8e334 to your computer and use it in GitHub Desktop.
Load a world raster with ArchGDAL and crop australia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ArchGDAL | |
function readtiff(file) | |
img = ArchGDAL.registerdrivers() do | |
ArchGDAL.read(file) do dataset | |
ArchGDAL.read(dataset) | |
end | |
end | |
img ./= maximum(img) | |
img .= max.(0.0, img) | |
img = img[:,:,1]' | |
end | |
cropaust(x) = x[950:1350, 3100:3600] # Australia | |
world_suitability = readtiff("your/path/limited_growth_2017_06.tif") | |
suit = cropaust(world_suitability) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment