[gdal-dev] Is it possible to modify netCDF driver so that it behaves like geotiff driver when operating on multiple datasets netcdf file

Hendy Sumanto hsumanto at vpac.org
Wed Mar 7 22:29:48 EST 2012


Hi Devs,

I have a geotiff file which contains several datasets, with this I just need to perform one gdalwarp operation on this geotiff file to apply transformation on 6 datasets inside it and the operation produces just one geotiff output file.

If I translate this geotiff file into netcdf file, now I need to perform 6 operations to apply transformation on each of the 6 datasets inside it and produces 6 separate netcdf files which is quite cumbersome. 

I am wondering if it is possible to modify the current netCDF driver so that it behaves like geotiff driver when operating on multiple bands (datasets) netcdf file.
Any opinion on this is really appreciated.

This might be a potential issue though: 
When the several datasets have the same data type, it is not an issue but
when the several datasets have different data type (some datasets are float while some other metadata are integer), then it might be an issue as when we do gdalwarp operation selecting one method of interpolation, that chosen interpolation method will be applied across all data types for all datasets in that single file.

=============================
gdalinfo on the geotiff file: and netcdf file:
=============================
Driver: GTiff/GeoTIFF
Files: multipledataset.tif
Size is 4, 3
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (141.000867233935992,-34.060737220013806)
Pixel Size = (0.107999999999998,-0.107999999999998)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( 141.0008672, -34.0607372) (141d 0' 3.12"E, 34d 3'38.65"S)
Lower Left  ( 141.0008672, -34.3847372) (141d 0' 3.12"E, 34d23' 5.05"S)
Upper Right ( 141.4328672, -34.0607372) (141d25'58.32"E, 34d 3'38.65"S)
Lower Right ( 141.4328672, -34.3847372) (141d25'58.32"E, 34d23' 5.05"S)
Center      ( 141.2168672, -34.2227372) (141d13' 0.72"E, 34d13'21.85"S)
Band 1 Block=4x3 Type=Float64, ColorInterp=Gray
Band 2 Block=4x3 Type=Float64, ColorInterp=Undefined
Band 3 Block=4x3 Type=Float64, ColorInterp=Undefined
Band 4 Block=4x3 Type=Float64, ColorInterp=Undefined
Band 5 Block=4x3 Type=Float64, ColorInterp=Undefined
Band 6 Block=4x3 Type=Float64, ColorInterp=Undefined

=============================
gdalinfo on the netcdf file:
=============================
Driver: netCDF/Network Common Data Format
Files: multipledataset.nc
Size is 512, 512
Coordinate System is `'
Metadata:
  NC_GLOBAL#Conventions=CF-1.5
  NC_GLOBAL#GDAL=GDAL 1.9.0, released 2011/12/29
  NC_GLOBAL#history=Thu Mar 08 14:03:01 2012: GDAL Create( multipledataset.nc, ... )
Subdatasets:
  SUBDATASET_1_NAME=NETCDF:"multipledataset.nc":Band1
  SUBDATASET_1_DESC=[3x4] Band1 (64-bit floating-point)
  SUBDATASET_2_NAME=NETCDF:"multipledataset.nc":Band2
  SUBDATASET_2_DESC=[3x4] Band2 (64-bit floating-point)
  SUBDATASET_3_NAME=NETCDF:"multipledataset.nc":Band3
  SUBDATASET_3_DESC=[3x4] Band3 (64-bit floating-point)
  SUBDATASET_4_NAME=NETCDF:"multipledataset.nc":Band4
  SUBDATASET_4_DESC=[3x4] Band4 (64-bit floating-point)
  SUBDATASET_5_NAME=NETCDF:"multipledataset.nc":Band5
  SUBDATASET_5_DESC=[3x4] Band5 (64-bit floating-point)
  SUBDATASET_6_NAME=NETCDF:"multipledataset.nc":Band6
  SUBDATASET_6_DESC=[3x4] Band6 (64-bit floating-point)
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)



Regards,

Hendy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multipledataset.tif
Type: image/tiff
Size: 988 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120308/ca0dec96/multipledataset.tif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multipledataset.nc
Type: application/x-netcdf
Size: 2764 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120308/ca0dec96/multipledataset.nc


More information about the gdal-dev mailing list