-
Notifications
You must be signed in to change notification settings - Fork 39
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
Read directly from tar archive in pre-processing functions #55
Comments
This doesn't work on Windows. It reads the string in literally and returns a |
Okay, I was sort of expecting that... What does the string look like? Could you try replacing the forward slashes of |
It appends |
I see. Then you probably have to escape the two first slashes, surrounding vsizip. |
on mac it does not complain (no error) but the string/path does not make sense: > tarPath <- list.files(system.file('external', package='bfastSpatial'), full.names = TRUE)[1]
> raster(sprintf('/vsizip/%s/%s', tarPath, 'LE70230282011250EDC00_sr_band1.tif'))
class : RasterLayer
dimensions : 243, 258, 62694 (nrow, ncol, ncell)
resolution : 30, 30 (x, y)
extent : 498765, 506505, 5081145, 5088435 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=16 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : /vsizip//Users/verbe039/Library/R/3.2/library/bfastSpatial/external/LE70230282011250EDC00_sub.zip/LE70230282011250EDC00_sr_band1.tif
names : LE70230282011250EDC00_sr_band1 What is your objective with : ? > sprintf('/vsizip/%s/%s', tarPath, 'LE70230282011250EDC00_sr_band1.tif')
[1] "/vsizip//Users/verbe039/Library/R/3.2/library/bfastSpatial/external/LE70230282011250EDC00_sub.zip/LE70230282011250EDC00_sr_band1.tif" |
You can read in directly as a virtual file system. See https://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip But it's not clear to me yet how this works in windows. |
Did you try this Ben? library(bfastSpatial)
tarPath <- list.files(system.file('external', package='bfastSpatial'), full.names = TRUE)[1]
raster(sprintf('\/vsizip\/%s/%s', tarPath, 'LE70230282011250EDC00_sr_band1.tif')) |
Works on linux, don't know about windows
The text was updated successfully, but these errors were encountered: