Package net.opengis.wcs20

Examples of net.opengis.wcs20.RequestBaseType


    }
   
    @Test
    public void testParseGetCoverageScaleToExtend() throws Exception {
        String capRequestPath = "requestGetCoverageScaleToExtent.xml";
        GetCoverageType gc = (GetCoverageType) parser.parse(getClass()
                .getResourceAsStream(capRequestPath));
       
        Map<String, Object> extensions = getExtensionsMap(gc);
        assertEquals(1, extensions.size());
       
View Full Code Here


    }
   
    @Test
    public void testParseGetCoverageInterpolationLinear() throws Exception {
        String capRequestPath = "requestGetCoverageInterpolationLinear.xml";
        GetCoverageType gc = (GetCoverageType) parser.parse(getClass()
                .getResourceAsStream(capRequestPath));
       
        Map<String, Object> extensions = getExtensionsMap(gc);
        assertEquals(1, extensions.size());
       
View Full Code Here

    }
   
    @Test
    public void testParseGetCoverageInterpolationMixed() throws Exception {
        String capRequestPath = "requestGetCoverageInterpolationMixed.xml";
        GetCoverageType gc = (GetCoverageType) parser.parse(getClass()
                .getResourceAsStream(capRequestPath));
       
        Map<String, Object> extensions = getExtensionsMap(gc);
        assertEquals(1, extensions.size());
       
View Full Code Here

    }
   
    @Test
    public void testParseGetCoverageCRS() throws Exception {
        String capRequestPath = "requestGetCoverageCRS.xml";
        GetCoverageType gc = (GetCoverageType) parser.parse(getClass()
                .getResourceAsStream(capRequestPath));
       
        Map<String, Object> extensions = getExtensionsMap(gc);
        assertEquals(2, extensions.size());
       
View Full Code Here

    @Override
    public Operation operationDispatched(Request request, Operation operation) {
        Object[] parameters = operation.getParameters();
        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) {
                    gc.setFilter(granuleFilter);
                } else {
                    gc.setFilter(FF.and(previous, granuleFilter));
                }
            }
        }
       
        return operation;
View Full Code Here

        super(GetCoverageType.class, WCS20_FACTORY);
    }

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

        // handle dimension subsets
        Object subsets = kvp.get("subset");
        if (subsets instanceof DimensionSubsetType) {
            gc.getDimensionSubset().add((DimensionSubsetType) subsets);
        } else if (subsets instanceof List) {
            for (Object subset : (List) subsets) {
                gc.getDimensionSubset().add((DimensionSubsetType) subset);
            }
        }

        // prepare for extensions
        gc.setExtension(WCS20_FACTORY.createExtensionType());

        // parse the extensions. Note, here we do only the validation bits that are not shared
        // with the XML, everything else is in GetCoverage
        parseGeoTiffExtension(gc, kvp);
        parseCRSExtension(gc, rawKvp);
View Full Code Here

    @SuppressWarnings("unchecked")
    protected GetCoverageType parse(String url) throws Exception {
        Map<String, Object> rawKvp = new CaseInsensitiveMap(KvpUtils.parseQueryString(url));
        Map<String, Object> kvp = new CaseInsensitiveMap(parseKvp(rawKvp));
        WCS20GetCoverageRequestReader reader = new WCS20GetCoverageRequestReader();
        GetCoverageType gc = (GetCoverageType) reader.createRequest();
        return (GetCoverageType) reader.read(gc, kvp, rawKvp);
    }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setInterpolationAxes(InterpolationAxesType newInterpolationAxes) {
        InterpolationAxesType oldInterpolationAxes = interpolationAxes;
        interpolationAxes = newInterpolationAxes;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Wcs20Package.INTERPOLATION_TYPE__INTERPOLATION_AXES, oldInterpolationAxes, interpolationAxes));
    }
View Full Code Here

            throwInvalidSyntaxException();
        } else if (value.startsWith(",") || value.endsWith(",")) {
            throwInvalidSyntaxException();
        }

        InterpolationAxesType axes = Wcs20Factory.eINSTANCE.createInterpolationAxesType();
        result.setInterpolationAxes(axes);
        String[] components = value.split("\\s*,\\s*");
        for (String component : components) {
            // minimal validation of the content
            if (!component.matches("http://www.opengis.net/def/axis/OGC/1/.*:http://www.opengis.net/def/interpolation/OGC/1/.*")) {
                // not a regular axis:interpolation structure
                throwInvalidSyntaxException();
            } else if (component.matches(".*:\\s*:.*")) {
                // two consequent columns
                throwInvalidSyntaxException();
            }
           
            int idx = component.indexOf(":", "http://www.opengis.net/def/axis/OGC/1/".length());
            InterpolationAxisType ia = Wcs20Factory.eINSTANCE.createInterpolationAxisType();
            ia.setAxis(component.substring(0, idx));
            ia.setInterpolationMethod(component.substring(idx + 1));

            axes.getInterpolationAxis().add(ia);
        }

        return result;
    }
View Full Code Here

                // two consequent columns
                throwInvalidSyntaxException();
            }
           
            int idx = component.indexOf(":", "http://www.opengis.net/def/axis/OGC/1/".length());
            InterpolationAxisType ia = Wcs20Factory.eINSTANCE.createInterpolationAxisType();
            ia.setAxis(component.substring(0, idx));
            ia.setInterpolationMethod(component.substring(idx + 1));

            axes.getInterpolationAxis().add(ia);
        }

        return result;
View Full Code Here

TOP

Related Classes of net.opengis.wcs20.RequestBaseType

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.