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

Constructing Rasters Fails on 0.8.0 #463

Closed
JoshuaBillson opened this issue Jun 9, 2023 · 5 comments
Closed

Constructing Rasters Fails on 0.8.0 #463

JoshuaBillson opened this issue Jun 9, 2023 · 5 comments

Comments

@JoshuaBillson
Copy link
Contributor

It seems that I'm unable to construct a Raster in the latest version of Rasters.jl (0.8.0).

Here is a working example:

using Fetch, Rasters

link = "https://drive.google.com/file/d/15CPQ4R5XQeIeCKcxkLFkMVBgrSkre4kt/view?usp=sharing"

gdownload(link, pwd())

Raster(joinpath(pwd(), "LC08_L1TP_043024_20200802_20200802_01_RT_B4.TIF"))

And this is the error output when executing the last line in the above code:

ERROR: Run `import ArchGDAL` to read /Users/jmbillson/Julia/rastertest/LC08_L1TP_043024_20200802_20200802_01_RT_B4.TIF
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] _open(f::Function, T::Type, filename::String; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Rasters ~/.julia/packages/Rasters/IELXJ/src/sources/sources.jl:62
 [3] _open(f::Function, T::Type, filename::String)
   @ Rasters ~/.julia/packages/Rasters/IELXJ/src/sources/sources.jl:60
 [4] #_open#186
   @ ~/.julia/packages/Rasters/IELXJ/src/sources/sources.jl:58 [inlined]
 [5] _open
   @ ~/.julia/packages/Rasters/IELXJ/src/sources/sources.jl:57 [inlined]
 [6] #Raster#52
   @ ~/.julia/packages/Rasters/IELXJ/src/array.jl:303 [inlined]
 [7] Raster(filename::String)
   @ Rasters ~/.julia/packages/Rasters/IELXJ/src/array.jl:299
 [8] top-level scope
   @ REPL[4]:1
@rafaqz
Copy link
Owner

rafaqz commented Jun 9, 2023

Did you read the error??

It literally contains the code to fix the problem. We have extensions now in 1.9 so load time is way faster, you just need to load packages you need explicitly.

@JoshuaBillson
Copy link
Contributor Author

Yes, I read the error. I assumed that Rasters ~/.julia/packages/Rasters/IELXJ/src/array.jl:299 meant that array.jl:299 was executing a method which relies on ArchGDAL but it was not imported by Rasters.jl. Thus, I assumed the fix was to import ArchGDAL on our end. It is not at all obvious that Run import ArchGDAL was a message intended for the end user.

Would it be possible to have a more useful error message given the move to extensions? I think this is going to confuse a lot of users unless we get ahead of it.

Also, while I now see that the docs have been updated to reflect this change, it is not immediately apparent unless one is specifically looking for it. Perhaps we could add information boxes to draw the user's attention to this change, as was done in FluxML when they introduced explicit gradients. I'd be happy to modify the docs accordingly if there's an appropriate fork for me to work on. Otherwise, I could create a new fork from main.

@rafaqz
Copy link
Owner

rafaqz commented Jun 9, 2023

Yeah thats just a random thing I wrote, sorry its not clearer. Julia 1.9 does not provide a canonical error for loading extension packages so we are all just making somerhing up.

If you have something better please PR!

Its good to understand this package as a part time project of someone doing a PhD and maintaining 40+ other packages. Things like this are unlikely to be polished and any input you have is very valuable, but best made through PRs that improve things directly.

@rafaqz
Copy link
Owner

rafaqz commented Jun 9, 2023

I will try to get a PR into base with a standard error message for this.

@JoshuaBillson
Copy link
Contributor Author

I've opened a PR with the updated error message.

@rafaqz rafaqz closed this as completed Jul 3, 2023
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