Package net.opengis.wcs20

Examples of net.opengis.wcs20.RangeSubsetType


        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

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setScaleAxesByFactor(ScaleAxisByFactorType newScaleAxesByFactor) {
        ScaleAxisByFactorType oldScaleAxesByFactor = scaleAxesByFactor;
        scaleAxesByFactor = newScaleAxesByFactor;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Wcs20Package.SCALING_TYPE__SCALE_AXES_BY_FACTOR, oldScaleAxesByFactor, scaleAxesByFactor));
    }
View Full Code Here

       
        assertNull(scaling.getScaleByFactor());
        assertNull(scaling.getScaleToSize());
        assertNull(scaling.getScaleToExtent());
       
        ScaleAxisByFactorType sa = scaling.getScaleAxesByFactor();
        assertEquals(3, sa.getScaleAxis().size());
        ScaleAxisType sa1 = sa.getScaleAxis().get(0);
        assertEquals("http://www.opengis.net/def/axis/OGC/1/i", sa1.getAxis());
        assertEquals(3.5, sa1.getScaleFactor(), 1e-9);
        ScaleAxisType sa2 = sa.getScaleAxis().get(1);
        assertEquals("http://www.opengis.net/def/axis/OGC/1/j", sa2.getAxis());
        assertEquals(3.5, sa2.getScaleFactor(), 1e-9);
        ScaleAxisType sa3 = sa.getScaleAxis().get(2);
        assertEquals("http://www.opengis.net/def/axis/OGC/1/k", sa3.getAxis());
        assertEquals(2.0, sa3.getScaleFactor(), 1e-9);
    }
View Full Code Here

        super("scaleaxes", ScaleAxisType.class);
    }

    @Override
    public Object parse(String value) throws Exception {
        ScaleAxisByFactorType sabf = Wcs20Factory.eINSTANCE.createScaleAxisByFactorType();
       
        List<ScaleAxisType> items = parseItem(value);
        sabf.getScaleAxis().addAll(items);
       
        return sabf;
    }
View Full Code Here

        assertNull(scaling.getScaleToSize());
        assertNull(scaling.getScaleToExtent());
       
        ScaleAxisByFactorType sa = scaling.getScaleAxesByFactor();
        assertEquals(3, sa.getScaleAxis().size());
        ScaleAxisType sa1 = sa.getScaleAxis().get(0);
        assertEquals("http://www.opengis.net/def/axis/OGC/1/i", sa1.getAxis());
        assertEquals(3.5, sa1.getScaleFactor(), 1e-9);
        ScaleAxisType sa2 = sa.getScaleAxis().get(1);
        assertEquals("http://www.opengis.net/def/axis/OGC/1/j", sa2.getAxis());
        assertEquals(3.5, sa2.getScaleFactor(), 1e-9);
        ScaleAxisType sa3 = sa.getScaleAxis().get(2);
        assertEquals("http://www.opengis.net/def/axis/OGC/1/k", sa3.getAxis());
        assertEquals(2.0, sa3.getScaleFactor(), 1e-9);
    }
View Full Code Here

        return sabf;
    }

    @Override
    protected ScaleAxisType buildItem(String axisName, String value) {
        ScaleAxisType sa = Wcs20Factory.eINSTANCE.createScaleAxisType();
        try {
            sa.setAxis(axisName.trim());
            sa.setScaleFactor(Double.valueOf(value));
        } catch(NumberFormatException e) {
            throwInvalidSyntaxException(null);
        }
       
        return sa;
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setScaleByFactor(ScaleByFactorType newScaleByFactor) {
        ScaleByFactorType oldScaleByFactor = scaleByFactor;
        scaleByFactor = newScaleByFactor;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Wcs20Package.SCALING_TYPE__SCALE_BY_FACTOR, oldScaleByFactor, scaleByFactor));
    }
View Full Code Here

TOP

Related Classes of net.opengis.wcs20.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.