Package org.opengis.parameter

Examples of org.opengis.parameter.ParameterValue


       
        // 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

            // -1- control band stacking
            // -2- check that a valid number of bands has been called
            boolean foundMergeBehavior=false;
            int foundCustomDimensions=0;
            for(int i=0;i<params.length;i++){
                final ParameterValue param = (ParameterValue) params[i];
                final ParameterDescriptor descriptor = param.getDescriptor();
                final ReferenceIdentifier name = descriptor.getName();
               
                // MERGE_BEHAVIOR
                if (name.equals(ImageMosaicFormat.MERGE_BEHAVIOR.getName())) {
                    foundMergeBehavior=true;
                    param.setValue(MergeBehavior.STACK.toString());
                } else {
                    //Dynamic Parameters checks
                    // -1- only one can have multiple values with cardinality 3
                    if(dynamicParametersNames.contains(name)){
                        final List paramValues=(List) param.getValue();
                        final int size = paramValues.size();
                        if(size!=1&&size!=3){
                            throw new ServiceException(
                                    "Wrong number of values provided to this GetMap for EO BANDS layer. Paremeter:"+name.getCode()+" #:"+size,
                                    "InvalidDimensionValue");
View Full Code Here

                    : 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)
                            || !hasElevation && hasTime && time != null || hasElevation
View Full Code Here

                GeneralParameterValue param = readParameters[i];
                GeneralParameterDescriptor pd = param.getDescriptor();

                if (pd.getName().getCode().equalsIgnoreCase("FILTER")) {
                    final ParameterValue pv = (ParameterValue) pd.createValue();
                    // if something different from the default INCLUDE filter is specified
                    if (layerFilter != Filter.INCLUDE) {
                        // override the default filter
                        pv.setValue(layerFilter);
                        readParameters[i] = pv;
                    }
                    break;
                }
            }
View Full Code Here

        if (hasTime)
            for (GeneralParameterDescriptor pd : parameterDescriptors) {

                // TIME
                if (pd.getName().getCode().equalsIgnoreCase("TIME")) {
                    final ParameterValue time = (ParameterValue) pd.createValue();
                    if (time != null) {
                        time.setValue(getMapReq.getTime());
                    }

                    // add to the list
                    GeneralParameterValue[] readParametersClone = new GeneralParameterValue[parameters.length + 1];
                    System.arraycopy(parameters, 0, readParametersClone, 0, parameters.length);
                    readParametersClone[parameters.length] = time;
                    parameters = readParametersClone;

                    // leave
                    break;
                }
            }

        // uncomment when the DIM_RANGE vendor parameter will be
        // enabled
        // try {
        // ParameterValue dimRange =
        // reader.getFormat().getReadParameters()
        // .parameter("DIM_RANGE");
        // if (dimRange != null && request.getDimRange() !=
        // null) {
        // dimRange.setValue(request.getDimRange());
        // }
        // } catch (ParameterNotFoundException p) {
        // }

        /*
         * 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 double elevationValue = getMapReq.getElevation();
        final boolean hasElevation = !Double.isNaN(elevationValue);
        if (hasElevation)
            for (GeneralParameterDescriptor pd : parameterDescriptors) {

                // ELEVATION
                if (pd.getName().getCode().equalsIgnoreCase("ELEVATION")) {
                    final ParameterValue elevation = (ParameterValue) pd.createValue();
                    if (elevation != null) {
                        elevation.setValue(getMapReq.getElevation());
                    }

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

             * 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(WCSUtils.ELEVATION)) {
                        elevation = (ParameterValue) pd.createValue();
                        elevation.setValue(elevations[0]);
                    }

                    // leave?
                    if ((hasElevation && elevation != null && hasTime && time != null)
                            || !hasElevation && hasTime && time != null || hasElevation
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.