diff --git a/ext/RbaseTerraExt/RbaseTerraExt.jl b/ext/RbaseTerraExt/RbaseTerraExt.jl index f492bd3..4854739 100644 --- a/ext/RbaseTerraExt/RbaseTerraExt.jl +++ b/ext/RbaseTerraExt/RbaseTerraExt.jl @@ -132,9 +132,9 @@ function NetCDFTools.coverage_fraction(f, shp; union=false) """ |> rcopy # return a mask, true is inside - data = nc_read(f, ind=(:, :, 1)) # time should be in the last - - mask = falses(size(data)) + dims = length.(nc_dims(f)[1:2]) + # data = nc_read(f, ind=(:, :, 1)) # time should be in the last + mask = falses(dims) mask[info.cell] .= true info, mask end diff --git a/src/nc_dim.jl b/src/nc_dim.jl index 29e7848..7786ec4 100644 --- a/src/nc_dim.jl +++ b/src/nc_dim.jl @@ -19,6 +19,7 @@ function Ipaper.names(dims::Vector{NcDim}) map(x -> x.name, dims) end +Base.length(dim::NcDim) = dim.dimlen function find_dim(dims::Vector{NcDim}, name::AbstractString) names = Ipaper.names(dims)