Robert,
Thank you for your message. First thing, raster package is simply amazing.
I've installed raster v2.2-16.
I've imported the TIF from the dropbox link with
i.l8 <- raster('D:\\Dropbox\\Public\\LC81810682013122LGN01_B2.TIF',
package = "raster")
class : RasterLayer
dimensions : 7311, 7521, 54986031 (nrow, ncol, ncell)
resolution : 30, 30 (x, y)
extent : 370485, 596115, -1388715, -1169385 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=33 +datum=WGS84 +units=m +no_defs
+ellps=WGS84 +towgs84=0,0,0
data source : D:\Dropbox\Public\LC81810682013122LGN01_B2.TIF
names : LC81810682013122LGN01_B2
values : 0, 65535 (min, max)
I'm also able to generate a RST file from the rasterLayer i.l8 with
writeRaster(band, filename = 'D:\\l8_b2.rst', format = 'IDRISI', overwrite
= TRUE)
IDRISI Taiga can read the RST file but the file format is tagged as "IDRISI
x A1" and not "IDRISI Raster A1"
I still not being able to generate the RST file with
writeRaster(band, filename = 'D:\\l8_b2.rst', format = 'RST', overwrite =
TRUE)
Error in .local(.Object, ...) : Unable to create dataset
But it works fine with writeGDAL:
writeGDAL(as(i.l8, "SpatialGridDataFrame"), fname = "D:\l8_gdal.rst",
drivername = "RST")
IDRISI Taiga read it and tag the file format as "IDRISI Raster A1", just
like the ones generated internally with import functions from IDRISI.
writeRaster with format = 'IDRISI' generetes a 230,732 MB idrisi file while
a 214,790 MB file is generated with writeGDAL and drivername = 'RST'
I can't figure out why.
Paulo Eduardo Cardoso
2014-01-27 Robert Hijmans [via R-sig-geo] <
ml-node+s2731867n7585643h37 at n2.nabble.com>
Hello all. Thanks for your time.
Robert, True about format, but 'IDRISI' file format is also there and
used format = 'IDRISI' ultil recently, and it was working just fine with
exactly the same procedure.
About running scripts from RStudio and R console, I'm not skilled enough
understand the differences.
in my system, writeFormats() returns:
name long_name
[1,] "raster" "R-raster"
[2,] "SAGA" "SAGA GIS"
[3,] "IDRISI" "IDRISI"
...
[36,] "RST" "Idrisi Raster A.1"
With older versions of raster package, the argument format='IDRISI' also
produced 'IDRISI Raster A.1' files.
Latest version in fact is not accepting format = 'IDRISI' for the
RasterLayer created from reading the 16 bis Landsat TIF file and is
returning the error:
Error in .setFileExtensionHeader(filename, filetype) : unknown file
Changing to format = 'RST' isn't better. I get the error:
Error in .local(.Object, ...) : Unable to create dataset
The behavior is the same running this from within RStudio and from the
the link to the landast image (107Mb).
For the resulting RasterLayer
GDALinfo('...\\LC81810682013122LGN01_B2.tif')
rows 7311
columns 7521
bands 1
lower left origin.x 370485
lower left origin.y -1388715
res.x 30
res.y 30
ysign -1
oblique.x 0
oblique.y 0
driver GTiff
projection +proj=utm +zone=33 +datum=WGS84 +units=m +no_defs
file C:\Users\Strix\Downloads\LC81810682013122LGN01_B2.tif
apparent band summary:
GDType hasNoDataValue NoDataValue blockSize1 blockSize2
1 UInt16 FALSE 0 1 7521
apparent band statistics:
Bmin Bmax Bmean Bsd
1 0 65535 NA NA
Metadata:
AREA_OR_POINT=Point
Warning message:
statistics not supported by this driver
Eddie, I generally do not use setwd when sharing scripts with
usually define paths to some shared folder. It's not working anyway.
sessionInfo string you will se that I'm running rgdal.
Could it be something with rgdal (and gdal) installation after package
update? For a similar problem
<
users suggests re-install of rgdal, gdal and its libraries.
--
View this message in context:
Sent from the R-sig-geo mailing list archive at Nabble.com.