Skip to content
Prev 28460 / 29559 Next

Reporting an issue with rgdal in macOS BigSur

Dear Gilberto,
On Thu, 26 Nov 2020, GilbertoCamara wrote:

            
On MacOS and Windows, CRAN binary packages are built using static linking, 
for a number of reasons.  One is to limit installation difficulties, 
another to make support easier, as all users of a updated package/R 
version will be using the same set of external software components (of 
course, locales will vary, but most variables are fixed).
Please first check on running systems with pre-Big Sur and Big Sur that 
the returned lists of drivers match. Crucially, jp2 (Jpeg 2000) needs GDAL 
built against openjpeg. If one of the systems has GDAL built with the 
driver, and the other without, this outcome would be expected. I suspect 
that the Big Sur GDAL (or the CRAN MacOS rgdal binary) has 
missing/defective drivers.

For my Fedora 33 system with GDAL installed from source, I have:

drvs <- rgdal::gdalDrivers()$name; drvs[grep("JP2", drvs)]
## [1] "JP2OpenJPEG"

There are other JP2* drivers, but they need closed source libraries when 
GDAL itself is built, and cannot be redistributed from CRAN.
First, we need to be sure that the driver is present, then present and 
working.
This feels again like a driver mismatch. Please try with the CRAN MacOS 
binary package, for which 
https://cran.r-project.org/web/checks/check_results_rgdal.html looks 
clean. The examples for rgdal::readGDAL() include reading TIFF files, so 
are run in CRAN daily checks.

I have no access to any MacOS platform, so cannot do more than arm's 
length debug. My clear suspicion is that the GDAL you are using has 
drivers missing/defective. A small JP2 raster could be added to the 
examples to trap driver malfunction.

Best wishes,

Roger