Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.PropertyName


   * @param upper
   *            A literal. A string that can be converted to a double.
   * @return filter
   */
  public Filter createBetweenFilter(String name, String lower, String upper) {
    PropertyName attrib = FF.property(name);
    Expression d1 = FF.literal(lower);
    Expression d2 = FF.literal(upper);
    return FF.between(attrib, d1, d2);
  }
View Full Code Here


   *            Expression to compare with.
   * @return filter
   */
  public Filter createLikeFilter(String name, String pattern) {

    PropertyName attrib = FF.property(name);
    return FF.like(attrib, pattern, "*", "?", "\\");
  }
View Full Code Here

   * @param value
   *            A literal. The actual value (as string).
   * @return filter
   */
  public Filter createCompareFilter(String name, String comparator, String value) {
    PropertyName attrib = FF.property(name);
    Expression val = FF.literal(value);
    if ("<".equals(comparator)) {
      return FF.less(attrib, val);
    } else if (">".equals(comparator)) {
      return FF.greater(attrib, val);
View Full Code Here

   * @param value
   *            A literal. A string that can be converted to a double.
   * @return filter
   */
  public Filter createCompareFilter(String name, String comparator, Date value) {
    PropertyName attrib = FF.property(name);
    Expression val = FF.literal(value);
    if ("<".equals(comparator)) {
      return FF.less(attrib, val);
    } else if (">".equals(comparator)) {
      return FF.greater(attrib, val);
View Full Code Here

        extGraphic.setFormat(format);
    }

    protected String expressionToString( Expression expression ) {
        if (expression instanceof PropertyName) {
            PropertyName pName = (PropertyName) expression;
            return pName.getPropertyName();
        }

        if (expression instanceof LiteralExpressionImpl) {
            LiteralExpressionImpl pName = (LiteralExpressionImpl) expression;
            return pName.getValue().toString();
        }

        Integer evaluateInt = expression.evaluate(null, Integer.class);
        if (evaluateInt != null) {
            return evaluateInt.toString();
View Full Code Here

    }
   
    public void refreshExpression() {
        Expression expr = getExpression();
        if (expr instanceof PropertyName) {
            PropertyName property = (PropertyName) expr;
            String name = property.getPropertyName();
            refreshControls(null, name, null);
            feedback();
            return;
        } else if (expr instanceof Literal) {
            Literal literal = (Literal) expr;
View Full Code Here

                        return Appropriate.APPROPRIATE.getScore();
                    }
                }
            }
            if (expression instanceof PropertyName) {
                PropertyName name = (PropertyName) expression;
                if( input != null && input.getSchema() != null ){
                    SimpleFeatureType schema = input.getSchema();
                    AttributeDescriptor descriptor = schema.getDescriptor(name.getPropertyName());
                    if (descriptor != null) {
                        Class<?> binding = descriptor.getType().getBinding();
                        if (Number.class.isAssignableFrom(binding)) {
                            return Appropriate.APPROPRIATE.getScore();
                        }
View Full Code Here

    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
   
    SimpleFeatureType featureType = editLayer.getSchema();   
    String geomName = featureType.getGeometryDescriptor().getLocalName();
   
    PropertyName attributeExpr = ff.property(geomName);
    BBOX filter = ff.bbox(attributeExpr, bounds);
   
    FeatureSource<SimpleFeatureType, SimpleFeature> source = editLayer.getResource(FeatureSource.class, monitor);   
    return source.getFeatures(filter);
}
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();
View Full Code Here

                    }
                }
               
                //check that property names are actually valid
                QName name = property.getName();
                PropertyName propertyName = null;
               
                if ( name.getPrefix() != null && !"".equals( name.getPrefix() )) {
                    propertyName = ff.property( name.getPrefix() + ":" + name.getLocalPart() );
                }
                else {
                    propertyName = ff.property( name.getLocalPart() );
                }
               
                if ( propertyName.evaluate( featureType ) == null ) {
                    String msg = "No such property: " + property.getName();
                    throw new WFSException( msg );
                }
            }
        } catch (IOException e) {
View Full Code Here

TOP

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

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.