Skip to content

Instantly share code, notes, and snippets.

@mdsumner
Last active July 22, 2016 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdsumner/8404668a41b47b1dacb5d8b8f326acc1 to your computer and use it in GitHub Desktop.
Save mdsumner/8404668a41b47b1dacb5d8b8f326acc1 to your computer and use it in GitHub Desktop.
library(raster)
## a tiled tiff (256x256)
## Size is 21600, 10800
r <- raster("Etopo1.tif")
library(geosphere)
set.seed(1)
pts <- randomCoordinates(1000)
system.time(extract(r, pts))
# user system elapsed
# 5.78 0.08 5.86
## a not-tiled GeoTIFF
r2 <- writeRaster(r, "file.tif")
system.time(extract(r2, pts))
# user system elapsed
# 1.72 0.06 1.78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment