Package org.geoserver.wcs2_0

Examples of org.geoserver.wcs2_0.WCS20Const


                double low = Double.parseDouble(trim.getTrimLow());
                double high = Double.parseDouble(trim.getTrimHigh());

                // low > high???
                if (low > high) {
                    throw new WCS20Exception("Low greater than High in trim for dimension: "
                            + trim.getDimension(),
                            WCS20Exception.WCS20ExceptionCode.InvalidSubsetting, "dimensionTrim");
                }

                return new NumberRange<Double>(Double.class, low, high);
            } catch (NumberFormatException e) {
                throw new WCS20Exception("Invalid numeric value",
                        OWSExceptionCode.InvalidParameterValue, "dimensionTrim", e);
            }
        }
View Full Code Here


                badCoverageIds.add(datasetId);
            }
        }
        if (!badCoverageIds.isEmpty()) {
            String mergedIds = StringUtils.merge(badCoverageIds);
            throw new WCS20Exception("Could not find the requested coverage(s): " + mergedIds,
                    new OWSExceptionCode("noSuchEODataset", 404), "eoid");
        }

        WCS20DescribeCoverageTransformer tx = new WCS20DescribeCoverageTransformer(
                getServiceInfo(), catalog, responseFactory, envelopeAxesMapper, mimemapper);
View Full Code Here

        if(parameters != null && parameters.length > 0 && parameters[0] instanceof GetCoverageType) {
            // check we are going against a granule
            GetCoverageType gc = (GetCoverageType) parameters[0];
            String coverageId = gc.getCoverageId();
            if(coverageId == null) {
                throw new WCS20Exception("Required parameter coverageId is missing",
                        WCS20Exception.WCS20ExceptionCode.MissingParameterValue, "coverageId");
            }
            CoverageInfo coverage = codec.getGranuleCoverage(coverageId);
            if(coverage != null) {
                // set the actual coverage name
                String actualCoverageId = NCNameResourceCodec.encode(coverage);
                gc.setCoverageId(actualCoverageId);
               
                // extract the granule filter
                Filter granuleFilter = codec.getGranuleFilter(coverageId);
               
                // check the filter actually matches one granule
                if(!readerHasGranule(coverage, granuleFilter)) {
                    throw new WCS20Exception("Could not locate coverage " + coverageId, WCS20ExceptionCode.NoSuchCoverage, "coverageId");
                }
               
                // set and/or merge with the previous filter
                Filter previous = gc.getFilter();
                if(previous == null || previous == Filter.INCLUDE) {
View Full Code Here

            StructuredGridCoverage2DReader reader = (StructuredGridCoverage2DReader) ci.getGridCoverageReader(null, null);
            String coverageName = codec.getCoverageName(ci);
            GranuleSource source = reader.getGranules(coverageName, true);
            return source.getCount(new Query(coverageName, granuleFilter)) > 0;           
        } catch(IOException e) {
            throw new WCS20Exception("Could not determine if the coverage has the specified granule", e);
        }
    }
View Full Code Here

            Sections sections = Wcs20Factory.eINSTANCE.createSections();
            for(Object o : owsSections.getSection()) {
                String sectionName = (String) o;
                Section section = Section.get(sectionName);
                if(section == null) {
                    throw new WCS20Exception("Invalid sections value " + sectionName + ", supported values are " + Arrays.asList(Section.values()),
                            OWSExceptionCode.InvalidParameterValue, "sections");
                }
                sections.getSection().add(section);
            }
            kvp.put("sections", sections);
View Full Code Here

                badCoverageIds.add(encodedCoverageId);
            }
        }
        if(!badCoverageIds.isEmpty()) {
            String mergedIds = StringUtils.merge(badCoverageIds);
            throw new WCS20Exception("Could not find the requested coverage(s): " + mergedIds
                    , WCS20Exception.WCS20ExceptionCode.NoSuchCoverage, "coverageId");
        }

        WCSInfo wcs = getServiceInfo();
View Full Code Here

        return sa;
    }

    @Override
    protected void throwInvalidSyntaxException(Exception e) {
        WCS20Exception ex = new WCS20Exception(
                "Invalid ScaleAxes syntax, expecting a comma separate list of axisName(scale)*",
                WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "scaleAxes");
        if(e != null) {
            ex.initCause(e);
        }
        throw ex;
       
    }
View Full Code Here

        return result;
    }

    protected void throwInvalidSyntaxException() {
        throw new WCS20Exception(
                "Invalid Interpolation syntax, expecting either a single interpolation value, "
                        + "or a comma separated list of axis:interpolation specs",
                WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "interpolation");
    }
View Full Code Here

        return tas;
    }

    @Override
    protected void throwInvalidSyntaxException(Exception e) {
        WCS20Exception ex = new WCS20Exception(
                "Invalid ScaleSize syntax, expecting a comma separate list of axisName(size)*",
                WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "scaleSize");
        if (e != null) {
            ex.initCause(e);
        }
        throw ex;

    }
View Full Code Here

        return result;
    }

    protected void throwInvalidSyntaxException() {
        throw new WCS20Exception(
                "Invalid RangeSubset syntax, expecting a list of band names or band ranges (b1:b2)",
                WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "rangeSubset");
    }
View Full Code Here

TOP

Related Classes of org.geoserver.wcs2_0.WCS20Const

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.