[gdal-dev] netcdf warnings

Joaquim Manuel Freire Luís jluis at ualg.pt
Sat Feb 29 11:50:44 PST 2020


Hi,

There are a couple of issues that show when I run this test case.

First is that ERROR 3

$ gdal_grid -ot Float32 -txe 0.000000 10.000000 -tye 0.000000 10.000000 -outsize 201 201 -a nearest lixo.vrt junk.nc
Warning 1: Several drivers matching nc extension. Using NETCDF
0...10...20...30...40...50...60...70...80...90...100 - done.
ERROR 3: An attempt to read an undefined ID from virtual variable collection was made

Repeating the command (that is, overwriting the grid) shows more warnings, namely the "dimension #1 (lon) is not a Longitude/X dimension"

$ gdal_grid -ot Float32 -txe 0.000000 10.000000 -tye 0.000000 10.000000 -outsize 201 201 -a nearest lixo.vrt junk.nc
Warning 1: Several drivers matching nc extension. Using NETCDF
Warning 1: The dataset has several variables that could be identified as vector fields, but not all share the same primary dimension. Consequently they will be ignored.
Warning 1: dimension #1 (lon) is not a Longitude/X dimension.
Warning 1: dimension #0 (lat) is not a Latitude/Y dimension.
0...10...20...30...40...50...60...70...80...90...ERROR 3: An attempt to read an undefined ID from virtual variable collection was made

Which also show in gdalinfo

$ gdalinfo junk.nc
Warning 1: dimension #1 (lon) is not a Longitude/X dimension.
Warning 1: dimension #0 (lat) is not a Latitude/Y dimension.
Driver: netCDF/Network Common Data Format
...

I see that the x,y coordinates are always named "lon,lat" but data is not in geographics those names are not true. In GMT we call them "x,y" what data represent cartesian units or "lon,lat" when they are geographic. As a consequence of this, gdalinfo report those "not a Longitude/X dimension" warnings for the former case when the nc grid has not an "spatial_ref" attribute.

The data used in this example is attached


Joaquim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200229/c3b50fec/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lixo.vrt
Type: application/octet-stream
Size: 278 bytes
Desc: lixo.vrt
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200229/c3b50fec/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lixo.csv
Type: application/octet-stream
Size: 190 bytes
Desc: lixo.csv
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200229/c3b50fec/attachment-0003.obj>


More information about the gdal-dev mailing list