@Override public Double getValue() { return raster.getNoDataValue(); }
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(Double newValue) { double oldValue = raster.getNoDataValue(); performUndoableProductNodeEdit("Edit No-Data Value", raster, node -> { node.setNoDataValue(newValue); updateImages(node, true); }, node -> { node.setNoDataValue(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(); }
private void setInvalidTargetSamples(Map<Band, Tile> targetTiles, int x, int y) { float[] latLon = getLatLon(x, y, pixelWindow, sourceProduct); for (Tile t : targetTiles.values()) { if (t.getRasterDataNode() == latBand) { targetTiles.get(targetProduct.getBand("latitude")).setSample(x, y, latLon[0]); } else if (t.getRasterDataNode() == lonBand) { targetTiles.get(targetProduct.getBand("longitude")).setSample(x, y, latLon[1]); } else if (t.getRasterDataNode() == aotBand) { if (aodDefault != null && aodDefault.getGeoCoding() != null) { final PixelPos pixelPos = aodDefault.getGeoCoding().getPixelPos(new GeoPos(latLon[0], latLon[1]), new PixelPos()); t.setSample(x, y, aodDefault.getSampleFloat((int) pixelPos.getX(), (int) pixelPos.getY())); } else { t.setSample(x, y, t.getRasterDataNode().getNoDataValue()); } } else { t.setSample(x, y, t.getRasterDataNode().getNoDataValue()); } } }