Skip to content
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

Can't save subset data to tif #37

Open
felixcremer opened this issue Feb 6, 2025 · 1 comment
Open

Can't save subset data to tif #37

felixcremer opened this issue Feb 6, 2025 · 1 comment

Comments

@felixcremer
Copy link
Member

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.
@lazarusA
Copy link
Collaborator

lazarusA commented Feb 6, 2025

Yeah, I kinda hard coded a specific case when I was fixing this in YAXArrayBase. And indeed is that X and Y ordering. I left a comment there 🫢... good luck 🤞. I don't have the bandwidth to fixed it at the moment.

Here:

# ? flip dimnames and dimvals, this needs a more generic solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants