Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Literal


            String name = property.getPropertyName();
            refreshControls(null, name, null);
            feedback();
            return;
        } else if (expr instanceof Literal) {
            Literal literal = (Literal) expr;
            Double percent = literal.evaluate(null, Double.class);
            if (percent != null) {
                refreshControls(percent, null, null);
                feedback();
                return;
            }
View Full Code Here


  @SuppressWarnings("unchecked")
  private FeatureIterator<SimpleFeature> getAffectedFeatures(SimpleFeature feature) throws IOException {
    FilterFactory2 filterFactory = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
    String geomAttName = feature.getFeatureType().getGeometryDescriptor().getLocalName();
    PropertyName geomPropertyExpression = filterFactory.property(geomAttName);
    Literal literalGeomExpression = filterFactory.literal(feature.getDefaultGeometry());
    Touches filter = filterFactory.touches(geomPropertyExpression, literalGeomExpression);
   
    IProgressMonitor monitor =
      getContext().getActionBars().getStatusLineManager().getProgressMonitor();
    FeatureSource<SimpleFeatureType,SimpleFeature> resource =
View Full Code Here

     */
    void handleOpacity(Expression opacity) {
        if(opacity == null)
            return;
        if(opacity instanceof Literal) {
            Literal lo = (Literal) opacity;
            double value = ((Double) lo.evaluate(null, Double.class)).doubleValue();
            translucentSymbolizers = translucentSymbolizers || value != 1;
        } else {
            // we cannot know, so we assume some will be non opaque
            translucentSymbolizers = true;
        }
View Full Code Here

     */
    void handleColor(Expression color) {
        if(color == null)
            return;
        if(color instanceof Literal) {
            Literal lc = (Literal) color;
            String rgbColor = (String) lc.evaluate(null, String.class);
            colors.add(Color.decode(rgbColor));
        } else {
            unknownColors = true;
        }
    }
View Full Code Here

    {
        String geomAttName = source.getSchema().getGeometryDescriptor()
                .getLocalName();
        PropertyName geomPropertyName = _filterFactory.property(geomAttName);

        Literal geomExpression = _filterFactory.literal(_geom);
        org.opengis.filter.Filter filter = createGeomFilter(_filterFactory,
                geomPropertyName, geomExpression);
        return filter;
    }
View Full Code Here

        float[] dashArray = null;
        if (styleJson.has(JSON_STROKE_DASHSTYLE) && !STROKE_DASHSTYLE_SOLID.equals(styleJson.getString(JSON_STROKE_DASHSTYLE))) {
            Double width = 1.0;
            if (widthExpression instanceof Literal) {
                Literal expression = (Literal) widthExpression;
                width = ((Number) expression.getValue()).doubleValue();
            }
            String dashStyle = styleJson.getString(JSON_STROKE_DASHSTYLE);
            if (dashStyle.equalsIgnoreCase(STROKE_DASHSTYLE_DOT)) {
                dashArray = new float[]{defaultDashSpacing, (float) (doubleWidth * width)};
            } else if (dashStyle.equalsIgnoreCase(STROKE_DASHSTYLE_DASH)) {
View Full Code Here

                assertEquals(2, andFilter.getChildren().size());

                PropertyIsEqualTo filter = (PropertyIsEqualTo) andFilter.getChildren().get(0);
                PropertyName propertyName = (PropertyName) filter.getExpression1();
                assertEquals("_gx_style", propertyName.getPropertyName());
                Literal valueExpression = (Literal) filter.getExpression2();
                assertEquals("1", valueExpression.getValue());

                geomSelectFunction = andFilter.getChildren().get(1);
            }

            final List<Symbolizer> symbolizers = rule.symbolizers();
View Full Code Here

           
            Expression expr = (Expression) value[0].getValue();
            String wildCard = attrs.getValue( "wildCard" );
            String singleChar = attrs.getValue( "singleChar" );
            String escape = attrs.getValue( "escape" );
            Literal pattern = (Literal) value[1].getValue();
           
         
            return factory.like(expr, (String) pattern.getValue(), wildCard, singleChar, escape);
                        }
          catch( ClassCastException expressionRequired ){
            throw new SAXException("Illegal filter for "+element, expressionRequired );
      }
          catch (IllegalFilterException e) {
View Full Code Here

                   
          FilterFactory2 factory = FilterSchema.filterFactory( hints );
          try {
            Expression geometry1 =  (Expression) value[0].getValue();
            Expression geometry2 = (Expression) value[1].getValue();
            Literal literal = (Literal) value[2];
            double distance = ((Number)literal.getValue()).doubleValue();           
            return factory.beyond(geometry1, geometry2, distance, null)
          }
          catch( ClassCastException wrong){
            throw new SAXException( wrong );
          } catch (IllegalFilterException illegalFilterException) {
View Full Code Here

         
          FilterFactory2 factory = FilterSchema.filterFactory( hints );
          try {
              Expression geometry1 =  (Expression) value[0].getValue();
                    Expression geometry2 = (Expression) value[1].getValue();
                    Literal literal = (Literal) value[2];
                    double distance = ((Number)literal.getValue()).doubleValue();
                    return factory.dwithin(geometry1, geometry2, distance, null );
          }
          catch( ClassCastException wrong){
            throw new SAXException( wrong );
          } catch (IllegalFilterException illegalFilterException) {
View Full Code Here

TOP

Related Classes of org.opengis.filter.expression.Literal

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.