Examples of DimensionTrimType


Examples of net.opengis.wcs20.DimensionTrimType

        assertEquals(Section.COVERAGEDESCRIPTIONS, sections.get(0));
        assertEquals(Section.DATASETSERIESDESCRIPTIONS, sections.get(1));
       
        EList<DimensionTrimType> trims = dcs.getDimensionTrim();
        assertEquals(3, trims.size());
        DimensionTrimType lonTrim = trims.get(0);
        assertEquals("Long", lonTrim.getDimension());
        assertEquals("16", lonTrim.getTrimLow());
        assertEquals("18", lonTrim.getTrimHigh());
        DimensionTrimType latTrim = trims.get(1);
        assertEquals("Lat", latTrim.getDimension());
        assertEquals("46", latTrim.getTrimLow());
        assertEquals("48", latTrim.getTrimHigh());
        DimensionTrimType timeTrim = trims.get(2);
        assertEquals("phenomenonTime", timeTrim.getDimension());
        assertEquals("2011-01-18T22:21:52Z", timeTrim.getTrimLow());
        assertEquals("2011-01-18T22:22:52Z", timeTrim.getTrimHigh());

    }
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

        assertEquals("C0001", gc.getCoverageId());
       
        // trimming
        EList<DimensionSubsetType> dss = gc.getDimensionSubset();
        assertEquals(2, dss.size());
        DimensionTrimType dt1 = (DimensionTrimType) dss.get(0);
        assertEquals("Long", dt1.getDimension());
        assertEquals("1", dt1.getTrimLow());
        assertEquals("2", dt1.getTrimHigh());
        DimensionTrimType dt2 = (DimensionTrimType) dss.get(1);
        assertEquals("Lat", dt2.getDimension());
        assertEquals("1", dt2.getTrimLow());
        assertEquals("2", dt2.getTrimHigh());

        // format
        assertEquals("application/gml+xml", gc.getFormat());
        assertEquals("multipart/related", gc.getMediaType());
    }
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

        assertEquals("C0001", gc.getCoverageId());
       
        // trimming
        EList<DimensionSubsetType> dss = gc.getDimensionSubset();
        assertEquals(2, dss.size());
        DimensionTrimType dt = (DimensionTrimType) dss.get(0);
        assertEquals("Long", dt.getDimension());
        assertEquals("20", dt.getTrimLow());
        assertEquals("29", dt.getTrimHigh());
        DimensionSliceType ds = (DimensionSliceType) dss.get(1);
        assertEquals("Lat", ds.getDimension());
        assertEquals("1", ds.getSlicePoint());

        // format
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

            return slice;
        } else if (vpElements.length == 2) {
            String low = parsePoint(vpElements[0], true);
            String high = parsePoint(vpElements[1], true);

            DimensionTrimType trim = Wcs20Factory.eINSTANCE.createDimensionTrimType();
            trim.setDimension(dimension);
            trim.setCRS(crs);
            trim.setTrimLow(low);
            trim.setTrimHigh(high);
            return trim;
        } else {
            throw new OWS20Exception("Invalid syntax, dimension [ , crs ] ( intervalOrPoint ) "
                    + "where interval or point has either 1 or two elements",
                    WCS20ExceptionCode.InvalidEncodingSyntax, "subset");
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

            // now decide what to do
//            final String CRS= dim.getCRS();// TODO HOW DO WE USE THIS???
            if(dim instanceof DimensionTrimType){

                // TRIMMING
                final DimensionTrimType trim = (DimensionTrimType) dim;
                final double low = Double.parseDouble(trim.getTrimLow());
                final double high = Double.parseDouble(trim.getTrimHigh());

                final int axisIndex = envelopeDimensionsMapper.getAxisIndex(sourceEnvelopeInSubsettingCRS, dimension);
                if (axisIndex < 0) {
                    throw new WCS20Exception("Invalid axis provided",WCS20Exception.WCS20ExceptionCode.InvalidAxisLabel,dimension);
                }
               
                // low > high && not dateline wrapping?
                if (low > high && !subsettingEnvelope.isLongitude(axisIndex)) {
                    throw new WCS20Exception("Low greater than High",
                            WCS20Exception.WCS20ExceptionCode.InvalidSubsetting, trim.getTrimLow());
                }

                // notice how we choose the order of the axes
                subsettingEnvelope.setRange(axisIndex, low, high);
            } else if (dim instanceof DimensionSliceType) {
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

                // now decide what to do
                if (dim instanceof DimensionTrimType) {

                    // TRIMMING
                    final DimensionTrimType trim = (DimensionTrimType) dim;
                    final Date low = PARSER.parseDateTime(trim.getTrimLow());
                    final Date high = PARSER.parseDateTime(trim.getTrimHigh());

                    // low > high???
                    if (low.compareTo(high) > 0) {
                        throw new WCS20Exception("Low greater than High: " + trim.getTrimLow()
                                + ", " + trim.getTrimHigh(),
                                WCS20Exception.WCS20ExceptionCode.InvalidSubsetting, "subset");
                    }

                    timeSubset = new DateRange(low, high);
                } else if (dim instanceof DimensionSliceType) {
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

                // now decide what to do
                if (dim instanceof DimensionTrimType) {

                    // TRIMMING
                    final DimensionTrimType trim = (DimensionTrimType) dim;
                    final Double low = PARSER.parseDouble(trim.getTrimLow());
                    final Double high = PARSER.parseDouble(trim.getTrimHigh());

                    // low > high???
                    if (low > high) {
                        throw new WCS20Exception("Low greater than High: " + trim.getTrimLow()
                                + ", " + trim.getTrimHigh(),
                                WCS20Exception.WCS20ExceptionCode.InvalidSubsetting, "subset");
                    }

                    elevationSubset = new NumberRange<Double>(Double.class, low, high);
                } else if (dim instanceof DimensionSliceType) {
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

                   
                     // now decide what to do
                     if (dim instanceof DimensionTrimType) {
                   
                     // TRIMMING
                         final DimensionTrimType trim = (DimensionTrimType) dim;
                         setSubsetRangeValue(dimension, trim.getTrimLow(), trim.getTrimHigh(), selectedValues);

                     } else
                    if (dim instanceof DimensionSliceType) {

                        // SLICING
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

   
    @Test
    public void testTrimOpen() throws Exception {
        // not sure if this makes any sense, but the sytax allows it, and it's like not
        // specifying anything
        DimensionTrimType result = (DimensionTrimType) parser.parse("lon,EPSG:4326(*,*)");
        assertEquals("lon", result.getDimension());
        assertEquals("EPSG:4326", result.getCRS());
        assertNull(result.getTrimLow());
        assertNull(result.getTrimHigh());
    }
View Full Code Here

Examples of net.opengis.wcs20.DimensionTrimType

   
    @Test
    public void testTrimNumbers() throws Exception {
        // not sure if this makes any sense, but the sytax allows it, and it's like not
        // specifying anything
        DimensionTrimType result = (DimensionTrimType) parser.parse("lon,EPSG:4326(10,20)");
        assertEquals("lon", result.getDimension());
        assertEquals("EPSG:4326", result.getCRS());
        assertEquals("10", result.getTrimLow());
        assertEquals("20", result.getTrimHigh());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.