-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize compressed storage of downloaded data into GTIFF #1
Comments
@ahsparks Started demo of the workflow in development Cheers! |
I completely missed this, @ivanhanigan. Thanks! 👍 |
@adamhsparks I wonder what you think about
Today this was what I wanted to do so I hacked the following, my thought though is it is better to make your require(devtools)
install_github("swish-climate-impact-assessment/awaptools", ref = "develop")
require(awaptools)
require(rgdal)
workdir <- "data"
setwd(workdir)
startdate <- "2014-01-01"
enddate <- "2014-02-28"
load_monthly(start_date = startdate, end_date = enddate)
filelist <- dir(pattern = "grid.Z$")
for(fname in filelist){unzip_monthly(fname, aggregation_factor = 1)}
compress_gtifs(indir = getwd())
system("rm *.grid")
system("mv GTif/* ./") |
@ivanhanigan is there any reason to add the extra step to generate the GTiff files rather than just going straight to that step during the download? You're not giving the user an option to keep the .grid file if the first step only downloads and the second step/function does the unzipping and writes the GTiff file onto disk. If you do that we could download the .Z files to a tempdirectory , |
@adamhsparks Thanks, yes - no need to keep grid file so I'll try to
|
from @ahsparks
writeRaster(raster, file = "out location", format = "GTiff", dataType = "INT2S",
options = c("COMPRESS=LZW"))
to save space with GTiffs. Check all the options with dataType to see what works best. http://artax.karlin.mff.cuni.cz/r-help/library/raster/html/dataType.html
The text was updated successfully, but these errors were encountered: