rafaqz / Rasters.jl

Raster manipulation for the Julia language
MIT License
212 stars 36 forks source link

Dims not extracting band information #462

Closed ayushpatnaikgit closed 1 year ago

ayushpatnaikgit commented 1 year ago

Hi, I have a Raster which has 1 band.

julia> radiance_datacube                                                                                                          
84×155×123 Raster{Float32,3} unnamed with dimensions:                                                                             
  X Mapped{Float64} Float64[72.7250001018, 72.72916676850001, …, 73.0666667712, 73.0708334379] ForwardOrdered Explicit Intervals c
rs: EPSG mappedcrs: EPSG,                                                                                                         
  Y Mapped{Float64} Float64[19.495832889299994, 19.491666222599996, …, 18.858332884200003, 18.8541662175] ReverseOrdered Explicit 
Intervals crs: EPSG mappedcrs: EPSG,                                                                                              
  Ti Sampled{Int64} Int64[201204, 201205, …, 202205, 202206] ForwardOrdered Irregular Points                                      
and reference dimensions:                                                                                                         
  Band Categorical{Int64} Int64[1] ForwardOrdered                                                                                 
extent: Extent(X = (72.72291676845, 73.07291677125001), Y = (18.85208288415, 19.497916222649994), Ti = (201204, 202206))          
crs: EPSG:4326                                                                                                                    
mappedcrs: EPSG:4326

When I try

julia> dims(radiance_datacube)
X Mapped{Float64} Float64[72.7250001018, 72.72916676850001, …, 73.0666667712, 73.0708334379] ForwardOrdered Explicit Intervals crs: EPSG mappedcrs: EPSG,
Y Mapped{Float64} Float64[19.495832889299994, 19.491666222599996, …, 18.858332884200003, 18.8541662175] ReverseOrdered Explicit Intervals crs: EPSG mappedcrs: EPSG,
Ti Sampled{Int64} Int64[201204, 201205, …, 202205, 202206] ForwardOrdered Irregular Points

It doesn't give the Band. I believe in an earlier version, it used to give the Band information.

rafaqz commented 1 year ago

Yes I dropped the single band dimension because people were complaining about it! I think that was part of the 0.7 breaking release.

You can keep it with the dropband=false keyword if you want to.

ayushpatnaikgit commented 1 year ago

Thanks!

Lots of changes since I last looked :)