[gdal-dev] What's so wrong with this nc file ...

Joaquim Manuel Freire Luís jluis at ualg.pt
Tue Oct 19 17:01:14 PDT 2021


That the geotransform is not detected

gdalinfo xxx.grd
Warning 1: dimension #1 (x) is not a Longitude___/X dimension.
Warning 1: dimension #0 (y) is not a Latitude/Y dimension.
Driver: netCDF/Network Common Data Format
...
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,   59.0)
Upper Right (   37.0,    0.0)
Lower Right (   37.0,   59.0)
Center      (   18.5,   29.5)

I can't get why it's complaining on "dimension #1 (x) is not a Longitude/X dimension."
Tried to check the full docs (netcdfdataset.cpp) but not even with a debugger I can understand the why.

Due to it the x,y coordinates are not fished from file, either from Julia or from GMT

NOTE: this works but does not use GDAL

grdinfo xxx.grd
xxx.grd: Title: z
xxx.grd: Command:
xxx.grd: Remark:
xxx.grd: Gridline node registration used [Cartesian grid]
xxx.grd: Grid file format: nf = GMT netCDF format (32-bit float), CF-1.7
xxx.grd: x_min: 580155 x_max: 581235 x_inc: 30 name: x n_columns: 37
xxx.grd: y_min: 4416795 y_max: 4418535 y_inc: 30 name: y n_rows: 59
xxx.grd: v_min: 0.205308780074 v_max: 0.56782335043 name: z
...

This DOES NOT WORK (it uses GDAL)

grdinfo xxx.grd=gd
Warning 1: dimension #1 (x) is not a Longitude___/X dimension.
Warning 1: dimension #0 (y) is not a Latitude/Y dimension.
xxx.grd: Title: Grid imported via GDAL
xxx.grd: Command:
xxx.grd: Remark:
xxx.grd: Gridline node registration used [Cartesian grid]
xxx.grd: Grid file format: gd = Import/export through GDAL
xxx.grd: x_min: 0.5 x_max: 36.5 x_inc: 1 name: x n_columns: 37
xxx.grd: y_min: 0.5 y_max: 58.5 y_inc: 1 name: y n_rows: 59
xxx.grd: v_min: 0.205308780074 v_max: 0.56782335043 name: z
xxx.grd: scale_factor: 1 add_offset: 0
+proj=utm +zone=10 +ellps=WGS84 +units=m +no_defs

What's so wrong with this nc file? I have others that look similar in terms of attributes and things work fine, but for some other cases I get the terrible

Warning 1: dimension #1 (x) is not a Longitude/X dimension.
Warning 1: dimension #0 (y) is not a Latitude/Y dimension.

and I'm screwed.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20211020/18c48bc4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xxx.grd
Type: application/octet-stream
Size: 21981 bytes
Desc: xxx.grd
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20211020/18c48bc4/attachment-0001.obj>


More information about the gdal-dev mailing list