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?

lovelyvm
  • 517
  • 1
  • 6
  • 16
  • I think you are using it wrong, but it would be easier to say what the real command line would be if you can post the exact name of the file, the output of gdalinfo for that file, and the exact command you are trying to use. Please edit the question with this important detail. – BradHards Jun 29 '15 at 09:58
  • This is one for the gdal-devs, point them to details about the format change to netcdf4: http://oceancolor.gsfc.nasa.gov/DOCS/FormatChange.html Possibly also this exchange could give you some clues, but I'm not hopeful about it: http://lists.osgeo.org/pipermail/gdal-dev/2015-February/040973.html – mdsumner Jun 29 '15 at 09:58
  • the file is this one: http://oceandata.sci.gsfc.nasa.gov/cgi/getfile/A2015069000500.L2_LAC_OC.nc available here http://oceandata.sci.gsfc.nasa.gov/MODISA/L2/2015/069/ via navigation from http://oceandata.sci.gsfc.nasa.gov/ – mdsumner Jun 29 '15 at 09:59

1 Answers1

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.

Kersten
  • 9,899
  • 3
  • 37
  • 59