Package org.opengis.parameter

Examples of org.opengis.parameter.ParameterValue


                        + (oldEnvelope.getSpan(1) / cropFactor) },
                new double[] { oldEnvelope.getUpperCorner().getOrdinate(0),
                        oldEnvelope.getUpperCorner().getOrdinate(1) });
        cropEnvelope.setCoordinateReferenceSystem(reader.getCrs());

        final ParameterValue gg = (ParameterValue) ((AbstractGridFormat) reader
                .getFormat()).READ_GRIDGEOMETRY2D.createValue();
        gg.setValue(new GridGeometry2D(new GridEnvelope2D(new Rectangle(0, 0,
                (int) (range.width / 4.0 / cropFactor),
                (int) (range.height / 4.0 / cropFactor))), cropEnvelope));
        gc = (GridCoverage2D) reader.read(new GeneralParameterValue[] { gg });
        Assert.assertNotNull(gc);
        // NOTE: in some cases might be too restrictive
View Full Code Here


                                    readParameters = (readParameters != null ? readParameters : new GeneralParameterValue[0]);
           
            //
            // Setting coverage reading params.
            //
            final ParameterValue requestedGridGeometryParam = new DefaultParameterDescriptor(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString(), GeneralGridGeometry.class, null, requestedGridGeometry).createValue();

            /*
             * Test if the parameter "TIME" is present in the WMS
             * request, and by the way in the reading parameters. If
             * it is the case, one can adds it to the request. If an
             * exception is thrown, we have nothing to do.
             */
            final List<GeneralParameterDescriptor> parameterDescriptors = readParametersDescriptor.getDescriptor().descriptors();
            ParameterValue time=null;
            boolean hasTime=timeValues.size()>0;
            ParameterValue elevation=null;
            boolean hasElevation=elevations != null && !Double.isNaN(elevations[0]);
           
            if(hasElevation||hasTime){
                for(GeneralParameterDescriptor pd:parameterDescriptors){

                        final String code=pd.getName().getCode();
                       
                        //
                        // TIME
                        //
                        if(code.equalsIgnoreCase("TIME")){
                            time=(ParameterValue) pd.createValue();
                            time.setValue(timeValues);                }
                       
                        //
                        // ELEVATION
                        //
                        if(code.equalsIgnoreCase("ELEVATION")){
                            elevation=(ParameterValue) pd.createValue();
                            elevation.setValue(elevations[0]);
                        }
                       
                       
                        // leave?
                        if((hasElevation&&elevation!=null&&hasTime&&time!=null)||
View Full Code Here

        if ((params != null) && (params.values().size() > 0)) {
            List list = params.values();
            final Iterator it = list.iterator();
            while (it.hasNext()) {
                final ParameterValue val = (ParameterValue) it.next();

                if (val != null) {
                    final ParameterDescriptor descr = (ParameterDescriptor) val.getDescriptor();
                    final String _key = descr.getName().toString();

                    if ("namespace".equals(_key)) {
                        // skip namespace as it is *magic* and
                        // appears to be an entry used in all dataformats?
                        //
                        continue;
                    }


                    // IGNORING READ_GRIDGEOMETRY2D param
                    if (_key.equalsIgnoreCase(readGeometryKey)) {
                        continue;
                    }
                    final Object value = val.getValue();

                    parameters.add(new DefaultParameterDescriptor(_key, value.getClass(), null,value).createValue());
                }
            }

View Full Code Here

        if ((params != null) && (params.values().size() > 0)) {
            final List list = params.values();
            final Iterator it = list.iterator();
            while (it.hasNext()) {
                final ParameterValue val = (ParameterValue) it.next();

                if (val != null) {
                    final ParameterDescriptor descr = (ParameterDescriptor) val.getDescriptor();

                    final String _key = descr.getName().toString();

                    if ("namespace".equals(_key)) {
                        // skip namespace as it is *magic* and
                        // appears to be an entry used in all dataformats?
                        //
                        continue;
                    }

                    // /////////////////////////////////////////////////////////
                    //
                    // request param for better management of coverage
                    //
                    // /////////////////////////////////////////////////////////
                    if (_key.equalsIgnoreCase(readGeometryKey)) {
                        // IGNORING READ_GRIDGEOMETRY2D param
                        continue;
                    }

                    Object value = val.getValue();
                    String text = "";

                    if (value == null) {
                        text = null;
                    } else if (value instanceof String) {
View Full Code Here

       
        // scan all the params looking for the one we want to add
        for (GeneralParameterDescriptor pd : parameterDescriptors) {
            // in case of match of any alias add a param value to the lot
            if (aliases.contains(pd.getName().getCode())) {
                final ParameterValue pv = (ParameterValue) pd.createValue();
                pv.setValue(value);

                // add to the list
                GeneralParameterValue[] readParametersClone = new GeneralParameterValue[readParameters.length + 1];
                System.arraycopy(readParameters, 0, readParametersClone, 0,
                        readParameters.length);
View Full Code Here

     */
    public static ParameterValue find(ParameterValueGroup params, String key) {
        List list = params.values();
        Iterator it = list.iterator();
        ParameterDescriptor descr;
        ParameterValue val;

        while (it.hasNext()) {
            val = (ParameterValue) it.next();
            descr = (ParameterDescriptor) val.getDescriptor();

            if (key.equalsIgnoreCase(descr.getName().toString())) {
                return val;
            }
        }
View Full Code Here

        if (params != null) {
            List list = params.values();
            Iterator it = list.iterator();
            ParameterDescriptor descr = null;
            ParameterValue val = null;
            String key;
            Object value;

            while (it.hasNext()) {
                val = (ParameterValue) it.next();
                descr = (ParameterDescriptor) val.getDescriptor();

                key = descr.getName().toString();
                value = null;

                if (val.getValue() != null) {
                    // Required params may have nice sample values
                    //
                    if ("values_palette".equalsIgnoreCase(key)) {
                        value = val.getValue();
                    } else {
                        value = val.getValue().toString();
                    }
                }

                if (value == null) {
                    // or not
View Full Code Here

        if (params != null) {
            List list = params.values();
            Iterator it = list.iterator();
            ParameterDescriptor descr = null;
            ParameterValue val = null;
            String key;
            Object value;

            while (it.hasNext()) {
                val = (ParameterValue) it.next();
                descr = (ParameterDescriptor) val.getDescriptor();

                key = descr.getName().toString();
                value = null;

                if (val.getValue() != null) {
                    // Required params may have nice sample values
                    //
                    if ("values_palette".equalsIgnoreCase(key)) {
                        value = val.getValue();
                    } else {
                        value = val.getValue().toString();
                    }
                }

                if (value == null) {
                    // or not
View Full Code Here

        if ((params != null) && (params.values().size() > 0)) {
            List list = params.values();
            final Iterator it = list.iterator();
            while (it.hasNext()) {
                final ParameterValue val = (ParameterValue) it.next();

                if (val != null) {
                    final ParameterDescriptor descr = (ParameterDescriptor) val.getDescriptor();
                    final String _key = descr.getName().toString();

                    if ("namespace".equals(_key)) {
                        // skip namespace as it is *magic* and
                        // appears to be an entry used in all dataformats?
                        //
                        continue;
                    }


                    // IGNORING READ_GRIDGEOMETRY2D param
                    if (_key.equalsIgnoreCase(readGeometryKey)) {
                        continue;
                    }
                    final Object value = val.getValue();

                    parameters.add(new DefaultParameterDescriptor(_key, value.getClass(), null,value).createValue());
                }
            }

View Full Code Here

        if ((params != null) && (params.values().size() > 0)) {
            final List list = params.values();
            final Iterator it = list.iterator();
            while (it.hasNext()) {
                final ParameterValue val = (ParameterValue) it.next();

                if (val != null) {
                    final ParameterDescriptor descr = (ParameterDescriptor) val.getDescriptor();

                    final String _key = descr.getName().toString();

                    if ("namespace".equals(_key)) {
                        // skip namespace as it is *magic* and
                        // appears to be an entry used in all dataformats?
                        //
                        continue;
                    }

                    // /////////////////////////////////////////////////////////
                    //
                    // request param for better management of coverage
                    //
                    // /////////////////////////////////////////////////////////
                    if (_key.equalsIgnoreCase(readGeometryKey)) {
                        // IGNORING READ_GRIDGEOMETRY2D param
                        continue;
                    }

                    Object value = val.getValue();
                    String text = "";

                    if (value == null) {
                        text = null;
                    } else if (value instanceof String) {
View Full Code Here

TOP

Related Classes of org.opengis.parameter.ParameterValue

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.