Skip to content

Instantly share code, notes, and snippets.

@rafaqz
Last active Jun 15, 2018
Embed
What would you like to do?
Load a world raster with ArchGDAL and crop australia
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