-
Notifications
You must be signed in to change notification settings - Fork 97
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
Error with mdim
test: Error: cannot open driver
#692
Comments
mdim
test: Error: cannot open driver
mdim
test: Error: cannot open driver
The same failure occurs with examples:
|
I'm seeing Sys.setenv(TZ="")
library(stars)
# Loading required package: abind
# Loading required package: sf
# Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.3.1; sf_use_s2() is TRUE
m = matrix(1:4,2)
s = st_as_stars(m)
s = st_set_dimensions(s, st_dimensions(s), xy = NULL)
sfc = st_sfc(st_point(0:1), st_point(3:2))
s = st_set_dimensions(s, 1, sfc) |> st_set_crs(4326)
tm = as.POSIXct("2023-03-04 12:35") + c(0, 3600)
s = st_set_dimensions(s, 2, tm)
f = tempfile(fileext = ".nc")
write_mdim(s, f, as_float = FALSE)
# Warning messages:
# 1: In CPL_write_mdim(file, driver, dimx, cdl, wkt, xy, root_group_options, :
# GDAL Error 6: SetIndexingVariable() not implemented
# 2: In CPL_write_mdim(file, driver, dimx, cdl, wkt, xy, root_group_options, :
# GDAL Error 6: SetIndexingVariable() not implemented
read_mdim(f)
# stars object with 2 dimensions and 1 attribute
# attribute(s):
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# A1 1 1.75 2.5 2.5 3.25 4
# dimension(s):
# from to offset delta refsys point
# X1 1 2 NA NA WGS 84 TRUE
# X2 1 2 2023-03-04 12:35:00 UTC 1 hours POSIXct NA
# values
# X1 POINT (0 1), POINT (3 2)
# X2 NULL Is this a GDAL version issue? |
@edzer Perhaps 3.9.0 is not too old? https://ports.macports.org/port/gdal |
It's not about the age, but about how GDAL was built: linked against libnetcdf, or not. If not, the netcdf driver is missing and you get errors of this type. |
@edzer I am building GDAL now with netcdf support enabled. Once confirmed tests pass then, I will close both issues as resolved. P. S. Perhaps it is worth adding a note about this requirement though. Currently nothing is said about GDAL being linked to netcdf: https://cran.r-project.org/web/packages/stars/index.html |
I could add a message at startup time of |
That will be helpful, I think. |
@edzer Files are now found, but specifically
But it looks like it is using All other tests now pass (with |
Any idea why this may be failing?
The text was updated successfully, but these errors were encountered: