[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

> // 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

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

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.