@Test public void testNoDataRanges() { ParameterBlockJAI pb = new ParameterBlockJAI("ZonalStats"); pb.setSource("dataImage", multibandImageNoData); pb.setParameter("stats", new Statistic[]{Statistic.MIN, Statistic.MAX, Statistic.RANGE}); List<Range<Double>> noRanges = CollectionFactory.list(); noRanges.add(Range.create(-9999.0d, null)); pb.setParameter("noDataRanges", noRanges); pb.setParameter("bands", new Integer[]{0, 2}); RenderedOp op = JAI.create("ZonalStats", pb); ZonalStats stats = (ZonalStats) op.getProperty(ZonalStatsDescriptor.ZONAL_STATS_PROPERTY); for (Result r : stats.results()) { switch (r.getStatistic()) { case MIN: case MAX: assertEquals(r.getImageBand(), r.getValue()-1, EPS); break; case RANGE: assertEquals(0.0, r.getValue(), EPS); break; default: fail("unexpected statistic: " + r.getStatistic()); } assertEquals(2360, r.getNumNoData()); assertEquals(992, r.getNumNaN()); assertEquals(5832, r.getNumAccepted()); } }
public List<Result> results() { return Collections.unmodifiableList(results); }
ZonalStats { public List<Result> results() { return Collections.unmodifiableList(results); } }
ZonalStats { public List<Result> results() { return Collections.unmodifiableList(results); } ZonalStats(); private  ZonalStats(ZonalStats src, Integer band, Integer zone, Statistic stat, List<Range> ranges); }
ZonalStats { public List<Result> results() { return Collections.unmodifiableList(results); } ZonalStats(); private  ZonalStats(ZonalStats src, Integer band, Integer zone, Statistic stat, List<Range> ranges); SortedSet<Integer> getZones(); ZonalStats band(int b); ZonalStats zone(int z); ZonalStats statistic(Statistic s); ZonalStats ranges(List<Range> ranges); List<Result> results(); }
ZonalStats { public List<Result> results() { return Collections.unmodifiableList(results); } ZonalStats(); private  ZonalStats(ZonalStats src, Integer band, Integer zone, Statistic stat, List<Range> ranges); SortedSet<Integer> getZones(); ZonalStats band(int b); ZonalStats zone(int z); ZonalStats statistic(Statistic s); ZonalStats ranges(List<Range> ranges); List<Result> results();  }