Package org.geoserver.script.wps

Examples of org.geoserver.script.wps.ScriptProcess.execute()


       
        // test execute
        Map<String, Object> input = new HashMap<String, Object>();
        input.put("first", 2.0);
        input.put("second", 4.0);
        Map<String,Object> result = process.execute(input, null);
        assertNotNull("add result", result);
        assertTrue("sum in results", result.containsKey("sum"));
        Object sum = result.get("sum");
        assertEquals("correct sum", 6.0, (Double) sum, 0.0);
    }
View Full Code Here


        WKTReader wktReader = new WKTReader();
        Geometry point = wktReader.read("POINT(1 1)");
        Map<String, Object> input = new HashMap<String, Object>();
        input.put("geom", point);
        input.put("distance", 4.0);
        Map<String,Object> result = process.execute(input, null);
        assertNotNull("buffer result", result);
        assertTrue("result in results", result.containsKey("result"));
        Object obj = result.get("result");
        assertTrue("got back a geometry", obj instanceof Geometry);
        Geometry geom = (Geometry) obj;
View Full Code Here

        Map<String, Object> input = new HashMap<String, Object>();
        input.put("geometry", wktReader.read("POINT (0.0002 0.0007)"));
        input.put("features", getFeatures("http://www.opengis.net/cite", "Bridges"));

        Map<String,Object> result = process.execute(input, null);
        assertNotNull("intersects result", result);
        assertTrue("intersects in results", result.containsKey("intersects"));
        Object obj = result.get("intersects");
        assertTrue("got back a boolean", obj instanceof Boolean);
        assertTrue("intersects", (Boolean) obj);
View Full Code Here

        Map<String, Object> input = new HashMap<String, Object>();
        input.put("geometry", wktReader.read("POINT (10 0.0007)"));
        input.put("features", getFeatures("http://www.opengis.net/cite", "Bridges"));

        Map<String,Object> result = process.execute(input, null);
        assertNotNull("intersects result", result);
        assertTrue("intersects in results", result.containsKey("intersects"));
        Object obj = result.get("intersects");
        assertTrue("got back a boolean", obj instanceof Boolean);
        assertFalse("intersects", (Boolean) obj);
View Full Code Here

        Map<String, Object> input = new HashMap<String, Object>();
        input.put("geometry", wktReader.read("POINT (0.00216 0.00084)"));
        input.put("features", getFeatures("http://www.opengis.net/cite", "Buildings"));

        Map<String,Object> result = process.execute(input, null);
        assertNotNull("intersects result", result);
        assertTrue("intersects in results", result.containsKey("intersects"));
        Object obj = result.get("intersects");
        assertTrue("got back a boolean", obj instanceof Boolean);
        assertTrue("intersects", (Boolean) obj);
View Full Code Here

        Map<String, Object> input = new HashMap<String, Object>();
        input.put("geometry", wktReader.read("LINESTRING (0.00216 0.00084, 0.001 0.00054)"));
        input.put("features", getFeatures("http://www.opengis.net/cite", "Buildings"));

        Map<String,Object> result = process.execute(input, null);
        assertNotNull("intersects result", result);
        assertTrue("intersects in results", result.containsKey("intersects"));
        Object obj = result.get("intersects");
        assertTrue("got back a boolean", obj instanceof Boolean);
        assertTrue("intersects", (Boolean) obj);
View Full Code Here

        Map<String, Object> input = new HashMap<String, Object>();
        input.put("geometry", wktReader.read("POINT (10 0.00084)"));
        input.put("features", getFeatures("http://www.opengis.net/cite", "Buildings"));

        Map<String,Object> result = process.execute(input, null);
        assertNotNull("intersects result", result);
        assertTrue("intersects in results", result.containsKey("intersects"));
        Object obj = result.get("intersects");
        assertTrue("got back a boolean", obj instanceof Boolean);
        assertFalse("intersects", (Boolean) obj);
View Full Code Here

        Map<String, Object> input = new HashMap<String, Object>();
        input.put("origin", wktReader.read("POINT (10 0.00084)"));
        input.put("features", getFeatures("http://www.opengis.net/cite", "Buildings"));

        Map<String,Object> output = process.execute(input, null);
        assertNotNull("distbear output", output);
        assertTrue("result in outputs", output.containsKey("result"));
        Object obj = output.get("result");
        assertTrue("result type", obj instanceof SimpleFeatureCollection);
        SimpleFeatureCollection features = (SimpleFeatureCollection) obj;
View Full Code Here

        geoms.add(wktReader.read("POINT (0 0)"));
        geoms.add(wktReader.read("POINT (1 0)"));
        input.put("geom", geoms);
        input.put("distance", 2);

        Map<String,Object> output = process.execute(input, null);
        assertNotNull("output", output);
        assertTrue("result in outputs", output.containsKey("result"));
        Object obj = output.get("result");
        assertTrue("result type", obj instanceof Polygon);
        Polygon geom = (Polygon) obj;
View Full Code Here

        Map<String, Object> input = new HashMap<String, Object>();
        input.put("geom", wktReader.read("POINT (0 0)"));
        input.put("distance", 0.5);
        input.put("line", wktReader.read("LINESTRING (-1 -1, 1 1)"));

        Map<String,Object> output = process.execute(input, null);
        assertNotNull("output", output);
        assertTrue("result in outputs", output.containsKey("result"));
        Object obj = output.get("result");
        assertTrue("result type", obj instanceof GeometryCollection);
        GeometryCollection geom = (GeometryCollection) obj;
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.