} else if (checkType == CheckType.NOSCALARS) {
List<Dimension> dimensions = var.getDimensions();
if (dimensions.size()<2) {
return false;
}
DataType dataType = var.getDataType();
if (dataType == DataType.CHAR) {
return false;
}
return isVariableAccepted(var.getFullName(), CheckType.NONE);
} else if (checkType == CheckType.ONLYGEOGRIDS) {
List<Dimension> dimensions = var.getDimensions();
if (dimensions.size()<2) {
return false;
}
int twoDimensionalCoordinates = 0;
for( Dimension dimension : dimensions ) {
String dimName = dimension.getFullName();
// check the dimension to be defined
Group group = dimension.getGroup();
// Simple check if the group is not present. In that case false is returned.
// This situation could happen with anonymous dimensions inside variables which
// indicates the bounds of another variable. These kind of variable are not useful
// for displaying the final raster.
if(group == null){
return false;
}
Variable dimVariable = group.findVariable(dimName);
if (dimVariable == null) {
return false;
}
if (dimVariable instanceof CoordinateAxis1D) {
CoordinateAxis1D axis = (CoordinateAxis1D) dimVariable;
AxisType axisType = axis.getAxisType();
if (axisType == null) {
return false;
}
switch (axisType) {
case GeoX:
case GeoY:
case Lat:
case Lon:
twoDimensionalCoordinates++;
break;
default:
break;
}
}
}
if (twoDimensionalCoordinates < 2) {
// 2D Grid is missing
return false;
}
DataType dataType = var.getDataType();
if (dataType == DataType.CHAR) {
return false;
}
return isVariableAccepted(var.getFullName(), CheckType.NONE);
} else