Package org.geotools.process

Examples of org.geotools.process.Process


        // based on the describeprocess, setup the execute
        ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
        ProcessDescriptionType pdt = (ProcessDescriptionType) processDesc.getProcessDescription().get(0);
        WPSFactory wpsfactory = new WPSFactory(pdt, this.url);
        Process process = wpsfactory.create();

        // setup the inputs
        Map<String, Object> map = new TreeMap<String, Object>();
        WKTReader reader = new WKTReader(new GeometryFactory());
        List<Geometry> list = new ArrayList<Geometry>();
        Geometry geom1 = (Polygon) reader.read("POLYGON((20 10, 30 0, 40 10, 30 20, 20 10))");
        Geometry geom2 = (Polygon) reader.read("POLYGON((20 30, 30 0, 20 20, 80 20, 20 30))");
        Geometry geom3 = (Polygon) reader.read("POLYGON((177 10, 30 88, 40 70, 46 20, 177 10))");
        Geometry geom4 = (Polygon) reader.read("POLYGON((5 10, 5 0, 13 10, 5 20, 5 10))");
        list.add(geom1);
        list.add(geom2);
        list.add(geom3);
        list.add(geom4);
        map.put("geom", list);

        // execute/send-request for the process
        Map<String, Object> results = process.execute(map, null);

        // check that the result is expected
        assertNotNull(results);

        // Geometry expected = geom1.union(geom2);
View Full Code Here


        // based on the describeprocess, setup the execute
        ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
        ProcessDescriptionType pdt = (ProcessDescriptionType) processDesc.getProcessDescription().get(0);
        WPSFactory wpsfactory = new WPSFactory(pdt, this.url);
        Process process = wpsfactory.create();

        // setup the inputs as empty (which should return an exception)
        Map<String, Object> map = new TreeMap<String, Object>();

        // execute/send-request for the process
        Map<String, Object> results = process.execute(map, null);

        // check that the result is expected (null)
        assertNull(results);

    }
View Full Code Here

        // based on the describeprocess, setup the execute
        ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
        ProcessDescriptionType pdt = (ProcessDescriptionType) processDesc.getProcessDescription().get(0);
        WPSFactory wpsfactory = new WPSFactory(pdt, this.url);
        Process process = wpsfactory.create();

        // setup the inputs
        Map<String, Object> map = new TreeMap<String, Object>();
        Double d1 = 77.84;
        Double d2 = 40039.229;
        map.put("input_a", d1);
        map.put("input_b", d2);

        // execute/send-request for the process
        Map<String, Object> results = process.execute(map, null);

        // check that the result is expected
        assertNotNull(results);

        Double result = (Double) results.get("result");
View Full Code Here

        // execute the process
        Map<String, Object> result = null;
        ProcessListener listener = new ProcessListener();
        Throwable exception = null;
        try {
            Process p = pf.create(processName);
            result = p.execute(inputs, listener);
        } catch (Exception e) {
            exception = e;
        }
       
        // if no direct exception, check if failure occurred from the listener
View Full Code Here

        if (pf == null) {
            throw new WPSException("No such process: " + processName);
        }

        // execute the process in the same thread as the caller
        Process p = pf.create(processName);
        Map<String, Object> result = p.execute(inputs, listener);
        if (listener.exception != null) {
            throw new ProcessException("Process failed: " + listener.exception.getMessage(),
                    listener.exception);
        }
        return result;
View Full Code Here

                }
   
                // execute the process
                Map<String, Object> result = null;
                try {
                    Process p = pf.create(processName);
                    result = p.execute(inputs, listener);
                    if (listener.exception != null) {
                        throw new WPSException("Process failed: " + listener.exception.getMessage(),
                                listener.exception);
                    }
                    return result;
View Full Code Here

        processFactory = new ScriptProcessFactory(getScriptManager());
    }
   
    private ScriptProcess createProcess(String id) {
        Name name = new NameImpl("js", id);
        Process process = processFactory.create(name);
        assertNotNull("not null: " + name.toString(), process);
        assertTrue("script process: " + name.toString(), process instanceof ScriptProcess);
        return (ScriptProcess) process;
    }
View Full Code Here

TOP

Related Classes of org.geotools.process.Process

Copyright © 2018 www.massapicom. 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.