Package org.opengis.filter.expression

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


                    symbolizers[m]).toString());

            if (symbolizers[m] instanceof TextSymbolizer) {
                TextSymbolizer ts = (TextSymbolizer) symbolizers[m];
                Expression ex = ts.getLabel();
                featureLabel.append((String) ex.evaluate(feature, String.class)); // attach
                // the lable title

                Style2D style = styleFactory.createStyle(feature,
                        symbolizers[m], scaleRange);
                writeStyle(style, feature.getID(), symbolizers[m]);
View Full Code Here


                // CoordinateReferenceSystem crs = findGeometryCS(feature,
                // symbolizers[m]);
                if (symbolizers[m] instanceof TextSymbolizer) {
                    TextSymbolizer ts = (TextSymbolizer) symbolizers[m];
                    Expression ex = ts.getLabel();
                    String value = (String) ex.evaluate(feature, String.class);
                    title.append(value);

                    Style2D style = styleFactory.createStyle(feature,
                            symbolizers[m], scaleRange);
                    writeStyle(style, feature.getID(), symbolizers[m]);
View Full Code Here

            LOGGER.info("Could not determine proper symbolizer opacity.");

            return alpha;
        }

        Float number = (Float) exp.evaluate(null, Float.class);

        if (number == null) {
            return alpha;
        }
View Full Code Here

        protected void processSymbolizer(SimpleFeature ft,Rule rule,Symbolizer symbolizer) throws IOException{
          if(symbolizer instanceof TextSymbolizer) {
            // TODO: any check for label definition needed here?
          Expression e = SLD.textLabel((TextSymbolizer) symbolizer);
          // eval label actual value
                Object object = e.evaluate(ft);
                String value = null;

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

                super.encodePlacemarkDescription(feature, styles);
                return;
            }
           
            start("description");
            cdata(description.evaluate(feature, String.class));
            end("description");
        }
       
        @Override
        protected void encodePlacemarkSnippet(SimpleFeature feature, FeatureTypeStyle[] styles) {
View Full Code Here

            if(abxtract == null) {
                // no snippet then...
                return;
            }
            start("Snippet");
            cdata(abxtract.evaluate(feature, String.class));
            end("Snippet");
        }
       
        @Override
        protected void encodePlacemarkTime(SimpleFeature feature, FeatureTypeStyle[] styles)
View Full Code Here

        sb.set("NAME", "Pluto");
        SimpleFeature f = sb.buildFeature("fidxxx");

        String template = "Hello this is ${FID.value} my name is ${NAME.value}";
        Expression freemarker = CQL.toExpression("freemarker('" + template + "')");
        String result = freemarker.evaluate(f, String.class);
        String expected = "Hello this is " + f.getAttribute("FID") + " my name is "
                + f.getAttribute("NAME");
        assertEquals(expected, result);
    }
}
View Full Code Here

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

   */
  public static Color color(final ColorMapEntry entry){
    ensureNotNull(entry, "entry");
    final Expression color = entry.getColor();
    ensureNotNull(color, "color");
    final String  colorString= color.evaluate(null, String.class);
    ensureNotNull(colorString, "colorString");
    return color(colorString);
  }
 
  /**
 
View Full Code Here

   */
  public static double getQuantity(final ColorMapEntry entry) {
    ensureNotNull(entry, "entry");
    Expression quantity = entry.getQuantity();
    ensureNotNull(quantity, "quantity");
    Double quantityString = quantity.evaluate(null, Double.class);
    ensureNotNull(quantityString, "quantityString");
    return quantityString.doubleValue();
  }
 
  /**
 
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.