Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.