Package org.vfny.geoserver.wcs

Examples of org.vfny.geoserver.wcs.WcsException


                    for (int b = 0; b < bands.length; b++)
                        bands[b] = min + (b * res);
                }

                if (bands == null)
                    throw new WcsException("Invalid values for axis " + axisSubset.getName(),
                            InvalidParameterValue, "AxisSubset");
            } else if (axisSubset.getName().equalsIgnoreCase(WCSUtils.ELEVATION)) {
                double[] elevations = null;
                if (axisSubset.getSingleValue().size() > 0) {
                    elevations = new double[axisSubset.getSingleValue().size()];
View Full Code Here


                break;
            }
        }

        if (type == null)
            throw new WcsException("Could not understand grid type '" + value + "'",
                    InvalidParameterValue, "GridType");

        if (type == GridType.GT2dGridIn3dCrs)
            throw new WcsException("GeoServer does not support type " + type.name(),
                    InvalidParameterValue, "GridType");

        return type.getXmlConstant();
    }
View Full Code Here

                timeResolutionUnit = DURATION_UNITS[i];
                return;
            }
        }
        // uh oh? it's a value in milliseconds?
        throw new WcsException(
                "Dimension's resolution requires milliseconds for full representation, "
                        + "but this cannot be represented in WCS 2.0 describe coverage output");
    }
View Full Code Here

    @Override
    public Object parse(String value) throws Exception {
        LayerInfo layer = catalog.getLayerByName(value);
        if (layer == null || layer.getType() != LayerInfo.Type.RASTER)
            throw new WcsException("Could not find coverage '" + value + "'",
                    InvalidParameterValue, "identifier");
        return super.parse(value);
    }
View Full Code Here

    public Object parse(String epsgCode) throws Exception {
        if (epsgCode != null) {
            try {
                CRS.decode(epsgCode);
            } catch (Exception e) {
                throw new WcsException("Invalid SRS code " + epsgCode, InvalidParameterValue, "GridBaseCRS");
            }
        }
       
        return epsgCode;
    }
View Full Code Here

    }
   
    @Override
    public Object parse(String value) throws Exception {
        if(!GridCS.GCSGrid2dSquare.getXmlConstant().equalsIgnoreCase(value))
            throw new WcsException("Unrecognized GridCS " + value, WcsExceptionCode.InvalidParameterValue, "GridCS");
       
        return GridCS.GCSGrid2dSquare.getXmlConstant();
    }
View Full Code Here

       
        // we need at least one coverage
        final String identifiersValue = (String) rawKvp.get("identifiers");
        final List identifiers = KvpUtils.readFlat(identifiersValue);
        if(identifiers == null || identifiers.size() == 0) {
            throw new WcsException("Required paramer, identifiers, missing", WcsExceptionCode.MissingParameterValue, "identifiers");
        }
       
        // all right, set into the model (note there is a mismatch between the kvp name and the
        // xml name, that's why we have to parse the identifiers by hand)
        describeCoverage.getIdentifier().addAll(identifiers);
       
       
        // if not specified, throw a resounding exception (by spec)
        if(!describeCoverage.isSetVersion())
            throw new WcsException("Version has not been specified", WcsExceptionCode.MissingParameterValue, "version");

        return request;
    }
View Full Code Here

    public Object read(Object request, Map kvp, Map rawKvp) throws Exception {
        GetCoverageType getCoverage = (GetCoverageType) super.read(request, kvp, rawKvp);

        // grab coverage info to perform further checks
        if (getCoverage.getIdentifier() == null)
            throw new WcsException("identifier parameter is mandatory", MissingParameterValue,
                    "identifier");

        // build the domain subset
        getCoverage.setDomainSubset(parseDomainSubset(kvp));
View Full Code Here

        // either bbox or timesequence must be there
        BoundingBoxType bbox = (BoundingBoxType) kvp.get("BoundingBox");
        TimeSequenceType timeSequence = (TimeSequenceType) kvp.get("TimeSequence");
        if (timeSequence == null && bbox == null)
            throw new WcsException(
                    "Bounding box cannot be null, TimeSequence has not been specified",
                    WcsExceptionCode.MissingParameterValue, "BoundingBox");

        domainSubset.setBoundingBox(bbox);
        domainSubset.setTemporalSubset(timeSequence);
View Full Code Here

            output.setStore(store.booleanValue());

        // check and set format
        String format = (String) kvp.get("format");
        if (format == null)
            throw new WcsException("format parameter is mandatory", MissingParameterValue, "format");
        output.setFormat(format);

        // set the other gridcrs properties
        final GridCrsType gridCRS = output.getGridCRS();
        gridCRS.setGridBaseCRS((String) kvp.get("gridBaseCrs"));
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wcs.WcsException

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.