[gdal-dev] netCDF vector driver reading CF-1.6 point featureType with time coordinate variable

Even Rouault even.rouault at spatialys.com
Wed Mar 31 13:23:14 PDT 2021


There are heuristics in the driver to try to detect variables that are 
vector data from 2D or more gridded data that should be handled only by 
the raster side. Please file a ticket on github with the details you've 
provided in this email.

Le 31/03/2021 à 21:54, Jesse Bickel - NOAA Affiliate via gdal-dev a écrit :
> Hello,
>
> When using the netCDF vector driver to read CF-1.6 point features, it appears
> a netCDF time coordinate variable prevents OGR layers from being produced. When
> the time variable units are changed to fake units, such as meters, layers are
> then produced.
>
> Attached are two example CDL files and two netCDF 3 files produced from the
> CDL files. From the below log one can see the layer count 1 for the netCDF data
> labeled "ogr_layer_produced" and layer count 0 for the netCDF data labeled
> "ogr_layer_not_produced" for GDAL/OGR version 3.2.1. The effect in a downstream
> tool such as QGIS is success or failure in reading a GIS layer from the netCDF.
>
> I see the warning about sharing a primary dimension, but I do not see such a
> requirement in the CF conventions. It would be preferred to allow layers to be
> produced for the latter variables when there is a time coordinate variable
> present as a time variable.
>
> Thank you for your consideration,
>
> Jesse
>
> --
> Contractor, ERT, Inc.
> Federal Affiliation: NWC/OWP/NOAA/DOC
>
>
>
>
>
>
>
> User.Name at MACHINE-NAME /cygdrive/C/Users/User.Name/code/gdal-3.2.1/apps
> $ CPL_DEBUG=ON ./ogrinfo.exe ../../../Downloads/ogr_layer_produced.nc
> GDAL_netCDF: driver detected file type=1, libnetcdf detected type=1
> GDAL_netCDF: var_count = 9
> GDAL_netCDF:
> =====
> SetProjectionFromVar( 65536, 4)
> GDAL_netCDF: got grid_mapping ProjectionCoordinateSystem
> GDAL_netCDF: bIsGdalFile=0 bIsGdalCfFile=0 bSwitchedXY=0 bBottomUp=1
> GDAL_netCDF: got spheroid from CF: (6378137.000000 , 298.257224)
> GDAL_netCDF: setting WKT from CF
> GDAL_netCDF: setting WKT from GDAL
> GDAL_netCDF: SetProjection, WKT = GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
> GDAL_netCDF: Got SRS but no geotransform from GDAL!
> GDAL: GDALOpen(../../../Downloads/ogr_layer_produced.nc, this=0x8000dafa0) succeeds as netCDF.
> INFO: Open of `../../../Downloads/ogr_layer_produced.nc'
>        using driver `netCDF' successful.
> OGR: GetLayerCount() = 1
>
> 1: ogr_layer_produced (Point)
> GDAL: GDALClose(../../../Downloads/ogr_layer_produced.nc, this=0x8000dafa0)
> GDAL: In GDALDestroy - unloading GDAL shared library.
>
> User.Name at MACHINE-NAME /cygdrive/C/Users/User.Name/code/gdal-3.2.1/apps
> $ CPL_DEBUG=ON ./ogrinfo.exe ../../../Downloads/ogr_layer_not_produced.nc
> GDAL_netCDF: driver detected file type=1, libnetcdf detected type=1
> GDAL_netCDF: var_count = 9
> 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.
> GDAL_netCDF: driver detected file type=1, libnetcdf detected type=1
> GDAL_netCDF: var_count = 9
> 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.
> GDAL: GDALOpen(../../../Downloads/ogr_layer_not_produced.nc, this=0x8000db3b0) succeeds as netCDF.
> INFO: Open of `../../../Downloads/ogr_layer_not_produced.nc'
>        using driver `netCDF' successful.
> Metadata:
>    NC_GLOBAL#Conventions=CF-1.6
>    NC_GLOBAL#featureType=point
> OGR: GetLayerCount() = 0
>
> GDAL: GDALClose(../../../Downloads/ogr_layer_not_produced.nc, this=0x8000db3b0)
> GDAL: In GDALDestroy - unloading GDAL shared library.
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210331/c7e68a2f/attachment-0001.html>


More information about the gdal-dev mailing list