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

[THREDDS #NCT-216206]: TDS report incorrect attribute data type



Ok, I have found the problem.
The code that converts cdm attributes
to opendap attributes has 
explicit code (Shown at end of message, taken from
NcDAS.java line 177).

The reason for this is that the DAP2 specification
byte type is explicitly defined as unsigned.
So, any server that serves up a signed byte
value is violating the DAP2 specification.
=Dennis Heimbigner
 Unidata 

> // cant send signed bytes
> if (att.getDataType() == DataType.BYTE) {
>   boolean signed = false;
>   for (int i = 0; i < att.getLength(); i++) {
>      if (att.getNumericValue(i).byteValue() < 0)
>        signed = true;
>      }
>      if (signed) // promote to signed short
>        dods_type = opendap.dap.Attribute.INT16;
>      }
>   }


=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: NCT-216206
Department: Support THREDDS
Priority: Urgent
Status: Closed