@Override public Boolean getValue() { return raster.isNoDataValueUsed(); }
private boolean mustReplaceNaN(RasterDataNode sourceRaster, int targetDataType, double targetNoDataValue) { final boolean isFloat = ProductData.isFloatingPointType(targetDataType); final boolean isNoDataGiven = sourceRaster.isNoDataValueUsed() || noDataValue != null; final boolean isNoDataNaN = Double.isNaN(targetNoDataValue); return isFloat && isNoDataGiven && !isNoDataNaN; }
private Number getTargetNoDataValue(RasterDataNode sourceRaster, int targetDataType) { double targetNoDataValue = Double.NaN; if (noDataValue != null) { targetNoDataValue = noDataValue; } else if (sourceRaster.isNoDataValueUsed()) { targetNoDataValue = sourceRaster.getNoDataValue(); } Number targetNoDataNumber; if (targetDataType == ProductData.TYPE_INT8) { targetNoDataNumber = (byte) targetNoDataValue; } else if (targetDataType == ProductData.TYPE_INT16 || targetDataType == ProductData.TYPE_UINT8) { targetNoDataNumber = (short) targetNoDataValue; } else if (targetDataType == ProductData.TYPE_INT32 || targetDataType == ProductData.TYPE_UINT16) { targetNoDataNumber = (int) targetNoDataValue; } else if (targetDataType == ProductData.TYPE_FLOAT32) { targetNoDataNumber = (float) targetNoDataValue; } else { targetNoDataNumber = targetNoDataValue; } return targetNoDataNumber; }
@Override public void setValue(Boolean newValue) { Boolean oldValue = raster.isNoDataValueUsed(); performUndoableProductNodeEdit("Edit No-Data Value Used", raster, node -> { node.setNoDataValueUsed(newValue); updateImages(node, true); }, node -> { node.setNoDataValueUsed(oldValue); updateImages(node, true); } ); } }
public ResamplingRaster(final Tile tile, final double[][] data) { this.tile = tile; this.data = data; final RasterDataNode rasterDataNode = tile.getRasterDataNode(); this.usesNoData = rasterDataNode.isNoDataValueUsed(); this.noDataValue = rasterDataNode.getNoDataValue(); this.geophysicalNoDataValue = rasterDataNode.getGeophysicalNoDataValue(); this.scalingApplied = rasterDataNode.isScalingApplied(); }
public ResamplingRaster(final Tile tile) { this.tile = tile; this.dataBuffer = tile.getDataBuffer(); final RasterDataNode rasterDataNode = tile.getRasterDataNode(); this.usesNoData = rasterDataNode.isNoDataValueUsed(); this.noDataValue = rasterDataNode.getNoDataValue(); this.geophysicalNoDataValue = rasterDataNode.getGeophysicalNoDataValue(); this.scalingApplied = rasterDataNode.isScalingApplied(); }