/** * Gets the no-data value as a primitive <code>double</code>. * <p>Note that the value returned is NOT necessarily the same as the value returned by * {@link #getGeophysicalNoDataValue()} because no scaling is applied. * <p>The no-data value is used to determine valid pixels. For more information * on valid pixels, please refer to the documentation of the {@link #isPixelValid(int, int, javax.media.jai.ROI)} * method. * <p>The method returns <code>0.0</code>, if no no-data value has been specified so far. * * @return the no-data value. It is returned as a <code>double</code> in order to cover all other numeric types. * @see #setNoDataValue(double) * @see #isNoDataValueSet() */ public double getNoDataValue() { return isNoDataValueSet() ? noData.getElemDouble() : 0.0; }
public static MultiLevelImage createMaskedGeophysicalImage(final RasterDataNode node, Number maskValue) { MultiLevelImage varImage = node.getGeophysicalImage(); if (node.getValidPixelExpression() != null) { varImage = replaceInvalidValuesByNaN(node, varImage, node.getValidMaskImage(), maskValue); } else if (node.isNoDataValueSet() && node.isNoDataValueUsed() && Double.compare(maskValue.doubleValue(), node.getGeophysicalNoDataValue()) != 0) { varImage = replaceNoDataValueByNaN(node, varImage, node.getGeophysicalNoDataValue(), maskValue); } return varImage; }