[R-sig-Geo] Sentienl 2 gdal translate

Miguel Castro Gómez castrog.miguelg at gmail.com
Wed Mar 15 19:49:30 CET 2017


Hi,

I have Sentinel 2 images (jp2) that I want to convert to GTiff using gdal_translate in R (from gdalutils package). Here is the code I’m using

Image_Path<-“/path/to/wd“

S2_JP2_List <- list.files(Image_Path, full.names = TRUE, pattern = ".jp2$")

for (i in 1:length(S2_JP2_List)) {
gdal_translate(src_dataset = S2_JP2_List[[i]], dst_dataset = paste("Band", i , "tif"), ot = "UInt16", of = “GTiff")
    }

When running this code, the process starts without any error but its never ending neither producing any output

I've tried to do it in gdal and the same code works, except that it is necessary to skip  the default driver since it cannot manage large jp2 files. 

gdal_translate -of GTiff /path/to/input/S2_b1.jp2  /path/to/output/S2_b1converted.tif --config GDAL_SKIP JP2ECW

Any idea how could I run this in R?

Thanks 
M



	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list