[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20050922:DODS/THREDDS confusion





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 DODS
servers?

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.