Package org.jaitools.media.jai.zonalstats

Examples of org.jaitools.media.jai.zonalstats.ZonalStats


      params.parameter("rangeLocalStats").setValue(false); //$NON-NLS-1$
    }
   

    final GridCoverage2D coverage = (GridCoverage2D) op.doOperation(params,null);
    final ZonalStats zstats = (ZonalStats) coverage
        .getProperty(ZonalStatsDescriptor.ZONAL_STATS_PROPERTY);
    double min = zstats.statistic(Statistic.MIN).results().get(0).getValue();
    double max = zstats.statistic(Statistic.MAX).results().get(0).getValue();
    return new double[]{min,max};
  }
View Full Code Here


                        zoneGeom = JTS.transform(zoneGeom, CRS.findMathTransform(zonesCrs, dataCrs,
                                true));
                    }
   
                    // gather the statistics
                    ZonalStats stats = processStatistics(zoneGeom);
   
                    // build the resulting feature
                    if (stats != null) {
                        if(classificationRaster != null) {
                            // if zonal stats we're going to build
                            for (Integer classZoneId : stats.getZones()) {
                                builder.addAll(zone.getAttributes());
                                builder.add(classZoneId);
                                addStatsToFeature(stats.zone(classZoneId));
                                features.add(builder.buildFeature(zone.getID()));
                            }
                        } else {
                            builder.addAll(zone.getAttributes());
                            addStatsToFeature(stats);
View Full Code Here

                    params.parameter("ranges").setValue(inclusionRanges);
                    params.parameter("rangesType").setValue(rangesType);
                    params.parameter("rangeLocalStats").setValue(isLocal);

                    final GridCoverage2D coverage = (GridCoverage2D) op.doOperation(params, null);
                    final ZonalStats stats = (ZonalStats) coverage
                            .getProperty(ZonalStatsDescriptor.ZONAL_STATS_PROPERTY);
                    final Map<Statistic, List<Result>> statsMap = new HashMap<Statistic, List<Result>>();
                    for (Statistic statistic : statistis) {
                        final List<Range> inclRanges = CollectionFactory.list();
                        inclRanges.addAll(inclusionRanges);
                        List<Result> statsResult = stats.ranges(inclRanges).statistic(statistic)
                                .results();
                        statsMap.put(statistic, statsResult);
                    }
                    feature2StatisticsMap.put(fid, statsMap);
                }
View Full Code Here

TOP

Related Classes of org.jaitools.media.jai.zonalstats.ZonalStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.