Package org.geoserver.wps

Examples of org.geoserver.wps.WPSException


        // start from 1, 0 is the value
        for (int i = 1; i < attributes.length; i++) {
            final String att = attributes[i];
            int idx = att.indexOf("=");
            if(idx == -1) {
                throw new WPSException("Invalid syntax for data input attribute: @" + att);
            }
            if(idx == att.length() - 1) {
                result.put(att.substring(0, idx), null);
            } else {
                result.put(att.substring(0, idx), att.substring(idx + 1, att.length()));
View Full Code Here


                return bbox;
            } else {
                return null;
            }
        } catch(Exception e) {
            throw new WPSException("Failed to parse the bounding box", e);
        }
    }
View Full Code Here

    }

    OutputDefinitionType parseOutputDefinitionType(Map<String, Parameter<?>> outputs, Wps10Factory factory,
            IOParam ioParam, boolean inDocument) {
        if(!outputs.containsKey(ioParam.id)) {
            throw new WPSException("Unknown output " + ioParam.id);
        }
       
        OutputDefinitionType odt;
        if(inDocument) {
            DocumentOutputDefinitionType dout = factory.createDocumentOutputDefinitionType();
View Full Code Here

       
        if(ioParams.size() == 0) {
            return response;
        }
        if(ioParams.size() > 1) {
            throw new WPSException("There can be only one RawDataOutput");
        }
       
        response.setRawDataOutput(parseOutputDefinitionType(resultInfo, factory, ioParams.get(0), false));
       
        return response;
View Full Code Here

            return null;
        } else {
            try {
                return provider.getValue();
            } catch (Exception e) {
                throw new WPSException("Failed to retrieve value for input "
                        + provider.getInputId(), e);
            }
        }
    }
View Full Code Here

        @Override
        public Object getValue() {
            try {
                return provider.getValue();
            } catch (Exception e) {
                throw new WPSException("Failed to retrieve value for input "
                        + provider.getInputId());
            }
        }
View Full Code Here

            @DescribeParameter(name = "name", description = "Name of raster, optionally fully qualified (workspace:name)") String name,
            @DescribeParameter(name = "filter", description = "Filter to use on the raster data", min = 0) Filter filter)
            throws IOException {
        CoverageInfo ci = catalog.getCoverageByName(name);
        if (ci == null) {
            throw new WPSException("Could not find coverage " + name);
        }

        GridCoverageReader reader = ci.getGridCoverageReader(null, null);
        final ParameterValueGroup readParametersDescriptor = reader.getFormat().getReadParameters();
        final List<GeneralParameterDescriptor> parameterDescriptors = readParametersDescriptor
View Full Code Here

            ProgressListener listener = new DefaultProgressListener();
            p.execute(inputs, listener);
            fail("Should have thrown a WPSException");
        } catch (ProcessException processException) {
            PyException pyException = (PyException) processException.getCause();
            WPSException e = (WPSException) pyException.getCause();
            assertEquals("Forbidden", e.getMessage());
            assertEquals("userInput", e.getCode());
            assertEquals("distance", e.getLocator());
        }
    }
View Full Code Here

        } else if(org.opengis.geometry.Envelope.class.isAssignableFrom(getType())) {
            GeneralEnvelope ge = new GeneralEnvelope(lower, upper);
            ge.setCoordinateReferenceSystem(crs);
            return ge;
        } else {
            throw new WPSException("Failed to convert from OWS 1.1 Bounding box type "
                    + "to the internal representation: " + getType());
        }
    }
View Full Code Here

            org.opengis.geometry.Envelope env = (org.opengis.geometry.Envelope) object;
            crs = env.getCoordinateReferenceSystem();
            bbox.setLowerCorner(Arrays.asList(env.getLowerCorner().getCoordinate()));
            bbox.setUpperCorner(Arrays.asList(env.getUpperCorner().getCoordinate()));
        } else {
            throw new WPSException("Failed to convert from " + object
                    + " to an OWS 1.1 Bounding box type");
        }
       
        // handle the EPSG code
        if(crs != null) {
            try {
                Integer code = CRS.lookupEpsgCode(crs, false);
                if(code != null) {
                    bbox.setCrs("EPSG:" + code);
                }
            } catch(Exception e) {
                throw new WPSException("Could not lookup epsg code for " + crs, e);
            }
        }
       
        return bbox;
    }
View Full Code Here

TOP

Related Classes of org.geoserver.wps.WPSException

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.