Package org.geotools.process.raster

Examples of org.geotools.process.raster.FilterFunction_svgColorMap


                if (functionParams.size() == 2) {

                    // Getting the second parameter representing the colorRamp
                    param = functionParams.get(1);
                    if (param instanceof FilterFunction_svgColorMap) {
                        FilterFunction_svgColorMap colorMap = (FilterFunction_svgColorMap) param;
                        List<Expression> colorMapParams = colorMap.getParameters();
                        if (colorMapParams != null && colorMapParams.size() == 3) {
                            return colorMapParams.get(0).toString();
                        }
                    }
                }
View Full Code Here


        try {

            ColorMap cmap = null;

            // Setting up filter functions
            FilterFunction_svgColorMap colorMapFilterFunction = new FilterFunction_svgColorMap();
            FilterFunction_gridCoverageStats statsFilterFunction = new FilterFunction_gridCoverageStats();

            // Only parsing the first layer.
            String layerID = "";
            int digits = DEFAULT_DIGITS;
            Set<String> params = map.keySet();
            for (String param: params) {
                if (param.equalsIgnoreCase("LAYER")) {
                    layerID = (String) map.get("LAYER");
                } else if (param.equalsIgnoreCase("DIGITS")) {
                    digits = Integer.parseInt((String) map.get("DIGITS"));
                }
            }

            final int indexOf = layerID.indexOf(":");
           
            final CoverageInfo coverageInfo = geoserverCatalog.getCoverageByName(new NameImpl(
                    layerID.substring(0, indexOf), layerID.substring(indexOf + 1)));
            List<CoverageDimensionInfo> dimensions = coverageInfo.getDimensions();
            String unit = "";
            if (dimensions != null && !dimensions.isEmpty()) {
                CoverageDimensionInfo dimensionInfo = dimensions.get(0);
                unit = dimensionInfo.getUnit();
            }

            // Getting coverage to parse statistics
            final CoverageStoreInfo storeInfo = coverageInfo.getStore();
            final GridCoverage2DReader reader = (GridCoverage2DReader) geoserverCatalog
                    .getResourcePool().getGridCoverageReader(storeInfo, null);

            GeneralParameterValue[] parameters = parseReadParameters(coverageInfo, map, reader);
            coverage = (GridCoverage2D) reader.read(parameters);

            final double min = (Double) statsFilterFunction.evaluate(coverage, "minimum");
            final double max = (Double) statsFilterFunction.evaluate(coverage, "maximum");

            // Getting a colorMap on top of that
            cmap = (ColorMap) colorMapFilterFunction.evaluate(colorMap, min, max);
            final Builder cmapLegendBuilder = new ColorMapLegendCreator.Builder();
            if (cmap != null && cmap.getColorMapEntries() != null
                    && cmap.getColorMapEntries().length > 0) {

                // setting type of colormap
View Full Code Here

TOP

Related Classes of org.geotools.process.raster.FilterFunction_svgColorMap

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.