Package net.opengis.wcs20

Examples of net.opengis.wcs20.TargetAxisExtentType


        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

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setScaleToExtent(ScaleToExtentType newScaleToExtent) {
        ScaleToExtentType oldScaleToExtent = scaleToExtent;
        scaleToExtent = newScaleToExtent;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Wcs20Package.SCALING_TYPE__SCALE_TO_EXTENT, oldScaleToExtent, scaleToExtent));
    }
View Full Code Here

       
        assertNull(scaling.getScaleByFactor());
        assertNull(scaling.getScaleAxesByFactor());
        assertNull(scaling.getScaleToSize());
       
        ScaleToExtentType se = scaling.getScaleToExtent();
        assertEquals(2, se.getTargetAxisExtent().size());
        TargetAxisExtentType sa1 = se.getTargetAxisExtent().get(0);
        assertEquals("http://www.opengis.net/def/axis/OGC/1/i", sa1.getAxis());
        assertEquals(10.0, sa1.getLow(), 1e-9);
        assertEquals(20.0, sa1.getHigh(), 1e-9);
        TargetAxisExtentType sa2 = se.getTargetAxisExtent().get(1);
        assertEquals("http://www.opengis.net/def/axis/OGC/1/j", sa2.getAxis());
        assertEquals(20.0, sa2.getLow(), 1e-9);
        assertEquals(30.0, sa2.getHigh(), 1e-9);
    }
View Full Code Here

    @Override
    public Object parse(String value) throws Exception {
        // clean up extra space
        value = value.trim();
       
        ScaleToExtentType se = Wcs20Factory.eINSTANCE.createScaleToExtentType();

        int base = 0;
        for (;;) {
            // search the open parenthesis
            int idxOpen = value.indexOf("(", base);
            if (idxOpen == -1) {
                throw new WCS20Exception(
                        "Invalid ScaleExtent syntax, expecting a comma separate list of axisName(min,max)*",
                        WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "scaleExtent");
            }
            int idxNextOpen = value.indexOf("(", idxOpen + 1);

            // search the closed parens
            int idxClosed = value.indexOf(")", idxOpen);
            if (idxClosed == -1 || (idxNextOpen > 0 && idxClosed > idxNextOpen)) {
                throw new WCS20Exception(
                        "Invalid ScaleExtent syntax, expecting a comma separate list of axisName(min,max)*",
                        WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "scaleExtent");
            }
            int idxNextClosed = value.indexOf(")", idxClosed + 1);

            // the comma between the parens (we start from base to make sure it's actually between the parens)
            int idxMid = value.indexOf(",", base);
            if (idxMid == -1 || idxMid >= idxClosed - 1 || idxMid <= idxOpen + 1) {
                throw new WCS20Exception(
                        "Invalid ScaleExtent syntax, expecting a comma separate list of axisName(min,max)*",
                        WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "scaleExtent");

            }
            int idxNextMid = value.indexOf(",", idxMid + 1);
            if(idxNextMid != -1 && idxNextMid < idxClosed) {
                throw new WCS20Exception(
                        "Invalid ScaleExtent syntax, expecting a comma separate list of axisName(min,max)*",
                        WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "scaleExtent");
            }

            // extract the three components
            String axisName = value.substring(base, idxOpen);
            String low = value.substring(idxOpen + 1, idxMid);
            String high = value.substring(idxMid + 1, idxClosed);

            try {
                TargetAxisExtentType te = Wcs20Factory.eINSTANCE.createTargetAxisExtentType();
                te.setAxis(axisName.trim());
                te.setLow(Double.valueOf(low));
                te.setHigh(Double.valueOf(high));
   
                se.getTargetAxisExtent().add(te);
            } catch(NumberFormatException e) {
                WCS20Exception ex = new WCS20Exception(
                        "Invalid ScaleExtent syntax, expecting a comma separate list of axisName(min,max)*",
                        WCS20Exception.WCS20ExceptionCode.InvalidEncodingSyntax, "scaleExtent");
                ex.initCause(e);
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setScaleToSize(ScaleToSizeType newScaleToSize) {
        ScaleToSizeType oldScaleToSize = scaleToSize;
        scaleToSize = newScaleToSize;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Wcs20Package.SCALING_TYPE__SCALE_TO_SIZE, oldScaleToSize, scaleToSize));
    }
View Full Code Here

TOP

Related Classes of net.opengis.wcs20.TargetAxisExtentType

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.