@Test public void testSumAreaWithGroupBy() throws Exception { SimpleFeatureSource source = bugs.getFeatureSource("groupedzones"); Set<AggregationFunction> functions = EnumSet.of(AggregationFunction.SumArea); Results result = AggregateProcess.process( source.getFeatures(), "the_geom", functions, Collections.singletonList("str1"), true, null); assertNotNull(result.getGroupByResult()); assertTrue(result.getGroupByResult().size() == 3); assertTrue(result.getGroupByResult().get(0).length == 2); }
public static Results process( SimpleFeatureCollection features, String aggAttribute, Set<AggregationFunction> functions, Boolean singlePass, ProgressListener progressListener) throws ProcessException, IOException { return process(features, aggAttribute, functions, null, singlePass, progressListener); }
AggregateProcess implements VectorProcess { public static Results process( SimpleFeatureCollection features, String aggAttribute, Set<AggregationFunction> functions, Boolean singlePass, ProgressListener progressListener) throws ProcessException, IOException { return process(features, aggAttribute, functions, null, singlePass, progressListener); } }
AggregateProcess implements VectorProcess { public static Results process( SimpleFeatureCollection features, String aggAttribute, Set<AggregationFunction> functions, Boolean singlePass, ProgressListener progressListener) throws ProcessException, IOException { return process(features, aggAttribute, functions, null, singlePass, progressListener); }  }
AggregateProcess implements VectorProcess { public static Results process( SimpleFeatureCollection features, String aggAttribute, Set<AggregationFunction> functions, Boolean singlePass, ProgressListener progressListener) throws ProcessException, IOException { return process(features, aggAttribute, functions, null, singlePass, progressListener); }  static Results process(
            SimpleFeatureCollection features,
            String aggAttribute,
            Set<AggregationFunction> functions,
            Boolean singlePass,
            ProgressListener progressListener); static Results process(
            SimpleFeatureCollection features,
            String aggAttribute,
            Set<AggregationFunction> functions,
            List<String> groupByAttributes,
            Boolean singlePass,
            ProgressListener progressListener); Results execute(
            SimpleFeatureCollection features,
            String aggAttribute,
            Set<AggregationFunction> functions,
            boolean singlePass,
            ProgressListener progressListener); @DescribeResult( name = "result", description = "Aggregation results (one value for each function computed)" ) Results execute(
            @DescribeParameter(name = "features", description = "Input feature collection")
                    SimpleFeatureCollection features,
            @DescribeParameter(
                        name = "aggregationAttribute",
                        min = 0,
                        description = "Attribute on which to perform aggregation"
                    )
                    String aggAttribute,
            @DescribeParameter(
                        name = "function",
                        description =
                                "An aggregate function to compute. Functions include Count, Average, Max, Median, Min, StdDev, Sum and SumArea.",
                        collectionType = AggregationFunction.class
                    )
                    Set<AggregationFunction> functions,
            @DescribeParameter(
                        name = "singlePass",
                        description =
                                "If True computes all aggregation values in a single pass (this will defeat DBMS-specific optimizations)",
                        defaultValue = "false"
                    )
                    boolean singlePass,
            @DescribeParameter(
                        name = "groupByAttributes",
                        min = 0,
                        description = "List of group by attributes",
                        collectionType = String.class
                    )
                    List<String> groupByAttributes,
            ProgressListener progressListener); }
AggregateProcess implements VectorProcess { public static Results process( SimpleFeatureCollection features, String aggAttribute, Set<AggregationFunction> functions, Boolean singlePass, ProgressListener progressListener) throws ProcessException, IOException { return process(features, aggAttribute, functions, null, singlePass, progressListener); }  static Results process(
            SimpleFeatureCollection features,
            String aggAttribute,
            Set<AggregationFunction> functions,
            Boolean singlePass,
            ProgressListener progressListener); static Results process(
            SimpleFeatureCollection features,
            String aggAttribute,
            Set<AggregationFunction> functions,
            List<String> groupByAttributes,
            Boolean singlePass,
            ProgressListener progressListener); Results execute(
            SimpleFeatureCollection features,
            String aggAttribute,
            Set<AggregationFunction> functions,
            boolean singlePass,
            ProgressListener progressListener); @DescribeResult( name = "result", description = "Aggregation results (one value for each function computed)" ) Results execute(
            @DescribeParameter(name = "features", description = "Input feature collection")
                    SimpleFeatureCollection features,
            @DescribeParameter(
                        name = "aggregationAttribute",
                        min = 0,
                        description = "Attribute on which to perform aggregation"
                    )
                    String aggAttribute,
            @DescribeParameter(
                        name = "function",
                        description =
                                "An aggregate function to compute. Functions include Count, Average, Max, Median, Min, StdDev, Sum and SumArea.",
                        collectionType = AggregationFunction.class
                    )
                    Set<AggregationFunction> functions,
            @DescribeParameter(
                        name = "singlePass",
                        description =
                                "If True computes all aggregation values in a single pass (this will defeat DBMS-specific optimizations)",
                        defaultValue = "false"
                    )
                    boolean singlePass,
            @DescribeParameter(
                        name = "groupByAttributes",
                        min = 0,
                        description = "List of group by attributes",
                        collectionType = String.class
                    )
                    List<String> groupByAttributes,
            ProgressListener progressListener);  }