@Test public void testHoles() throws Exception { System.out.println(" grid with holes"); final float[][] DATA = { {1, 1, 1, 1, 0, 1, 1, 1, 1}, {1, 0, 0, 1, 0, 1, 0, 0, 1}, {1, 0, 0, 1, 0, 1, 0, 0, 1}, {1, 1, 1, 1, 0, 1, 1, 1, 1} }; final int NUM_POLYS = 2; GridCoverage2D cov = covFactory.create( "coverage", DATA, new ReferencedEnvelope(0, DATA[0].length, 0, DATA.length, null)); int band = 0; Set<Double> outsideValues = Collections.singleton(0D); ProgressListener progress = null; SimpleFeatureCollection fc = RasterToVectorProcess.process(cov, band, null, outsideValues, true, progress); assertEquals(NUM_POLYS, fc.size()); SimpleFeatureIterator iter = fc.features(); try { while (iter.hasNext()) { Polygon poly = (Polygon) iter.next().getDefaultGeometry(); assertEquals(1, poly.getNumInteriorRing()); } } finally { iter.close(); } }
public static SimpleFeatureCollection process( GridCoverage2D cov, int band, Envelope bounds, Collection<Double> outsideValues, boolean insideEdges, ProgressListener monitor) throws ProcessException { RasterToVectorFactory factory = new RasterToVectorFactory(); RasterToVectorProcess process = factory.create(); return process.convert(cov, band, bounds, outsideValues, insideEdges, monitor); }
RasterToVectorProcess extends AbstractProcess { public static SimpleFeatureCollection process( GridCoverage2D cov, int band, Envelope bounds, Collection<Double> outsideValues, boolean insideEdges, ProgressListener monitor) throws ProcessException { RasterToVectorFactory factory = new RasterToVectorFactory(); RasterToVectorProcess process = factory.create(); return process.convert(cov, band, bounds, outsideValues, insideEdges, monitor); } }
RasterToVectorProcess extends AbstractProcess { public static SimpleFeatureCollection process( GridCoverage2D cov, int band, Envelope bounds, Collection<Double> outsideValues, boolean insideEdges, ProgressListener monitor) throws ProcessException { RasterToVectorFactory factory = new RasterToVectorFactory(); RasterToVectorProcess process = factory.create(); return process.convert(cov, band, bounds, outsideValues, insideEdges, monitor); } RasterToVectorProcess(ProcessFactory factory); }
RasterToVectorProcess extends AbstractProcess { public static SimpleFeatureCollection process( GridCoverage2D cov, int band, Envelope bounds, Collection<Double> outsideValues, boolean insideEdges, ProgressListener monitor) throws ProcessException { RasterToVectorFactory factory = new RasterToVectorFactory(); RasterToVectorProcess process = factory.create(); return process.convert(cov, band, bounds, outsideValues, insideEdges, monitor); } RasterToVectorProcess(ProcessFactory factory); Map<String, Object> execute(Map<String, Object> input, ProgressListener monitor); static SimpleFeatureCollection process(
            GridCoverage2D cov,
            int band,
            Envelope bounds,
            Collection<Double> outsideValues,
            boolean insideEdges,
            ProgressListener monitor); }
RasterToVectorProcess extends AbstractProcess { public static SimpleFeatureCollection process( GridCoverage2D cov, int band, Envelope bounds, Collection<Double> outsideValues, boolean insideEdges, ProgressListener monitor) throws ProcessException { RasterToVectorFactory factory = new RasterToVectorFactory(); RasterToVectorProcess process = factory.create(); return process.convert(cov, band, bounds, outsideValues, insideEdges, monitor); } RasterToVectorProcess(ProcessFactory factory); Map<String, Object> execute(Map<String, Object> input, ProgressListener monitor); static SimpleFeatureCollection process(
            GridCoverage2D cov,
            int band,
            Envelope bounds,
            Collection<Double> outsideValues,
            boolean insideEdges,
            ProgressListener monitor);  }