/** Returns {@code true} if the bottom row of the bounding rectangle has been passed. */ public boolean finishedLines() { boolean check = src.finishedLines(); if (check == dst.finishedLines()) { 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); } }
throw new NoSuchElementException("Index beyond size:" + index + ">" + size); if (iterator.finishedLines()) { throw new NoSuchElementException("Index beyond size:" + index + ">" + size);
/** * Returns true if the bottom row of the bounding rectangle has been passed. */ public boolean finishedLines() { return iterator.finishedLines(); }
/** * Returns {@code true} if the bottom row of the bounding rectangle has been passed. */ public boolean finishedLines() { boolean check = src.finishedLines(); if (check == dst.finishedLines()) { return check; } throw new RasterFormatException(ERROR); }
/** * Returns {@code true} if the bottom row of the bounding rectangle has been passed. */ public boolean finishedLines() { boolean check = src.finishedLines(); if (check == dst.finishedLines()) { return check; } throw new RasterFormatException(ERROR); }
/** * Returns {@code true} if the bottom row of the bounding rectangle has been passed. * * @return {@code true} if the iteration over lines is finished. */ @Override public boolean finishedLines() { boolean check = src.finishedLines(); if (check == dst.finishedLines()) { 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]; }
if(iterator.finishedLines()) throw new NoSuchElementException("Index beyond size:"+index+">"+size);
while (!readIter.finishedLines()) { aRx[dy] = new int[numColumns]; aRy[dy] = new int[numColumns];
while (!iter.finishedLines()) { iter.startPixels(); while (!iter.finishedPixels()) {
while (!iter.finishedLines()) { iter.startPixels(); while (!iter.finishedPixels()) {
int numSampleValues = 0, nextProgress = 0; if (!iterator.finishedBands()) do { if (!iterator.finishedLines()) do { if (numSampleValues >= nextProgress) {
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(); } }
inputIter.startLines(); writerIter.startLines(); while (!inputIter.finishedLines() && !writerIter.finishedLines()) { int column = inputBounds.x; inputIter.startPixels();
redIter.startLines(); writerIter.startLines(); while (!nirIter.finishedLines() && !redIter.finishedLines() && !writerIter.finishedLines()) { nirIter.startPixels(); redIter.startPixels();
/** * 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()); }
final RectIter e = RectIterFactory.create(expected, null); final RectIter a = RectIterFactory.create(actual, null); if (!e.finishedLines()) do { assertFalse(a.finishedLines()); if (!e.finishedPixels()) do { assertFalse(a.finishedPixels()); e.startPixels(); } while (!e.nextLineDone()); assertTrue(a.finishedLines());
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.startLines(); writerIter.startLines(); while (!inputIter.finishedLines() && !writerIter.finishedLines()) { int column = inputBounds.x; inputIter.startPixels();