Examples of execute()


Examples of org.geotools.process.Process.execute()

        //execute the process
        Map<String,Object> result = null;
        Throwable error = null;
        try {
            Process p = pf.create(processName);
            result = p.execute( inputs, null );   
        }
        catch( Throwable t ) {
            //save the error to report back
            error = t;
        }
View Full Code Here

Examples of org.geotools.process.raster.AreaGridProcess.execute()

    @Test(expected = ProcessException.class)
    public void testAreaGridCRS() throws Exception {
        logger.info("AREAGRIDPROCESS: Performing CRS test");
        AreaGridProcess process = new AreaGridProcess();
        ReferencedEnvelope envelope = new ReferencedEnvelope(-180, 180, -90, 90, null);
        process.execute(envelope, -2, 10);
    }

    @Test(expected = ProcessException.class)
    public void testAreaGridParameters() throws Exception {
        logger.info("AREAGRIDPROCESS: Performing parameter test");
View Full Code Here

Examples of org.geotools.process.raster.ContourProcess.execute()

        // extract just two isolines
        final double levels[] = new double[2];
        levels[0] = 1500;
        levels[1] = 1700;
        final ContourProcess process = new ContourProcess();
        final SimpleFeatureCollection fc = process.execute(gc, 0, levels, null, false, false, null,
                new NullProgressListener());

        assertNotNull(fc);
        assertTrue(fc.size() > 0);
View Full Code Here

Examples of org.geotools.process.raster.CropCoverage.execute()

                }
                // Crop or Clip
                final CropCoverage cropCoverage = new CropCoverage(); // TODO avoid creation
                if (clip) {
                    // clipping means carefully following the ROI shape
                    clippedGridCoverage = cropCoverage.execute(reprojectedGridCoverage,
                            roiManager.getSafeRoiInTargetCRS(), progressListener);
                } else {
                    // use envelope of the ROI to simply crop and not clip the raster. This is important since when
                    // reprojecting we might read a bit more than needed!
                    final Geometry polygon = roiManager.getSafeRoiInTargetCRS();
View Full Code Here

Examples of org.geotools.process.raster.PolygonExtractionProcess.execute()

    public void testProcessStandaloneBasic() throws Exception {
      final GridCoverage2D gc = (GridCoverage2D) getCatalog().getCoverageByName(DEM.getLocalPart()).getGridCoverage(null, GeoTools.getDefaultHints());
      scheduleForDisposal(gc);
     
      final PolygonExtractionProcess process = new PolygonExtractionProcess();
    final SimpleFeatureCollection fc = process.execute(
        gc,
        0,
        true,
        null,
        null,
View Full Code Here

Examples of org.geotools.process.vector.BufferFeatureCollection.execute()

            b.add(i);
            features.add(b.buildFeature(i + ""));
        }
        Double distance = new Double(500);
        BufferFeatureCollection process = new BufferFeatureCollection();
        SimpleFeatureCollection output = process.execute(features, distance, null);
        assertEquals(2, output.size());

        SimpleFeatureIterator iterator = output.features();
        for (int i = 0; i < 2; i++) {
            Geometry expected = gf.createPoint(new Coordinate(i, i)).buffer(distance);
View Full Code Here

Examples of org.geotools.process.vector.CentroidProcess.execute()

    }
   
    @Test
    public void testSchema() {
        CentroidProcess cp = new CentroidProcess();
        SimpleFeatureCollection result = cp.execute(fc);
        SimpleFeatureType ft = result.getSchema();
        assertEquals(2, ft.getAttributeCount());
        assertEquals(Point.class, ft.getGeometryDescriptor().getType().getBinding());
        assertEquals(String.class, ft.getDescriptor("name").getType().getBinding());
    }
View Full Code Here

Examples of org.geotools.process.vector.ClipProcess.execute()

        if (clip && roi != null) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE, "Clipping features");
            }
            final ClipProcess clipProcess = new ClipProcess();// TODO avoid unnecessary creation
            clippedFeatures = clipProcess.execute(reprojectedFeatures,
                    roiManager.getSafeRoiInTargetCRS(), true);

            // checks
            DownloadUtilities.checkIsEmptyFeatureCollection(clippedFeatures);
        } else {
View Full Code Here

Examples of org.geotools.process.vector.InclusionFeatureCollection.execute()

            b.add(0);

            secondFeatures.add(b.buildFeature(numFeatures + ""));
        }
        InclusionFeatureCollection process = new InclusionFeatureCollection();
        SimpleFeatureCollection output = process.execute(features, secondFeatures);
        assertEquals(1, output.size());
        SimpleFeatureIterator iterator = output.features();

        Geometry expected = (Geometry) features.features().next().getDefaultGeometry();
        SimpleFeature sf = iterator.next();
View Full Code Here

Examples of org.geotools.process.vector.LRSGeocodeProcess.execute()

        SimpleFeatureSource source = featureSource.getFeatureSource("lrssimple");
        LRSGeocodeProcess process = new LRSGeocodeProcess();
        SimpleFeatureCollection origional = source.getFeatures();

        try {
            FeatureCollection result = process.execute(origional, "from_lrs_bad", "to_lrs", 1.0);
            Assert.fail("Expected error from bad from_lrs name");
        } catch (ProcessException e) {
            // Successful
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.