Skip to content

Instantly share code, notes, and snippets.

@xuanlongma
Created May 24, 2013 08:21
Show Gist options
  • Save xuanlongma/5642078 to your computer and use it in GitHub Desktop.
Save xuanlongma/5642078 to your computer and use it in GitHub Desktop.
change the projection using GDAL library
## a tiff file
input <- "modis.evi.tif"
output <- "modis.evi.reprojected.tif"
## GDAL command line for reprojection
proj.cmd.warp <- 'gdalwarp -t_srs \'+proj=latlong +datum=WGS84\' -r near -overwrite'
## Invoke the system GDAL command
system(command = paste(proj.cmd.warp, input, output, sep = ' '))
## END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment