Examples of PropertyIsLike


Examples of org.opengis.filter.PropertyIsLike

        }
    }
   
    public void testLikeFilter() throws Exception {
        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        PropertyIsLike caseSensitiveLike = ff.like(ff.property(aname("stringProperty")),
                "Z*", "*", "?", "\\", true);
        PropertyIsLike caseInsensitiveLike = ff.like(ff.property(aname("stringProperty")),
                "Z*", "*", "?", "\\", false);
        PropertyIsLike caseInsensitiveLike2 = ff.like(ff.property(aname("stringProperty")),
                "z*", "*", "?", "\\", false);
        assertEquals(0, featureSource.getCount(new Query(null, caseSensitiveLike)));
        assertEquals(1, featureSource.getCount(new Query(null, caseInsensitiveLike)));
        assertEquals(1, featureSource.getCount(new Query(null, caseInsensitiveLike2)));
    }
View Full Code Here

Examples of org.opengis.filter.PropertyIsLike

        assertTrue(list.contains("name"));
        assertTrue(list.contains("id"));

        Function fnCall = factory.function("Max", new Expression[] { id, name });

        PropertyIsLike fn = factory.like(fnCall, "does-not-matter");
        names = DataUtilities.attributeNames(fn);
        list = Arrays.asList(names);
        assertTrue(list.contains("name"));
        assertTrue(list.contains("id"));
View Full Code Here

Examples of org.opengis.filter.PropertyIsLike

       
        // using a property as expression
        assertFilter("aProperty LIKE '%bb%'", PropertyIsLike.class);
          
        // using function as expression
        PropertyIsLike like = assertFilter("strToUpperCase(anAttribute) LIKE '%BB%'",PropertyIsLike.class);
       
        Assert.assertTrue(like.getExpression() instanceof Function );
    }
View Full Code Here

Examples of org.opengis.filter.PropertyIsLike

        return simplifyBinaryComparisonOperator((BinaryComparisonOperator) super.visit(filter, extraData));
    }
   
    @Override
    public Object visit(PropertyIsLike filter, Object extraData) {
        PropertyIsLike clone = (PropertyIsLike) super.visit(filter, extraData);
        if(isConstant(clone.getExpression())) {
            return staticFilterEvaluate(clone);
        } else {
            return clone;
        }
    }
View Full Code Here

Examples of org.opengis.filter.PropertyIsLike

        Assert.assertNotNull("Filter expected", resultFilter);

        Assert.assertTrue(resultFilter instanceof PropertyIsLike);
       
        PropertyIsLike expected = (PropertyIsLike) FilterECQLSample.getSample(FilterECQLSample.FUNCTION_LIKE_ECQL_PATTERN);

        Assert.assertEquals("like filter was expected", expected, resultFilter);
       
        // test for strToUpperCase function
        resultFilter = ECQL.toFilter( "strToUpperCase(anAttribute) like '%BB%'");

        Assert.assertTrue(resultFilter instanceof PropertyIsLike);

        PropertyIsLike resultLike = (PropertyIsLike) resultFilter;
       
        Expression resultExpression = resultLike.getExpression();
        Assert.assertTrueresultExpression instanceof Function);
       
        Function resultFunction = (Function)resultExpression;
        Assert.assertEquals("strToUpperCase", resultFunction.getName());
       
        Assert.assertEquals( resultLike.getLiteral()"%BB%" );
       
    }
View Full Code Here

Examples of org.opengis.filter.PropertyIsLike

      Filter resultFilter = ECQL.toFilter( "strToUpperCase(anAttribute) like '%año%'");

        Assert.assertTrue(resultFilter instanceof PropertyIsLike);

        PropertyIsLike resultLike = (PropertyIsLike) resultFilter;
       
        Expression resultExpression = resultLike.getExpression();
        Assert.assertTrueresultExpression instanceof Function);
       
        Function resultFunction = (Function)resultExpression;
        Assert.assertEquals("strToUpperCase", resultFunction.getName());
       
        Assert.assertEquals( resultLike.getLiteral()"%año%" );
       
    }
View Full Code Here

Examples of org.opengis.filter.PropertyIsLike

        Assert.assertNotNull("Filter expected", resultFilter);

        Assert.assertTrue(resultFilter instanceof PropertyIsLike);
       
        PropertyIsLike expected = (PropertyIsLike) FilterECQLSample.getSample(FilterECQLSample.LITERAL_LIKE_ECQL_PATTERN);

        Assert.assertEquals("like filter was expected", expected, resultFilter);

    }
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.