Issue #1962 Allow Viirs Decoder to accept numeric missing values.
Former-commit-id:0286f91956
[formerlydb039f5af5
[formerly f46cda54fd5cea0f0daa5cd7c7152c07ea3bc4e3]] Former-commit-id:db039f5af5
Former-commit-id:065b26988c
This commit is contained in:
parent
1c9529ab22
commit
28012d41f7
1 changed files with 23 additions and 6 deletions
|
@ -62,6 +62,8 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
|||
* Dec 1, 2011 mschenke Initial creation
|
||||
* Feb 21, 2012 #30 mschenke Changed VIIRS decoder to read time attribute out of record
|
||||
* instead of using WMO header
|
||||
* May 01, 2013 1962 bsteffen Allow Viirs Decoder to accept numeric
|
||||
* missing values.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -236,12 +238,27 @@ public class VIIRSDecoder extends AbstractNPPDecoder {
|
|||
|
||||
for (Attribute attr : var.getAttributes()) {
|
||||
if (MISSING_VALUE_ID.equals(attr.getName())) {
|
||||
if (attr.getDataType().isString()) {
|
||||
String missing = attr.getStringValue();
|
||||
String[] split = missing
|
||||
.split(MISSING_VALUE_SPLIT_STRING);
|
||||
missingValues = new float[split.length];
|
||||
for (int i = 0; i < split.length; ++i) {
|
||||
missingValues[i] = Float.parseFloat(split[i]);
|
||||
missingValues[i] = Float
|
||||
.parseFloat(split[i]);
|
||||
}
|
||||
} else if(attr.getDataType().isNumeric()){
|
||||
if(attr.isArray()){
|
||||
missingValues = new float[attr.getLength()];
|
||||
for (int i = 0; i < missingValues.length; i += 1) {
|
||||
missingValues[i] = attr
|
||||
.getNumericValue(i)
|
||||
.floatValue();
|
||||
}
|
||||
}else{
|
||||
missingValues = new float[] { attr
|
||||
.getNumericValue().floatValue() };
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue