1

I am using windows 7(32-bit) and want to warp NetCDF (nc) files and save the output as GeoTIFF.

First I run gdalinfo first to get the info of the subdataset I need and added NETCDF in the beginning(e.g. gdalinfo NETCDF:"A2015069035500.L2_LAC_OC.nc") but was unfortunate because a warning appeared:

Warning 1: Variable has 0 dimension(s) - not supported. gdalinfo failed - unable to open 'netCDF:A2015069035500.L2_LAC_OC.nc'.

Command line input:

gdalinfo A2015069035500.L2_LAC_OC.nc

NetCDF is present when I tried gdalinfo --formats.

Does anyone have any idea about this?

3

1 Answer 1

5

Your problem comes from adressing the subdatasets incorrectly.

If you run gdalinfo on the complete file it will display the names of the subdatasets:

SUBDATASET_1_NAME=HDF5:"A2015069000500.L2_LAC_OC.nc"://geophysical_data/Kd_490

To get the information of the first subdataset you need to feed the complete name into gdalinfo

gdalinfo HDF5:"A2015069000500.L2_LAC_OC.nc"://geophysical_data/Kd_490

Alternatively you can use the -sd option to adress a subdataset:

gdalinfo -sd 1 A2015069000500.L2_LAC_OC.nc

If you want to translate a subdataset from HDF5 to GeoTiff you'll also need to provide the full name of the subdataset:

gdal_translate HDF5:"A2015069000500.L2_LAC_OC.nc"://geophysical_data/Kd_490 subdataset1.tif

Additionally your product is HDF5 and not NetCDF, as specified in the Ocean Level-2 Data Products.

1
  • How will I batch process gdalwarp these HDF5 files?
    – lovelyvm
    Commented Jul 14, 2015 at 3:59

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.