@Test public void testResults() throws Exception { CentroidProcess cp = new CentroidProcess(); SimpleFeatureCollection result = cp.execute(fc); SimpleFeatureIterator it = result.features(); assertTrue(it.hasNext()); SimpleFeature f = it.next(); assertEquals(0, ((Point) f.getDefaultGeometry()).getX(), 1e-6); assertEquals(0, ((Point) f.getDefaultGeometry()).getY(), 1e-6); assertEquals("one", f.getAttribute("name")); f = it.next(); assertEquals(10, ((Point) f.getDefaultGeometry()).getX(), 1e-6); assertEquals(0, ((Point) f.getDefaultGeometry()).getY(), 1e-6); assertEquals("two", f.getAttribute("name")); }
@DescribeResult(name = "result", description = "Centroids of input features") public SimpleFeatureCollection execute( @DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features) throws ProcessException { return DataUtilities.simple(new CentroidFeatureCollection(features)); }
CentroidProcess implements VectorProcess { @DescribeResult(name = "result", description = "Centroids of input features") public SimpleFeatureCollection execute( @DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features) throws ProcessException { return DataUtilities.simple(new CentroidFeatureCollection(features)); } }
CentroidProcess implements VectorProcess { @DescribeResult(name = "result", description = "Centroids of input features") public SimpleFeatureCollection execute( @DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features) throws ProcessException { return DataUtilities.simple(new CentroidFeatureCollection(features)); }  }
CentroidProcess implements VectorProcess { @DescribeResult(name = "result", description = "Centroids of input features") public SimpleFeatureCollection execute( @DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features) throws ProcessException { return DataUtilities.simple(new CentroidFeatureCollection(features)); }  @DescribeResult(name = "result", description = "Centroids of input features") SimpleFeatureCollection execute(
            @DescribeParameter(name = "features", description = "Input feature collection")
                    SimpleFeatureCollection features); }
CentroidProcess implements VectorProcess { @DescribeResult(name = "result", description = "Centroids of input features") public SimpleFeatureCollection execute( @DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features) throws ProcessException { return DataUtilities.simple(new CentroidFeatureCollection(features)); }  @DescribeResult(name = "result", description = "Centroids of input features") SimpleFeatureCollection execute(
            @DescribeParameter(name = "features", description = "Input feature collection")
                    SimpleFeatureCollection features);  }