Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Expression.evaluate()


                FEATURE_LABEL);
       
        if (labelExpression != null) {
            try {
                final Expression exp = ECQL.toExpression(labelExpression);
                final String featureLabel = (String) exp.evaluate(feature);
                if (featureLabel != null && featureLabel.trim().length() > 0) {
                    return featureLabel;   
                }
            } catch (CQLException e) {
                e.printStackTrace();
View Full Code Here


     * @return
     * @throws NumberFormatException
     */
    private static java.awt.Color getColor( ColorMapEntry entry ) throws NumberFormatException {
        final Expression color = entry.getColor();
        final String colorString = (String) color.evaluate(null, String.class);
        return java.awt.Color.decode(colorString);
    }

    /**
     * @param entry
View Full Code Here

    private static double getOpacity( ColorMapEntry entry ) throws IllegalArgumentException, MissingResourceException {

        Expression opacity = entry.getOpacity();
        Double opacityValue = null;
        if (opacity != null)
            opacityValue = (Double) opacity.evaluate(null, Double.class);
        else
            return 1.0;
        if ((opacityValue.doubleValue() - 1) > 0 || opacityValue.doubleValue() < 0) {
            throw new IllegalArgumentException(Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, Messages.CoverageStyleEditorPage_4, opacityValue));
        }
View Full Code Here

     * @param entry
     * @return
     */
    private static double getQuantity( ColorMapEntry entry ) {
        Expression quantity = entry.getQuantity();
        Double quantityString = (Double) quantity.evaluate(null, Double.class);
        double q = quantityString.doubleValue();
        return q;
    }

    public void gotFocus() {
View Full Code Here

                    FEATURE_LABEL);
           
            if (labelExpression != null) {
                try {
                    final Expression exp = ECQL.toExpression(labelExpression);
                    return (String) exp.evaluate(feature);
                } catch (CQLException e) {
                    e.printStackTrace();
                }   
            }
           
View Full Code Here

            Expression expression = definition.expression;

            // FIXME : sometimes expression returns null.  I think the real bug is with AttributeExpression
            Class<?> binding = definition.binding;
            if( binding == null ){
                Object value = expression.evaluate(sample);
                if( value == null){
                    ifexpression instanceof PropertyName){
                        String path = ((PropertyName)expression).getPropertyName();
                        AttributeType attributeType = sample.getFeatureType().getType(path);
                        if( attributeType == null ){
View Full Code Here

    private static float getOpacity( RasterSymbolizer sym ) {
        float alpha = 1.0f;
        Expression exp = sym.getOpacity();
        if (exp == null)
            return alpha;
        Object obj = exp.evaluate(null);
        if (obj == null)
            return alpha;
        Number num = null;
        if (obj instanceof Number)
            num = (Number) obj;
View Full Code Here

    private static float getOpacity( RasterSymbolizer sym ) {
        float alpha = 1.0f;
        Expression exp = sym.getOpacity();
        if (exp == null)
            return alpha;
        Object obj = exp.evaluate(null);
        if (obj == null)
            return alpha;
        Number num = null;
        if (obj instanceof Number)
            num = (Number) obj;
View Full Code Here

                for (Symbolizer sym : symbolizers) {
                    if (sym instanceof TextSymbolizer) {
                        Expression e = SLD.textLabel((TextSymbolizer) sym);
                        Object object = null;
                        if (e != null)
                            object = e.evaluate(feature);
                        String value = null;

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

                if(LOGGER.isLoggable(Level.SEVERE))
                    LOGGER.log(Level.SEVERE, "Could not parse cql expressions out of " + strLocation, e);
                location = ff.literal(strLocation);
            }

            return location.evaluate(feature).toString();
        }

        /**
         * Encodes a KML LabelStyle from a text style and symbolizer.
         */
 
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.