Package org.opengis.filter.expression

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


                geom = (Geometry) ((Feature) drawMe).getDefaultGeometryProperty().getValue();
            } else {
                geom = defaultGeometryPropertyName.evaluate(drawMe, Geometry.class);
            }
        } else {
            geom = geomExpr.evaluate(drawMe, Geometry.class);
        }

        return geom;   
    }
View Full Code Here


  private static Color getColor(ColorMapEntry entry)
      throws NumberFormatException {
    ColorMapUtilities.ensureNonNull("ColorMapEntry",entry);
    final Expression color = entry.getColor();
    ColorMapUtilities.ensureNonNull("color",color);
    final String  colorString= (String) color.evaluate(null, String.class);
    ColorMapUtilities.ensureNonNull("colorString",colorString);
    return Color.decode(colorString);
  }

  /**
 
View Full Code Here

     //
     //
     /////////////////////////////////////////////////////////////////////
     final Expression op = rs.getOpacity();
     if (op != null) {
             final Number number = (Number) op.evaluate(null, Float.class);
             if (number != null) {
                 opacity = number.floatValue();
             }
     }
  }
View Full Code Here

        return fallback;
    }
    // helper methods
    <T> T eval( Object feature, int index, Class<T> type ){
        Expression expr = params.get(index);
        Object value = expr.evaluate( feature, type );       
        return type.cast(value);
    }
}
View Full Code Here

        return evaluate(object, Point.class);
    }
   
    public <T> T evaluate(Object object, Class<T> context) {
        Expression pointExpression = parameters.get(0);
        Point point = pointExpression.evaluate(object, Point.class);
   
        Expression lineExpression = parameters.get(1);
        Geometry line = lineExpression.evaluate(object, Geometry.class);
   
        LocationIndexedLine index = new LocationIndexedLine(line);
View Full Code Here

    public <T> T evaluate(Object object, Class<T> context) {
        Expression pointExpression = parameters.get(0);
        Point point = pointExpression.evaluate(object, Point.class);
   
        Expression lineExpression = parameters.get(1);
        Geometry line = lineExpression.evaluate(object, Geometry.class);
   
        LocationIndexedLine index = new LocationIndexedLine(line);
   
        LinearLocation location = index.project(point.getCoordinate());
   
View Full Code Here

        GraphicsAwareDpiRescaleStyleVisitor visitor = new GraphicsAwareDpiRescaleStyleVisitor(2);
        ps.accept(visitor);
        PointSymbolizer resized = (PointSymbolizer) visitor.getCopy();
        Expression size = resized.getGraphic().getSize();
        assertTrue(size instanceof Literal);
        assertEquals(32, size.evaluate(null, Integer.class), 0d);
    }
   
    @Test
    public void testResizeExternalGraphic() throws IOException {
        StyleBuilder sb = new StyleBuilder();
View Full Code Here

        ps.accept(visitor);
        PointSymbolizer resized = (PointSymbolizer) visitor.getCopy();
        Expression size = resized.getGraphic().getSize();
        assertTrue(size instanceof Literal);
        // original image height was 22
        assertEquals(44, size.evaluate(null, Integer.class), 0d);
    }
}
View Full Code Here

            boolean isSizeConstant = false;

            if(!isSizeNull) {
                isSizeConstant = isConstant(grSize);
                if (isSizeConstant) {
                    imageSize = (int) Math.ceil(grSize.evaluate(null, Double.class));
                } else {
                    estimateAccurate = false;
                    return;
                }   
            }
View Full Code Here

        ExternalGraphicFactory egf = it.next();
      try {
          String format = null;
          if(eg.getFormat() != null) {
              Expression formatExpression = ExpressionExtractor.extractCqlExpressions(eg.getFormat());
              format = formatExpression.evaluate(feature, String.class);
          }
                Icon icon = egf.getIcon((Feature) feature, location, format, toImageSize(size));
        if (icon != null) {
          return icon;
        }
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.