JuliaDataCubes / JuliaDataCubes/YAXArrayBase.jl
Can't save subset data to tif
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 3
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to save a small data cube that is a subset of a larger tif to a new tif and I get the following error:
The data itself has a X and Y dimension but it seems that the dimnames are reversed in the YAB.create_dataset function for some reason.
This is based on the EODC Sentinel-1 data.
julia> savecube(s, filename, overwrite=true)
ERROR: Did not find x, y or lon, lat dimensions in dataset
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] create_dataset(::Type{…}, outpath::String, gatts::Dict{…}, dimnames::Vector{…}, dimvals::Vector{…}, dimattrs::Vector{…}, vartypes::Vector{…}, varnames::Vector{…}, vardims::Vector{…}, varattrs::Vector{…}, varchunks::Vector{…}; userproj::Nothing, kwargs::@Kwargs{})
@ ArchGDALExt ~/.julia/packages/YAXArrayBase/M48vP/ext/ArchGDALExt/archgdaldataset.jl:174
[3] create_dataset(::Type{…}, outpath::String, gatts::Dict{…}, dimnames::Vector{…}, dimvals::Vector{…}, dimattrs::Vector{…}, vartypes::Vector{…}, varnames::Vector{…}, vardims::Vector{…}, varattrs::Vector{…}, varchunks::Vector{…})
@ ArchGDALExt ~/.julia/packages/YAXArrayBase/M48vP/ext/ArchGDALExt/archgdaldataset.jl:140
[4] savedataset(ds::Dataset; path::String, persist::Nothing, overwrite::Bool, append::Bool, skeleton::Bool, backend::Symbol, driver::Symbol, max_cache::Float64, writefac::Float64, kwargs::@Kwargs{})
@ YAXArrays.Datasets /mnt/felix1/worldmap/dev/YAXArrays/src/DatasetAPI/Datasets.jl:687
[5] savedataset
@ /mnt/felix1/worldmap/dev/YAXArrays/src/DatasetAPI/Datasets.jl:637 [inlined]
[6] savecube(c::YAXArray{…}, path::String; layername::String, datasetaxis::String, max_cache::Float64, backend::Symbol, driver::Symbol, chunks::Nothing, overwrite::Bool, append::Bool, skeleton::Bool, writefac::Float64, kwargs::@Kwargs{})
@ YAXArrays.Datasets /mnt/felix1/worldmap/dev/YAXArrays/src/DatasetAPI/Datasets.jl:753
[7] top-level scope
@ REPL[94]:1
Some type information was truncated. Use `show(err)` to see complete types.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ext/ArchGDALExt/archgdaldataset.jl around create_dataset at line 174, then trace the dimnames passed from YAXArrays.Datasets.savedataset and savecube. Reproduce the failure with the Sentinel-1 subset and inspect the X and Y dimension names. Done means the subset saves to a new tif without the dimension error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100