Package org.opengis.filter

Examples of org.opengis.filter.PropertyIsBetween


        PropertyIsGreaterThan gt = (PropertyIsGreaterThan) filters.get(0);
        Assert.assertEquals("attr1", ((PropertyName) gt.getExpression1()).getPropertyName());
        Assert.assertEquals(new Long(5), ((Literal) gt.getExpression2()).getValue());

        PropertyIsBetween btw = (PropertyIsBetween) filters.get(1);
        Assert.assertEquals("attr2", ((PropertyName) btw.getExpression()).getPropertyName());
        Assert.assertEquals(new Long(1), ((Literal) btw.getLowerBoundary()).getValue());
        Assert.assertEquals(new Long(7), ((Literal) btw.getUpperBoundary()).getValue());

        PropertyIsEqualTo equals = (PropertyIsEqualTo) filters.get(2);
        Assert.assertEquals("attr3", ((PropertyName) equals.getExpression1()).getPropertyName());
        Assert.assertEquals(valueWithDelimiter, ((Literal) equals.getExpression2()).getValue());
    }
View Full Code Here


        Filter resultFilter = CQL.toFilter(prop + " BETWEEN 100 AND 200 ");

        Assert.assertTrue("PropertyIsBetween filter was expected",
            resultFilter instanceof PropertyIsBetween);

        PropertyIsBetween filter = (PropertyIsBetween) resultFilter;
        Expression property = filter.getExpression();

        Assert.assertEquals(propExpected, property.toString());
    }
View Full Code Here

    }

    public void testGetFeaturesWithBetweenFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsBetween between = ff.between(ff.property("speed_is"), ff.literal(0),
                ff.literal(150));
        SimpleFeatureCollection features = featureSource.getFeatures(between);
        assertEquals(9, features.size());
        SimpleFeatureIterator iterator = features.features();
        while (iterator.hasNext()) {
View Full Code Here

            rules[i] = sf.createRule();

            Expression expr = value;
            Expression lower = ff.literal(breaks[i - 1]);
            Expression upper = ff.literal(breaks[i]);
            PropertyIsBetween cf = ff.between(expr, lower, upper);
           
            LOGGER.fine(cf.toString());
            c = this.createColor(colors[i]);
            LOGGER.fine("color " + c.toString());

            PolygonSymbolizer symb = createPolygonSymbolizer(c, Color.black, 1.0);
View Full Code Here

        simpleLogicalCaps.addAll(Capabilities.LOGICAL_OPENGIS);
    }

    @Test
    public void testVisitBetweenFilter() throws Exception {
        PropertyIsBetween filter = ff.between(ff.literal(0), ff.property(numAtt), ff.literal(4));

        runTest(filter, newCapabilities(PropertyIsBetween.class), numAtt);
    }
View Full Code Here

        assertEquals(false, a.evaluate(f5)); // too large
    }

    public void testEquals() throws Exception {
        org.opengis.filter.FilterFactory ff = CommonFactoryFinder.getFilterFactory();
        PropertyIsBetween f1 = ff.between(ff.property("abc"), ff.literal(10), ff.literal(20));
        PropertyIsBetween f2 = ff.between(ff.property("efg"), ff.literal(10), ff.literal(20));
        PropertyIsBetween f3 = ff.between(ff.property("abc"), ff.literal(10), ff.literal(20));

        assertEquals(f1, f3);
        assertFalse(f1.equals(f2));
    }
View Full Code Here

        simpleLogicalCaps.addAll(FilterCapabilities.SIMPLE_COMPARISONS_OPENGIS);
        simpleLogicalCaps.addAll(FilterCapabilities.LOGICAL_OPENGIS);
    }
   
  public void testVisitBetweenFilter() throws Exception {
    PropertyIsBetween filter = ff.between(ff.literal(0), ff.property(numAtt), ff.literal(4));
   
        FilterCapabilities caps = new FilterCapabilities(PropertyIsBetween.class);
    runTest(filter, caps, numAtt);
  }
View Full Code Here

        Literal testLiteralLower = fac.literal(1001);
        PropertyName testAttribute = fac.property("testInteger");
        Literal testLiteralUpper = fac.literal(1003);

        // String tests
        PropertyIsBetween filter = fac.between(testAttribute, testLiteralLower, testLiteralUpper);
        assertTrue(filter.evaluate(testFeature));

        // Test for false positive.
        testLiteralLower = fac.literal(1);
        testLiteralUpper = fac.literal(1000);
        filter = fac.between(testAttribute, testLiteralLower, testLiteralUpper);

        //LOGGER.finer( filter.toString());           
        //LOGGER.finer( "contains feature: " + filter.evaluate(testFeature));
        assertFalse(filter.evaluate(testFeature));
    }
View Full Code Here

        PropertyName testAttribute = new AttributeExpressionImpl(testSchema,
                "testString");
        Literal testLiteralUpper = new LiteralExpressionImpl("tron");

        // String tests
        PropertyIsBetween filter = fac.between(testAttribute, testLiteralLower, testLiteralUpper);
        assertTrue(filter.evaluate(testFeature));

        // Test for false positive.
        testLiteralLower = new LiteralExpressionImpl("zebra");
        testLiteralUpper = new LiteralExpressionImpl("zikes");
        filter = fac.between(testAttribute, testLiteralLower, testLiteralUpper);
        assertFalse(filter.evaluate(testFeature));
    }
View Full Code Here

        PropertyIsLike clone = (PropertyIsLike) super.visit(filter, extraData);
        return guardAgainstNulls(filter, clone.getExpression());
    }

    public Object visit(PropertyIsBetween filter, Object extraData) {
        PropertyIsBetween clone = (PropertyIsBetween) super.visit(filter, extraData);
        Filter f = guardAgainstNulls(clone, clone.getExpression());
        f = guardAgainstNulls(f, clone.getLowerBoundary());
        f = guardAgainstNulls(f, clone.getUpperBoundary());
        return f;
    }
View Full Code Here

TOP

Related Classes of org.opengis.filter.PropertyIsBetween

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.