0

I am working with a NetCDF file that has multiple subsets and each subset has multiple bands. I would like to take one subset and export each of the 28 bands into its own GeoTIFF. I thought that gdal_translate could do this via the -sds flag, which is described in GDAL documentation as "Copy all subdatasets of this file to individual output files. Use with formats like HDF that have subdatasets", however I guess this doesn't carry over to bands as well. This command:

gdal_translate -of GTiff -s_srs epsg:4326 -a_nodata = 0.0 -sds NETCDF:"oscar_vel2020_180.nc":u temp.tif

generates the terminal prompt >.

How might I export each of the bands from the subset of the NetCDF file into its own GeoTIFF?

asked May 18, 2020 at 5:40

1 Answer 1

1

First, I think you are getting the terminal prompt because you added a = in the commandline after -a_nodata. There should just be a space there.

Aside from that, you should be able to extract one of the bands from the subdataset "NETCDF:oscar_vel2020_180.nc:u" by using the -b switch in gdal_translate. Bands are numbered starting from 1 (see the documentation for more info).

answered Sep 5, 2020 at 17:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.