-
Notifications
You must be signed in to change notification settings - Fork 34
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
Problem detecting a source file type #356
Comments
Yeah, we should be able to choose the backend manually. We could also look at detecting file types from the file header, but that's a big job. If you want to fix the keyword propagation a PR would be great. |
I have almost no experience with julia, besides reading a bunch of tutorials and following examples, but I can give it a try. This should not be too difficult, I guess. My immediate suggestion would be to change the keyword argument |
I think the problem is smaller than that - what you are describing should already propagate So somewhere in the that stack trace between line 23 and 18 the chain of Then make a test in test/ncdatasets.jl where you rename a file to a weird extension and then set the source to NCDfile manually, so it can't break again. I will help tidy up in review, just see if you can get your files loading. |
I see some inconsistencies here. For example, in
So, even if to provide |
Right, yes that looks like a bug. Fix the propagation of |
you can now use |
I am working with a general circulation model which uses netCDF files with different weird file name extensions as inputs and outputs (e.g. .nc3 or .nc4 to distinguish between netCDF3/4). These files can't be loaded into Raster/RasterStack, since source type is derived by a
_sourcetype(...)
function insrc/convenience.jl
from file name extension, which is .nc for netCDF files, and it defaults to GDAL type. When I use asource=Rasters.NCDfile
keyword, this does not work either, because this keyword does not propagate down into sub-calls of RasterStack(), and_open(...)
insrc/convenience.jl
again tries to derive source type from_sourcetype(filename)
and calls GDAL loader instead of netCDF loader. Here is a complete traceback:If I change a file name extension of source file to .nc, it is loaded without problems. A quick solution to this issue would be to add more extensions to
EXT
andREV_EXT
structures insrc/convenience.jl
, but this would be incomplete solution. A better solution would be to modifyRaster(...)
,RasterStack(...)
,_open(...)
and other functions which rely on source type such that it is derived from user input if the input is not empty or file name extension in the other case.The text was updated successfully, but these errors were encountered: