Package net.opengis.wcs11

Examples of net.opengis.wcs11.RangeSubsetType


                for (Node timePeriodNode : timePeriods) {
                    Instant begining = new DefaultInstant((Position) timePeriodNode.getChild("BeginPosition").getValue());
                    Instant ending = new DefaultInstant((Position) timePeriodNode.getChild("EndPosition").getValue());

                    //Period timePeriod = new DefaultPeriod(begining, ending);
                    TimePeriodType timePeriod = Wcs111Factory.eINSTANCE.createTimePeriodType();
                    Date beginPosition = cvtToGmt(begining.getPosition().getDate());
                    Date endPosition = cvtToGmt(ending.getPosition().getDate());
                   
                    timePeriod.setBeginPosition(beginPosition);
                    timePeriod.setEndPosition(endPosition);

                    results.getTimePeriod().add(timePeriod);
                }

                return results;
View Full Code Here


    private DomainSubsetType parseDomainSubset(Map kvp) {
        final DomainSubsetType domainSubset = Wcs111Factory.eINSTANCE.createDomainSubsetType();

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

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetTemporalDomain(TimeSequenceType newTemporalDomain, NotificationChain msgs) {
        TimeSequenceType oldTemporalDomain = temporalDomain;
        temporalDomain = newTemporalDomain;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs111Package.COVERAGE_DOMAIN_TYPE__TEMPORAL_DOMAIN, oldTemporalDomain, newTemporalDomain);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetTemporalSubset(TimeSequenceType newTemporalSubset, NotificationChain msgs) {
        TimeSequenceType oldTemporalSubset = temporalSubset;
        temporalSubset = newTemporalSubset;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs111Package.DOMAIN_SUBSET_TYPE__TEMPORAL_SUBSET, oldTemporalSubset, newTemporalSubset);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
            throws Exception {
        List<Node> timePositions = node.getChildren("timePosition");
        TimeSequenceType results = Wcs111Factory.eINSTANCE.createTimeSequenceType();
       
        if (timePositions != null && !timePositions.isEmpty()) {
            for (Node timePositionNode : timePositions) {
                Date positionDate = ((Position) timePositionNode.getValue()).getDate();
                results.getTimePosition().add(cvtToGmt(positionDate));
            }

            return results;
        } else {
            List<Node> timePeriods = node.getChildren("TimePeriod");
            if (timePeriods != null && !timePeriods.isEmpty()) {
                for (Node timePeriodNode : timePeriods) {
                    Instant begining = new DefaultInstant((Position) timePeriodNode.getChild("BeginPosition").getValue());
                    Instant ending = new DefaultInstant((Position) timePeriodNode.getChild("EndPosition").getValue());

                    //Period timePeriod = new DefaultPeriod(begining, ending);
                    TimePeriodType timePeriod = Wcs111Factory.eINSTANCE.createTimePeriodType();
                    Date beginPosition = cvtToGmt(begining.getPosition().getDate());
                    Date endPosition = cvtToGmt(ending.getPosition().getDate());
                   
                    timePeriod.setBeginPosition(beginPosition);
                    timePeriod.setEndPosition(endPosition);

                    results.getTimePeriod().add(timePeriod);
                }

                return results;
            }
        }
View Full Code Here

                .getResourceAsStream(capRequestPath));
       
        Map<String, Object> extensions = getExtensionsMap(gc);
        assertEquals(1, extensions.size());
       
        RangeSubsetType rangeSubset = (RangeSubsetType) extensions.get("http://www.opengis.net/wcs/range-subsetting/1.0:rangeSubset");
       
        // check values
        assertEquals(2, rangeSubset.getRangeItems().size());
        RangeItemType first = rangeSubset.getRangeItems().get(0);
        assertEquals("band1", first.getRangeComponent());
        RangeItemType second = rangeSubset.getRangeItems().get(1);
        assertEquals("band3", second.getRangeInterval().getStartComponent());
        assertEquals("band5", second.getRangeInterval().getEndComponent());
    }
View Full Code Here

        super("rangesubset", RangeSubsetType.class);
    }

    @Override
    public Object parse(String value) throws Exception {
        RangeSubsetType result = Wcs20Factory.eINSTANCE.createRangeSubsetType();

        // remove space
        value = value.trim();
       
        // minimal validation
        if(value.matches(".*,\\s*,.*")) {
            // two consequent commas
            throwInvalidSyntaxException();
        } else if(value.startsWith(",") || value.endsWith(",")) {
            throwInvalidSyntaxException();
        }
       
        String[] components = value.split("\\s*,\\s*");
        for (String component : components) {
            if (component.contains(":")) {
                String[] lowHigh = component.split(":");
                if (lowHigh.length != 2) {
                    throwInvalidSyntaxException();
                }
                RangeIntervalType ri = Wcs20Factory.eINSTANCE.createRangeIntervalType();
                ri.setStartComponent(lowHigh[0]);
                ri.setEndComponent(lowHigh[1]);
                RangeItemType item = Wcs20Factory.eINSTANCE.createRangeItemType();
                item.setRangeInterval(ri);

                result.getRangeItems().add(item);
            } else {
                RangeItemType item = Wcs20Factory.eINSTANCE.createRangeItemType();
                item.setRangeComponent(component);

                result.getRangeItems().add(item);
            }
        }

        return result;
    }
View Full Code Here

        }
           
        // look for an interpolation extension
        final ExtensionItemType extensionItem=extensions.get("rangeSubset");
        assert extensionItem!=null; // should not happen
        final RangeSubsetType range = (RangeSubsetType) extensionItem.getObjectContent();
        for(RangeItemType rangeItem: range.getRangeItems()){
            // there you go the range item
           
            // single element
            final String rangeComponent=rangeItem.getRangeComponent();
           
View Full Code Here

                "&coverageId=theCoverage&rangesubset=band01,band03:band05,band10,band19:band21");
       
        Map<String, Object> extensions = getExtensionsMap(gc);
       
        assertEquals(1, extensions.size());
        RangeSubsetType rangeSubset = (RangeSubsetType) extensions.get(RangeSubset.NAMESPACE + ":RangeSubset");
       
        EList<RangeItemType> items = rangeSubset.getRangeItems();
        assertEquals(4, items.size());
        RangeItemType i1 = items.get(0);
        assertEquals("band01", i1.getRangeComponent());
        RangeItemType i2 = items.get(1);
        assertEquals("band03", i2.getRangeInterval().getStartComponent());
View Full Code Here

        assertEquals("rangeSubset", e.getLocator());
    }
   
    @Test
    public void testMixed() throws Exception {
        RangeSubsetType rs = (RangeSubsetType) parser.parse("band01,band03:band05,band10,band19:band21");
        EList<RangeItemType> items = rs.getRangeItems();
        assertEquals(4, items.size());
        RangeItemType i1 = items.get(0);
        assertEquals("band01", i1.getRangeComponent());
        RangeItemType i2 = items.get(1);
        assertEquals("band03", i2.getRangeInterval().getStartComponent());
View Full Code Here

TOP

Related Classes of net.opengis.wcs11.RangeSubsetType

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.