[gdal-dev] HDF5 and identified fields / primary dimension

Even Rouault even.rouault at spatialys.com
Mon Apr 1 16:46:48 PDT 2024


Michael,
>
> 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.
Yes, the driver is super conservative/picky when trying to recognize a 
netCDF file as a vector layer, and its heuristics will return in error 
if there is any ambiguity.
>
> I've seen similar cases in other files. I presume the driver could be 
> updated to 1) choose the primary dimension and read the values while 
> ignore others 2) user-specify the dimension to include, or 3) 
> user-specify the fields to exclude

I guess option 2 could be reasonable as an open option

For that particular file, I see that the "feature_id" variable 
(corresponding to the "feature_id" dimension) has a cf_role = 
"timeseries_id" attribute, and that the global metadata has a 
featureType = "timeSeries" attribute. So given 
https://cfconventions.org/Data/cf-conventions/cf-conventions-1.11/cf-conventions.html#coordinates-metadata 
, this seems to be relatively standardized, and in that case the 
heuristics could be improve to recognize that the main dimension is 
feature_id (probably with a test that the size of the time dimension is 
1).  As far as I can see/remember, the vector layer support in netCDF 
was originally developed for the featureType=point and profile use cases 
, so some tuning for timeseries isn't unexpected

Or maybe if detecting that in the set of dimensions there is only one 
with > 1 sample and others ones are at 1, consider only the one with > 1 
sample

Even

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



More information about the gdal-dev mailing list