@Test public void rasterizePoints() throws Exception { System.out.println(" rasterize points"); ReferencedEnvelope bounds = new ReferencedEnvelope(-10, 10, -20, 20, DefaultEngineeringCRS.GENERIC_2D); Dimension gridDim = new Dimension(100, 100); SimpleFeatureCollection features = createPoints(bounds, gridDim); String covName = "Test"; ProgressListener monitor = null; GridCoverage2D cov = VectorToRasterProcess.process( features, "value", gridDim, bounds, covName, monitor); SimpleFeatureIterator iter = features.features(); int[] covValues = new int[1]; try { while (iter.hasNext()) { SimpleFeature feature = iter.next(); Coordinate coord = ((Geometry)feature.getDefaultGeometry()).getCoordinate(); Point2D worldPos = new Point2D.Double(coord.x, coord.y); int value = (Integer) feature.getAttribute("value"); cov.evaluate(worldPos, covValues); assertEquals(value, covValues[0]); } } finally { iter.close(); } }
public static GridCoverage2D process( SimpleFeatureCollection features, Object attribute, Dimension gridDim, Envelope bounds, String covName, ProgressListener monitor) throws VectorToRasterException { VectorToRasterFactory factory = new VectorToRasterFactory(); VectorToRasterProcess process = factory.create(); return process.convert(features, attribute, gridDim, bounds, covName, monitor); }
VectorToRasterProcess extends AbstractFeatureCollectionProcess { public static GridCoverage2D process( SimpleFeatureCollection features, Object attribute, Dimension gridDim, Envelope bounds, String covName, ProgressListener monitor) throws VectorToRasterException { VectorToRasterFactory factory = new VectorToRasterFactory(); VectorToRasterProcess process = factory.create(); return process.convert(features, attribute, gridDim, bounds, covName, monitor); } }
VectorToRasterProcess extends AbstractFeatureCollectionProcess { public static GridCoverage2D process( SimpleFeatureCollection features, Object attribute, Dimension gridDim, Envelope bounds, String covName, ProgressListener monitor) throws VectorToRasterException { VectorToRasterFactory factory = new VectorToRasterFactory(); VectorToRasterProcess process = factory.create(); return process.convert(features, attribute, gridDim, bounds, covName, monitor); } VectorToRasterProcess(VectorToRasterFactory factory); }
VectorToRasterProcess extends AbstractFeatureCollectionProcess { public static GridCoverage2D process( SimpleFeatureCollection features, Object attribute, Dimension gridDim, Envelope bounds, String covName, ProgressListener monitor) throws VectorToRasterException { VectorToRasterFactory factory = new VectorToRasterFactory(); VectorToRasterProcess process = factory.create(); return process.convert(features, attribute, gridDim, bounds, covName, monitor); } VectorToRasterProcess(VectorToRasterFactory factory); static GridCoverage2D process(
            SimpleFeatureCollection features,
            Object attribute,
            Dimension gridDim,
            Envelope bounds,
            String covName,
            ProgressListener monitor); Map<String, Object> execute( Map<String, Object> input, ProgressListener monitor ); }
VectorToRasterProcess extends AbstractFeatureCollectionProcess { public static GridCoverage2D process( SimpleFeatureCollection features, Object attribute, Dimension gridDim, Envelope bounds, String covName, ProgressListener monitor) throws VectorToRasterException { VectorToRasterFactory factory = new VectorToRasterFactory(); VectorToRasterProcess process = factory.create(); return process.convert(features, attribute, gridDim, bounds, covName, monitor); } VectorToRasterProcess(VectorToRasterFactory factory); static GridCoverage2D process(
            SimpleFeatureCollection features,
            Object attribute,
            Dimension gridDim,
            Envelope bounds,
            String covName,
            ProgressListener monitor); Map<String, Object> execute( Map<String, Object> input, ProgressListener monitor );  }