<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>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.<br>
    </p>
    <div class="moz-cite-prefix">Le 31/03/2021 à 21:54, Jesse Bickel -
      NOAA Affiliate via gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:dhwdtuorw136.wl-jesse.bickel@noaa.gov">
      <pre class="moz-quote-pre" wrap="">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

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">


User.Name@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@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.</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>