Package org.opengis.filter

Examples of org.opengis.filter.PropertyIsEqualTo


     * @throws CQLException
     */
    @Test
    public void relate() throws CQLException {
       
        PropertyIsEqualTo resultFilter;
       
        resultFilter = (PropertyIsEqualTo) CompilerUtil.parseFilter(language,"RELATE(the_geom, LINESTRING (-134.921387 58.687767, -135.303391 59.092838), T*****FF*)");

        Expression relateFunction = resultFilter.getExpression1();
        Assert.assertTrue(relateFunction instanceof FilterFunction_relatePattern);
       
        Literal trueLiteral = (Literal) resultFilter.getExpression2();
        Assert.assertTrue(trueLiteral.getValue() instanceof Boolean);
    }
View Full Code Here


        testRelatePatten("200000000");
    }
   
    private void testRelatePatten(final String pattern) throws CQLException {
       
        PropertyIsEqualTo resultFilter;
       
        resultFilter = (PropertyIsEqualTo) CompilerUtil.parseFilter(language,"RELATE(the_geom, LINESTRING (-134.921387 58.687767, -135.303391 59.092838), "+pattern+")");

        Expression relateFunction = resultFilter.getExpression1();
        Assert.assertTrue(relateFunction instanceof FilterFunction_relatePattern);
       
        Literal trueLiteral = (Literal) resultFilter.getExpression2();
        Assert.assertTrue(trueLiteral.getValue() instanceof Boolean);
    }
View Full Code Here

     */
    @Test
    public void booleanLiteral() throws Exception {
      
        Filter filter;
        PropertyIsEqualTo eqFilter;
       
        //test true value
        filter = CompilerUtil.parseFilter(this.language, "attr = true");
        Assert.assertNotNull(filter);
        Assert.assertTrue(filter instanceof PropertyIsEqualTo);

        eqFilter = (PropertyIsEqualTo) filter;
        Assert.assertEquals("attr", ((PropertyName) eqFilter.getExpression1()).getPropertyName());
        Assert.assertEquals(Boolean.TRUE, ((Literal) eqFilter.getExpression2()).getValue());

        //test false value
        filter = CompilerUtil.parseFilter(this.language, "attr = false");
        Assert.assertNotNull(filter);
        Assert.assertTrue(filter instanceof PropertyIsEqualTo);

        eqFilter = (PropertyIsEqualTo) filter;
        Assert.assertEquals("attr", ((PropertyName) eqFilter.getExpression1()).getPropertyName());
        Assert.assertEquals(Boolean.FALSE, ((Literal) eqFilter.getExpression2()).getValue());
    }
View Full Code Here

    @Test
    public void longLiteral() throws Exception {
      
        Filter filter;
        PropertyIsEqualTo eqFilter;
       
        //test true value
        final String expectedValue = Long.toString(Long.MAX_VALUE);
        filter = CompilerUtil.parseFilter(this.language, "attr = " + expectedValue );
        Assert.assertNotNull(filter);
        Assert.assertTrue(filter instanceof PropertyIsEqualTo);

        eqFilter = (PropertyIsEqualTo) filter;
        Assert.assertEquals("attr", ((PropertyName) eqFilter.getExpression1()).getPropertyName());
        Assert.assertEquals(Long.parseLong(expectedValue), ((Literal) eqFilter.getExpression2()).getValue());
    }
View Full Code Here

    }
   
    @Test
    public void relateGeoOperation() throws CQLException{
       
        PropertyIsEqualTo filter = (PropertyIsEqualTo) CQL.toFilter( "RELATE(geometry, LINESTRING (-134.921387 58.687767, -135.303391 59.092838), T*****FF*)");
       
        Assert.assertTrue("Relate Pattern Function was expected", filter.getExpression1() instanceof FilterFunction_relatePattern);
       
        Assert.assertTrue("Literal TRUE was expected", filter.getExpression2() instanceof Literal);
    }
View Full Code Here

        Filter resultFilter = CQL.toFilter("NAME EXISTS");

        Assert.assertTrue(resultFilter instanceof PropertyIsEqualTo);
       
        PropertyIsEqualTo eq = (PropertyIsEqualTo) resultFilter;
       
        Expression expr = eq.getExpression1() ;

        Assert.assertTrue(expr instanceof PropertyExistsFunction);
       
    }
View Full Code Here

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

        Assert.assertTrue(resultFilter instanceof PropertyIsEqualTo);

        PropertyIsEqualTo eqToResultFilter = (PropertyIsEqualTo) resultFilter;

        Filter expected = FilterCQLSample.getSample(FilterCQLSample.ATTRIBUTE_NAME_EXISTS);

        Assert.assertEquals(expected, eqToResultFilter);

        Assert.assertNotNull("implementation of function was expected", eqToResultFilter.getExpression1());
    }
View Full Code Here

    public void testIntegerContext() throws Exception {

        Expression literal = filterFac.literal(5);
        Expression prop = filterFac.property(integerFType.getAttributeDescriptors().get(0)
                .getLocalName());
        PropertyIsEqualTo filter = filterFac.equals(prop, literal);

        encoder.setFeatureType(integerFType);
        encoder.encode(filter);

        LOGGER.fine("testAttr is an Integer " + filter + " -> " + output.getBuffer().toString());
View Full Code Here

    public void testStringContext() throws Exception {
        Expression literal = filterFac.literal(5);
        Expression prop = filterFac.property(stringFType.getAttributeDescriptors().get(0)
                .getLocalName());
        PropertyIsEqualTo filter = filterFac.equals(prop, literal);

        encoder.setFeatureType(stringFType);
        encoder.encode(filter);

        LOGGER.fine("testAttr is a String " + filter + " -> " + output.getBuffer().toString());
View Full Code Here

    public void testIntegerToNumberContext() throws Exception {

        Expression literal = filterFac.literal(5.0);
        Expression prop = filterFac.property(integerFType.getAttributeDescriptors().get(0)
                .getLocalName());
        PropertyIsEqualTo filter = filterFac.equals(prop, literal);

        encoder.setFeatureType(integerFType);
        encoder.encode(filter);

        LOGGER.fine("testAttr is an Integer " + filter + " -> " + output.getBuffer().toString());
View Full Code Here

TOP

Related Classes of org.opengis.filter.PropertyIsEqualTo

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.