Skip to content

Commit

Permalink
address #700
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Aug 26, 2024
1 parent 6fb7207 commit 123db33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/mdim.R
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,14 @@ st_as_cdl = function(x) {
for (i in seq_along(x))
x[[i]] = add_attr(x[[i]], co)

x = add_units_attr(x) # unclasses
x = add_units_attr(x) # unclasses x
for (i in seq_along(x))
if (is.null(names(dim(x[[i]])))) # FIXME: read_ncdf() doesn't name dim
if (is.null(names(dim(x[[i]])))) # FIXME: read_ncdf() doesn't name array dim
names(dim(x[[i]])) = names(d)
for (i in names(e))

for (i in names(e)) # copy over dimension values
x[[i]] = e[[i]]

which_dims = function(a, dimx) {
m = match(names(dim(a)), names(dimx), nomatch = numeric(0)) - 1
if (all(is.na(m)))
Expand Down Expand Up @@ -419,6 +421,8 @@ write_mdim = function(x, filename, driver = detect.driver(filename), ...,
root_group_options = character(0), options = character(0),
as_float = TRUE) {

if (inherits(x, "stars_proxy"))
x = st_as_stars(x)
cdl = st_as_cdl(x)
wkt = if (is.na(st_crs(x)))
character(0)
Expand Down

0 comments on commit 123db33

Please sign in to comment.