private String getPixelString(RasterDataNode raster, int x, int y, int level) { if (isPixelValid(raster, x, y, level)) { if (raster.isScalingApplied() || ProductData.isFloatingPointType(raster.getDataType())) { int dataType = raster.getGeophysicalDataType(); if (dataType == ProductData.TYPE_FLOAT64) { double pixel = ProductUtils.getGeophysicalSampleAsDouble(raster, x, y, level); return String.format("%.10f", pixel); } else if (dataType == ProductData.TYPE_FLOAT32) { double pixel = ProductUtils.getGeophysicalSampleAsDouble(raster, x, y, level); return String.format("%.5f", pixel); } } return String.valueOf(ProductUtils.getGeophysicalSampleAsLong(raster, x, y, level)); } else { return RasterDataNode.NO_DATA_TEXT; } }
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(); }
final int targetDataType; MultiLevelImage sourceImage; if (sourceRaster.isScalingApplied()) { targetDataType = sourceRaster.getGeophysicalDataType(); sourceImage = sourceRaster.getGeophysicalImage();