From a8635465d3e95f76c40c71ebaca7ff23125e986e Mon Sep 17 00:00:00 2001 From: edzer Date: Fri, 5 Jan 2024 23:42:17 +0100 Subject: [PATCH] return data.frame for composit data; #659 --- R/mdim.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/mdim.R b/R/mdim.R index 898897dd..dae61767 100644 --- a/R/mdim.R +++ b/R/mdim.R @@ -128,6 +128,10 @@ read_mdim = function(filename, variable = character(0), ..., options = character stopifnot(is.character(filename), is.character(variable), is.character(options)) ret = gdal_read_mdim(filename, variable, options, rev(offset), rev(count), rev(step), proxy, debug) + + if (length(ret$dimensions) == 1 && length(ret$array_list) == 1 && is.data.frame(ret$array_list[[1]])) + return(ret$array_list[[1]]) ## composite data: RETURNS + ret = recreate_geometry(ret) if (isTRUE(bounds) || is.character(bounds)) ret$dimensions = mdim_use_bounds(ret$dimensions, filename, bounds)