Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.
David Wojtowicz wrote:
--------------------------------- Dataset { String station_id[station = 4818]; } Attributes { station_id { String long_name "Station id"; String reference "sfmetar_sa.tbl"; DODS { Int32 strlen 4; String dimName id_len; } } } ---------------------------------Question... is this "DODS" container attribute that specifies the string length only a TDS convention or does it apply more generally to other DODSservers?
The idea of the DODS name was "stuff used by the DODS layer, dont have to show to the user". I think James suggested it, but im not sure.
If not, is the string length intended to be variable....and if so,I would think the only way to accurately represent this in the netCDF API would be to make the length dimension of the character array be the maximum strlen of the array and pad shorter strings with zeros.
The point here is that all the strings in the array have the same length (they have to since this data came from a netcdf file, which can only have rectangular char arrays). On the client end (in the Netcdf API), i translate it back into a rectangular char array, and it is nice not to have to read all the Strings before knowing what length to make the char array. If they were variable length, then omitting the strlen attribute would be the right thing to do, and i would not try to map them back into char arrays. _From dncdump POV, I would assume you dont actually care all that much, since you arent trying to map into char arrays. However, there is a complication in that some servers that serve netcdf files map chars to Strings of length 1. So if nothing else, the presence of the strlen attribute tells you this is not a server that maps to Strings of length 1. Sorry to complicate the matter.
netcdf-java
archives: