Package org.geotools.data

Examples of org.geotools.data.Parameter


        Map<String, Parameter<?>> gtParams = new HashMap<String, Parameter<?>>();
        for (Map.Entry<String,Object> entry : jsParams.entrySet()) {
            gtParams.put(
                entry.getKey(),
                new Parameter(
                    entry.getKey(),
                    (Class)entry.getValue(),
                    Text.text(entry.getKey()),
                    Text.text(entry.getKey())
                )
View Full Code Here


            } catch(NullParameterAdditionalInfoException e) {
              // fine
            }
           
            hasRasterInput = hasRasterInput || IRasterLayer.class.isAssignableFrom(param.getParameterClass());
            paramInfo.put(param.getParameterName(), new Parameter(param.getParameterName(),
                    mapToGeoTools(param.getParameterClass()), Text.text(title),
                    Text.text(description), getAdditionalInfoMap(param)));
        }
       
        // check if there is any raster output
        boolean hasRasterOutput = false;
        OutputObjectsSet ooset = algorithm.getOutputObjects();
        for (int i = 0; i < ooset.getOutputObjectsCount(); i++) {
            Output output = ooset.getOutput(i);
            if (output instanceof OutputRasterLayer) {
                hasRasterOutput = true;
                break;
            }
        }

        // if there is any input or output raster we also need the user to specify
        // the grid structure, though we can get it from the first raster if there
        // are raster inputs, meaning in that case we'll grab it from
        if(hasRasterInput || hasRasterOutput) {
            // create a grid envelope, required only if there is no raster input we can
            // get the same info from
            if(hasRasterInput) {
                paramInfo.put(SEXTANTE_GRID_ENVELOPE, new Parameter(SEXTANTE_GRID_ENVELOPE,
                        Envelope.class, Text.text("Grid bounds (defaults to the bounds of the inputs)"),
                        Text.text("The real world coordinates bounding the grid"),
                        false, 0, 1, null, null));
                paramInfo.put(SEXTANTE_GRID_CELL_SIZE, new Parameter(SEXTANTE_GRID_CELL_SIZE,
                        Double.class, Text.text("Cell size (defaults to the size of the first input)"),
                        Text.text("The cell size in real world units"),
                        false, 0, 1, null, null));
            } else {
                paramInfo.put(SEXTANTE_GRID_ENVELOPE, new Parameter(SEXTANTE_GRID_ENVELOPE,
                        Envelope.class, Text.text("Grid bounds"),
                        Text.text("The real world coordinates bounding the grid"),
                        true, 1, 1, null, null));
                paramInfo.put(SEXTANTE_GRID_CELL_SIZE, new Parameter(SEXTANTE_GRID_CELL_SIZE,
                        Double.class, Text.text("Cell size"),
                        Text.text("The cell size in real world units"),
                        true, 1, 1, null, null));
            }
           
View Full Code Here

                outputClass = String.class;
            } else {
                throw new IllegalArgumentException("Don't know how to handle output of type" + output.getClass());
            }

            outputInfo.put(output.getName(), new Parameter(output.getName(), outputClass, Text
                    .text(output.getDescription()), Text.text(output.getDescription())));
        }

        return outputInfo;
View Full Code Here

TOP

Related Classes of org.geotools.data.Parameter

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.