Skip to content
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

Unable to open Zarr files #658

Closed
silasprincipe opened this issue Dec 13, 2023 · 3 comments
Closed

Unable to open Zarr files #658

silasprincipe opened this issue Dec 13, 2023 · 3 comments

Comments

@silasprincipe
Copy link

Hi,

I'm trying to open Zarr files following this tutorial from r-spatial. I execute exactly the same code provided:

library(stars)
dsn = 'ZARR:"/vsicurl/https://ncsa.osn.xsede.org/Pangeo/pangeo-forge/gpcp-feedstock/gpcp.zarr"'
bounds = c(longitude = "lon_bounds", latitude = "lat_bounds")
r = read_mdim(dsn, bounds = bounds)

However, I receive the following error:

Error in CPL_read_mdim(file, array_name, options, offset, count, step,  : 
  CHAR() can only be applied to a 'CHARSXP', not a 'NULL'
In addition: Warning messages:
1: In CPL_read_mdim(file, array_name, options, offset, count, step,  :
  GDAL Error 1: Decompressor blosc not handled
2: In CPL_read_mdim(file, array_name, options, offset, count, step,  :
  GDAL Error 1: Decompressor blosc not handled
3: In CPL_read_mdim(file, array_name, options, offset, count, step,  :
  GDAL Error 1: Decompressor blosc not handled
4: In CPL_read_mdim(file, array_name, options, offset, count, step,  :
  GDAL Error 1: Decompressor blosc not handled
5: In CPL_read_mdim(file, array_name, options, offset, count, step,  :
  GDAL Error 1: Decompressor blosc not handled
6: In CPL_read_mdim(file, array_name, options, offset, count, step,  :
  GDAL Error 1: Decompressor blosc not handled
7: In CPL_read_mdim(file, array_name, options, offset, count, step,  :
  GDAL Error 1: Decompressor blosc not handled

I'm using stars version 0.6.4 with GEOS 3.12.1, GDAL 3.8.1 and PROJ 9.3.1.

Do you have any idea of what may be the problem? I appreciate any help in advance!

Session info:

R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.4.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Brussels
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] stars_0.6-4 sf_1.0-14   abind_1.4-5

loaded via a namespace (and not attached):
 [1] terra_1.7-55       vctrs_0.6.3        cli_3.6.1          rlang_1.1.1        DBI_1.1.3          KernSmooth_2.23-21 generics_0.1.3     glue_1.6.2         e1071_1.7-13      
[10] fansi_1.0.4        grid_4.3.1         classInt_0.4-9     tibble_3.2.1       lifecycle_1.0.3    compiler_4.3.1     dplyr_1.1.3        codetools_0.2-19   Rcpp_1.0.11       
[19] pkgconfig_2.0.3    rstudioapi_0.15.0  R6_2.5.1           class_7.3-22       tidyselect_1.2.0   utf8_1.2.3         pillar_1.9.0       parallel_4.3.1     magrittr_2.0.3    
[28] tools_4.3.1        proxy_0.4-27       units_0.8-3 
@edzer
Copy link
Member

edzer commented Dec 13, 2023

Your GDAL installation was apparently not compiled with blosc, the compressor used for this particular Zarr file. This means you cannot read such zarr files, you can read zarr files that do not use this compressor. Did you install R packages, in particular sf, as binary from CRAN, as binary from somewhere else, or from source?

@silasprincipe
Copy link
Author

Hi @edzer, thanks for the response. I reinstalled sf using the guidelines of the sf website, because it was not using the most recent version of gdal. Before that I was also unable to open zarr files, and I thought that it could be due to the gdal version. I tried to first just update the package by installing from CRAN, but the previous gdal version was kept.

I did the following:

brew install pkg-config
brew install gdal

And then:

install.packages("sf", type = "source", configure.args = "--with-proj-lib=$(brew --prefix)/lib/")

@edzer
Copy link
Member

edzer commented Dec 13, 2023

Through that route, your only hope is if the maintainers of the gdal brew add blosc to it.

@edzer edzer closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants