/** Returns {@code true} if the right edge of the bounding rectangle has been passed. */ public boolean finishedPixels() { boolean check = src.finishedPixels(); if (check == dst.finishedPixels()) { return check; } throw new RasterFormatException(ERROR); }
public RasterAsPointFeatureIterator(final RasterAsPointFeatureCollection fc) { // checks Utilities.ensureNonNull("fc", fc); // get elements this.fc = fc; this.fb = new SimpleFeatureBuilder(fc.getSchema()); this.size = fc.size; // create an iterator that only goes forward, it is the fastest one iterator = RectIterFactory.create(fc.gc2d.getRenderedImage(), null); // // start the iterator // iterator.startLines(); if (iterator.finishedLines()) { throw new NoSuchElementException("Index beyond size:" + index + ">" + size); } iterator.startPixels(); if (iterator.finishedPixels()) { throw new NoSuchElementException("Index beyond size:" + index + ">" + size); } // appo temp = new double[fc.numBands]; // grid convergence angle manager if (fc.gridConvergenceAngleCorrectionNeeded) { sourceCRSPosition = new DirectPosition2D(); targetCRSPosition = new DirectPosition2D(fc.targetCRS); } }
if (iterator.finishedPixels()) { throw new NoSuchElementException("Index beyond size:" + index + ">" + size);
/** * Returns true if the right edge of the bounding rectangle has been passed. */ public boolean finishedPixels() { return iterator.finishedPixels(); }
/** * Returns {@code true} if the right edge of the bounding rectangle has been passed. */ public boolean finishedPixels() { boolean check = src.finishedPixels(); if (check == dst.finishedPixels()) { return check; } throw new RasterFormatException(ERROR); }
/** * Returns {@code true} if the right edge of the bounding rectangle has been passed. */ public boolean finishedPixels() { boolean check = src.finishedPixels(); if (check == dst.finishedPixels()) { return check; } throw new RasterFormatException(ERROR); }
/** * Returns {@code true} if the right edge of the bounding rectangle has been passed. * * @return {@code true} if the iteration over pixels is finished. */ @Override public boolean finishedPixels() { boolean check = src.finishedPixels(); if (check == dst.finishedPixels()) { return check; } throw new RasterFormatException(ERROR); }
private void extractValues() { coordinates.clear(); int column = bounds.x; int row = bounds.y + currentRow; readIter.startPixels(); while (!readIter.finishedPixels()) { double sampleValue = readIter.getSampleDouble(bandIndex); if (retainNoData) { Coordinate coord = trans.gridToWorldCoordinate(column, row); coord.z = sampleValue; coordinates.add(coord); } else { if (!SSUtils.compareDouble(noData, sampleValue)) { Coordinate coord = trans.gridToWorldCoordinate(column, row); coord.z = sampleValue; coordinates.add(coord); } } column++; readIter.nextPixel(); } currentRow++; readIter.nextLine(); }
private void extractValues() { coordinates.clear(); int column = bounds.x; int row = bounds.y + currentRow; readIter.startPixels(); while (!readIter.finishedPixels()) { double sampleValue = readIter.getSampleDouble(bandIndex); if (retainNoData) { Coordinate coord = trans.gridToWorldCoordinate(column, row); coord.z = sampleValue; coordinates.add(coord); } else { if (!SSUtils.compareDouble(noData, sampleValue)) { Coordinate coord = trans.gridToWorldCoordinate(column, row); coord.z = sampleValue; coordinates.add(coord); } } column++; readIter.nextPixel(); } currentRow++; readIter.nextLine(); }
if(iterator.finishedPixels()) throw new NoSuchElementException("Index beyond size:"+index+">"+size); if(iterator.finishedLines())
public RasterAsPointFeatureIterator(final RasterAsPointFeatureCollection fc) { //checks Utilities.ensureNonNull("fc", fc); //get elements this.fc= fc; this.fb = new SimpleFeatureBuilder(fc.getSchema()); this.size=fc.size; // create an iterator that only goes forward, it is the fastest one iterator= RectIterFactory.create(fc.gc2d.getRenderedImage(), null); // //start the iterator // iterator.startLines(); if(iterator.finishedLines()) throw new NoSuchElementException("Index beyond size:"+index+">"+size); iterator.startPixels(); if(iterator.finishedPixels()) throw new NoSuchElementException("Index beyond size:"+index+">"+size); // appo temp= new double[fc.numBands]; }
while (!readIter.finishedPixels()) { final int val = readIter.getSample(0); if (!SSUtils.compareDouble(val, inputNoData)) {
while (!iter.finishedLines()) { iter.startPixels(); while (!iter.finishedPixels()) { double val = iter.getSampleDouble(); if (!Double.isNaN(val)) {
while (!iter.finishedLines()) { iter.startPixels(); while (!iter.finishedPixels()) { double val = iter.getSampleDouble(); if (!Double.isNaN(val)) {
public void visit(GridCoverage2D inputCoverage, Integer bandIndex) { reset(); PlanarImage inputImage = (PlanarImage) inputCoverage.getRenderedImage(); RectIter readIter = RectIterFactory.create(inputImage, inputImage.getBounds()); readIter.startLines(); while (!readIter.finishedLines()) { readIter.startPixels(); while (!readIter.finishedPixels()) { double sampleValue = readIter.getSampleDouble(bandIndex); visit(Double.valueOf(sampleValue)); readIter.nextPixel(); } readIter.nextLine(); } }
redIter.startPixels(); writerIter.startPixels(); while (!nirIter.finishedPixels() && !redIter.finishedPixels() && !writerIter.finishedPixels()) { double nir = nirIter.getSampleDouble(nirIndex);
/** * Ensures that all sample values in every bands are either inside the given range, * or {@link Double#NaN}. * * @param minimum The lower bound of the range, inclusive. * @param maximum The upper bound of the range, inclusive. * @param image The image to test. * * @since 3.19 */ public static void assertSampleValuesInRange(final double minimum, final double maximum, final RenderedImage image) { final RectIter it = RectIterFactory.create(image, null); if (!it.finishedLines()) do { if (!it.finishedPixels()) do { if (!it.finishedBands()) do { final double value = it.getSampleDouble(); assertBetween("Sample value", minimum, maximum, value); } while (!it.nextBandDone()); it.startBands(); } while (!it.nextPixelDone()); it.startPixels(); } while (!it.nextLineDone()); }
if (!e.finishedLines()) do { assertFalse(a.finishedLines()); if (!e.finishedPixels()) do { assertFalse(a.finishedPixels()); if (!e.finishedBands()) do { assertFalse(a.finishedBands()); e.startBands(); } while (!e.nextPixelDone()); assertTrue(a.finishedPixels()); a.nextLine(); a.startPixels();
public GridCoverage2D execute(GridCoverage2D inputGc, double[] fuzzyValues) { DiskMemImage outputImage = this.createDiskMemImage(inputGc, RasterPixelType.FLOAT); PlanarImage inputImage = (PlanarImage) inputGc.getRenderedImage(); final double inputNoData = RasterHelper.getNoDataValue(inputGc); this.NoData = RasterHelper.getDefaultNoDataValue(PixelType); RectIter inputIter = RectIterFactory.create(inputImage, inputImage.getBounds()); WritableRectIter writerIter = RectIterFactory.createWritable(outputImage, outputImage.getBounds()); inputIter.startLines(); writerIter.startLines(); while (!inputIter.finishedLines() && !writerIter.finishedLines()) { inputIter.startPixels(); writerIter.startPixels(); while (!inputIter.finishedPixels() && !writerIter.finishedPixels()) { final double inputVal = inputIter.getSampleDouble(0); if (SSUtils.compareDouble(inputNoData, inputVal)) { writerIter.setSample(0, NoData); } else { double fuzzyValue = getFuzzyValue(inputVal, fuzzyValues) * maxRange; writerIter.setSample(0, fuzzyValue); updateStatistics(inputVal); } inputIter.nextPixel(); writerIter.nextPixel(); } inputIter.nextLine(); writerIter.nextLine(); } return createGridCoverage("Fuzzy", outputImage); }
inputIter.startPixels(); writerIter.startPixels(); while (!inputIter.finishedPixels() && !writerIter.finishedPixels()) { final double curVal = inputIter.getSampleDouble(bandIndex);