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

Conversion to pointer not defined for ArchGDAL.IRasterBand #679

Open
asinghvi17 opened this issue Jun 7, 2024 · 3 comments
Open

Conversion to pointer not defined for ArchGDAL.IRasterBand #679

asinghvi17 opened this issue Jun 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@asinghvi17
Copy link
Contributor

https://github.com/MakieOrg/GeoMakie.jl/actions/runs/9416699971/job/25940377394#step:8:60

Stacktrace is:

ras = Raster(EarthEnv{HabitatHeterogeneity}, :homogeneity)
│ 
│   exception =
│    conversion to pointer not defined for ArchGDAL.IRasterBand{UInt16}
│    Stacktrace:
│      [1] error(s::String)
│        @ Base ./error.jl:35
│      [2] unsafe_convert(::Type{Ptr{UInt16}}, a::ArchGDAL.IRasterBand{UInt16})
│        @ Base ./pointer.jl:67
│      [3] unsafe_convert(::Type{Ptr{Nothing}}, a::ArchGDAL.IRasterBand{UInt16})
│        @ Base ./pointer.jl:66
│      [4] gdalgetrasternodatavalue(arg1::ArchGDAL.IRasterBand{UInt16}, arg2::Base.RefValue{Int32})
│        @ GDAL ~/.julia/packages/GDAL/hNyuz/src/libgdal.jl:9666
│      [5] missingval(::ArchGDAL.RasterDataset{UInt16, ArchGDAL.Dataset})
│        @ RastersArchGDALExt ~/.julia/packages/Rasters/3wmT2/ext/RastersArchGDALExt/gdal_source.jl:267
│      [6] _fix_missingval(A::ArchGDAL.RasterDataset{UInt16, ArchGDAL.Dataset}, ::Rasters.NoKW)
│        @ Rasters ~/.julia/packages/Rasters/3wmT2/src/array.jl:336
│      [7] (::Rasters.var"#53#54"{Rasters.NoKW, Rasters.NoKW, Rasters.NoKW, Rasters.NoKW, Rasters.NoKW, Rasters.NoKW, Rasters.GDALsource, Bool, Bool, Bool, String, Symbol})(var::ArchGDAL.RasterDataset{UInt16, ArchGDAL.Dataset})
│        @ Rasters ~/.julia/packages/Rasters/3wmT2/src/array.jl:315
│      [8] _open(f::Rasters.var"#53#54"{Rasters.NoKW, Rasters.NoKW, Rasters.NoKW, Rasters.NoKW, Rasters.NoKW, Rasters.NoKW, Rasters.GDALsource, Bool, Bool, Bool, String, Symbol}, ::Rasters.GDALsource, ds::ArchGDAL.RasterDataset{UInt16, ArchGDAL.Dataset}; kw::@Kwargs{name::Symbol, group::Rasters.NoKW})
│        @ RastersArchGDALExt ~/.julia/packages/Rasters/3wmT2/ext/RastersArchGDALExt/gdal_source.jl:117
│      [9] Rasters.Raster(ds::ArchGDAL.RasterDataset{UInt16, ArchGDAL.Dataset}, filename::String; dims::Rasters.NoKW, refdims::Tuple{}, name::Symbol, group::Rasters.NoKW, metadata::Rasters.NoKW, missingval::Rasters.NoKW, crs::Rasters.NoKW, mappedcrs::Rasters.NoKW, source::Rasters.GDALsource, replace_missing::Bool, write::Bool, lazy::Bool, dropband::Bool)
│        @ Rasters ~/.julia/packages/Rasters/3wmT2/src/array.jl:313
│     [10] (::Rasters.var"#50#51"{Rasters.GDALsource, @Kwargs{name::Symbol, crs::Rasters.NoKW}, String})(ds::ArchGDAL.RasterDataset{UInt16, ArchGDAL.Dataset})
│        @ Rasters ~/.julia/packages/Rasters/3wmT2/src/array.jl:293
│     [11] call_composed(fs::Tuple{Rasters.var"#50#51"{Rasters.GDALsource, @Kwargs{name::Symbol, crs::Rasters.NoKW}, String}}, x::Tuple{ArchGDAL.RasterDataset{UInt16, ArchGDAL.Dataset}}, kw::@Kwargs{})
│        @ Base ./operators.jl:1045
│     [12] call_composed
│        @ ./operators.jl:1044 [inlined]
│     [13] (::ComposedFunction{typeof(Rasters.cleanreturn), Rasters.var"#50#51"{Rasters.GDALsource, @Kwargs{name::Symbol, crs::Rasters.NoKW}, String}})(x::ArchGDAL.RasterDataset{UInt16, ArchGDAL.Dataset}; kw::@Kwargs{})
│        @ Base ./operators.jl:1041
│     [14] readraster(f::ComposedFunction{typeof(Rasters.cleanreturn), Rasters.var"#50#51"{Rasters.GDALsource, @Kwargs{name::Symbol, crs::Rasters.NoKW}, String}}, args::String; kwargs::@Kwargs{})
│        @ ArchGDAL ~/.julia/packages/ArchGDAL/AZONk/src/context.jl:267
│     [15] readraster(f::Function, args::String)
│        @ ArchGDAL ~/.julia/packages/ArchGDAL/AZONk/src/context.jl:2[64](https://github.com/MakieOrg/GeoMakie.jl/actions/runs/9416699971/job/25940377394#step:8:65)
│     [16] _open(f::Function, ::Rasters.GDALsource, filename::String; write::Bool, kw::@Kwargs{})
│        @ RastersArchGDALExt ~/.julia/packages/Rasters/3wmT2/ext/RastersArchGDALExt/gdal_source.jl:114
│     [17] _open
│        @ ~/.julia/packages/Rasters/3wmT2/ext/RastersArchGDALExt/gdal_source.jl:90 [inlined]
│     [18] #_open#14
│        @ ~/.julia/packages/Rasters/3wmT2/src/sources/sources.jl:77 [inlined]
│     [19] Rasters.Raster(filename::String; source::Rasters.NoKW, kw::@Kwargs{name::Symbol, crs::Rasters.NoKW})
│        @ Rasters ~/.julia/packages/Rasters/3wmT2/src/array.jl:292

Package versions:

   Installed GDAL_jll ──────────────────── v301.900.0+0
   Installed ArchGDAL ──────────────────── v0.9.3

and master of Rasters.

Could be that the old ArchGDAL version is the issue? Not sure.

@asinghvi17
Copy link
Contributor Author

This works with ArchGDAL and Rasters at master:
https://geo.makie.org/previews/PR230/examples/rasters

@rafaqz
Copy link
Owner

rafaqz commented Jun 8, 2024

Master of both or just here?

@asinghvi17
Copy link
Contributor Author

asinghvi17 commented Jun 8, 2024

Ah sorry, it's the la/compacts branch here (Makie compat) and the master branch of ArchGDAL that it works on.

@rafaqz rafaqz added the bug Something isn't working label Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants