Opened 10 years ago

Closed 10 years ago

#4405 closed defect (fixed)

Error reading netCDF dataset

Reported by: hsumanto Owned by: etourigny
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords: netcdf
Cc: etourigny

Description

I have a small sample of netCDF file which I created last time using previous netCDF driver.

It seems it is not compatible with the current netCDF driver now as when I do resampling, it produces these errors.

gdalwarp -r near L71092086_08620110129_B50-netCDF-small.nc t.tif
Warning 1: got SRS but no geotransform from CF!
Processing input file L71092086_08620110129_B50-netCDF-small.nc.
ERROR 1: Unable to compute a transformation between pixel/line
and georeferenced coordinates for L71092086_08620110129_B50-netCDF-small.nc.
There is no affine transformation and no GCPs.

Doing gdalinfo on the netcdf file produces the same warning. You will also notice that Origin and Pixel Size information are missing from the gdalinfo.

gdalinfo L71092086_08620110129_B50-netCDF-small.nc
Warning 1: got SRS but no geotransform from CF!
Driver: netCDF/Network Common Data Format
Files: L71092086_08620110129_B50-netCDF-small.nc
Size is 333, 333
Coordinate System is:
PROJCS["WGS 84 / UTM zone 55N",
    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"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",147],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32655"]]
Metadata:
  Band1#grid_mapping=transverse_mercator
  Band1#long_name=GDAL Band Number 1
  NC_GLOBAL#Conventions=CF-1.0
  transverse_mercator#Easternmost_Easting=291385
  transverse_mercator#false_easting=500000
  transverse_mercator#false_northing=0
  transverse_mercator#GeoTransform=281385 30.03 0 -4.04068e+06 0 -30.03 
  transverse_mercator#grid_mapping_name=transverse_mercator
  transverse_mercator#latitude_of_projection_origin=0
  transverse_mercator#longitude_of_central_meridian=147
  transverse_mercator#Northernmost_Northing=-4040685
  transverse_mercator#scale_factor_at_central_meridian=0.99959999
  transverse_mercator#Southernmost_Northing=-4050685
  transverse_mercator#spatial_ref=PROJCS["WGS 84 / UTM zone 55N",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"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",147],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32655"]]
  transverse_mercator#Westernmost_Easting=281385
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  333.0)
Upper Right (  333.0,    0.0)
Lower Right (  333.0,  333.0)
Center      (  166.5,  166.5)
Band 1 Block=333x1 Type=Byte, ColorInterp=Undefined
  NoData Value=0
  Metadata:
    grid_mapping=transverse_mercator
    long_name=GDAL Band Number 1
    NETCDF_VARNAME=Band1

Attachments (1)

L71092086_08620110129_B50-netCDF-small.nc (109.6 KB) - added by hsumanto 10 years ago.
netcdf dataset created with previous netcdf driver

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by hsumanto

netcdf dataset created with previous netcdf driver

comment:1 Changed 10 years ago by Even Rouault

Cc: etourigny added

comment:2 Changed 10 years ago by etourigny

Owner: changed from warmerdam to etourigny
Status: newassigned

r23631 : fix missing geotransform when opening netcdf files created by old driver (#4405); cleanup debug output

New implementation did not set GT from GDAL metadata, this fix ensures GT is written after projection (if it was found in CF or GDAL metadata)

Thanks for the report, please confirm it works and does not cause other regressions.

comment:3 Changed 10 years ago by hsumanto

It is now working with the attached dataset. Thanks, Etienne.

comment:4 Changed 10 years ago by etourigny

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.