Closed mlampros closed 4 years ago
Marvellous, thanks for the PR. I'll merge into 'develop' and check back with those guys that encountered problems.
Out of interest, are you running R >= 4.0.0
? I just want to rule out that this is related to recent changes in the default behavior of stringsAsFactors
.
Hi, I run the code of this PR in R version 3.6.3. Yes, you are right, a user having 4.0.0 installed will highly probable won't encounter this error as the default behaviour has changed to
stringsAsFactors = FALSE
Right. Still, a highly valuable PR - I didn't realize this was related to format changes in sf::st_drivers()
for different versions of R. Otherwise, I would have had to add R (>= 4.0.0)
to Depends, which I figure isn't particularly desirable.
First of all thanks for making this repository publicly available. This pull request fixes issues #93 and #92 The following is a reproducible example on Linux Mint 18.2
By running the previous code I received,
The error also revealed,
The output files in the temporary directory were all of type ".tif" (GTIFF driver).
The runGdal() function calls internally the sf::gdal_utils() function which takes params as input which normally should be a vector of parameters such as,
however it actually is
In the 'runGdal()' function the 'GTIFF' driver is assigned to the dataFormat variable which equals to
The checkGdalWriteDriver() function calls internally the getGdalWriteDrivers() function which in my case returns,
Therefore the nms variable,
is of type factor and rather than returning the driver as a character string (i.e. 'GTIFF') it returns the level position,
In this PR I converted the nms variable to a character string as the 'checkGdalWriteDriver()' function is called only once in the MODIS R package.