Package net.opengis.wcs20

Examples of net.opengis.wcs20.TargetAxisSizeType


                .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

     * <!-- 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

       
        assertNull(scaling.getScaleAxesByFactor());
        assertNull(scaling.getScaleToSize());
        assertNull(scaling.getScaleToExtent());
       
        ScaleByFactorType scaleByFactor = scaling.getScaleByFactor();
        assertEquals(2.5, scaleByFactor.getScaleFactor(), 1e-9d);
    }
View Full Code Here

    private void parseScalingExtension(GetCoverageType gc, Map kvp) {
        boolean found = false;
        ScalingType scaling = WCS20_FACTORY.createScalingType();
        if (kvp.containsKey("scalefactor")) {
            found = true;
            ScaleByFactorType sf = WCS20_FACTORY.createScaleByFactorType();
            sf.setScaleFactor(((Double) kvp.get("scalefactor")));
            scaling.setScaleByFactor(sf);
        }
        if (kvp.containsKey("scaleaxes")) {
            found = true;
            scaling.setScaleAxesByFactor((ScaleAxisByFactorType) kvp.get("scaleaxes"));
View Full Code Here

TOP

Related Classes of net.opengis.wcs20.TargetAxisSizeType

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.