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

NetCDF interoperability #134

Closed
alex-s-gardner opened this issue Mar 2, 2022 · 6 comments · Fixed by #140
Closed

NetCDF interoperability #134

alex-s-gardner opened this issue Mar 2, 2022 · 6 comments · Fixed by #140

Comments

@alex-s-gardner
Copy link

alex-s-gardner commented Mar 2, 2022

I'm running into issues trying to use gdal_translate with GDAL.jl

using GDAL 3.4.0, released 2021/11/04 from the terminal I can run the following without issue
gdal_translate -of COG NETCDF:"/path/to/file.nc":v /path/to/file.tif

using GDAL.jl I try the same as:

GDAL.gdal_translate_path() do gdal_translate
  run(`$gdal_translate -of COG NETCDF:\"/path/to/file.nc\":v /path/to/file.tif`)
end

returns the error:
NETCDF:"/path/to/file.nc":v: No such file or directory

Not sure if this has anything to do with the handling of \" or not

any insights would be greatly appreciated.

I also have similar issues when trying to build vrts from netcdf files

@visr
Copy link
Member

visr commented Mar 2, 2022

The reason this fails is because the GDAL build we use is currently not built against libnetcdf, which is needed to add netCDF support. The dependencies that we do use can be found in https://github.com/JuliaPackaging/Yggdrasil/tree/master/G/GDAL
in build_tarballs.jl under dependencies.

There is a NetCDF_jll that we could try to add there. However it is plagued by issues like JuliaPackaging/Yggdrasil#4511, because there is no good cross compilation support. So it's probably best to wait adding such a dependency until it is relatively stable.

See also #65 for discussion on which formats to support.

@alex-s-gardner
Copy link
Author

@visr thanks for the info and all the work on this. This is disappointing as much (most) remote sensing and climate data is packaged as netCDF's. Any where I should post to bump up inclusion... or will this just happen naturally over time and I should just be patient, or learn to do it myself, cuz everyone is doing the best they can.

@visr
Copy link
Member

visr commented Mar 2, 2022

Note that there are netCDF packages like NCDatasets.jl. And Rasters.jl depends on that as well as GDAL, so that could be a bridge between netCDF and other geospatial formats.

Of course nothing really happens automatically, unless someone puts in the effort. You could have a look through the issue I linked and related issues. Though it mostly comes down to (cross) compiling C++ codes, which I also don't know much about. Probably it would also help if your organization has support with HDFGroup to ask them for support with JuliaPackaging/Yggdrasil#567 / HDFGroup/hdf5#1203.

@alex-s-gardner
Copy link
Author

OK, thanks for the thoughts... let me do some poking around NASA and see if I can find out if they have any interest in supporting this

@Rapsodia86
Copy link

@alex-s-gardner Any news?

@evetion
Copy link
Member

evetion commented Sep 12, 2022

While there still needs to be better cross compilation support, the latest GDAL_jll should have NetCDF and HDF5 support on the most common platforms.

JuliaPackaging/Yggdrasil#5466

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

Successfully merging a pull request may close this issue.

4 participants