Examples of PropertyIsBetween


Examples of org.opengis.filter.PropertyIsBetween

    }

    public void testParse() throws Exception {
        FilterMockData.propertyIsBetween(document, document);

        PropertyIsBetween between = (PropertyIsBetween) parse();

        assertTrue(between.getExpression() instanceof PropertyName);
        assertTrue(between.getLowerBoundary() instanceof Literal);
        assertTrue(between.getUpperBoundary() instanceof Literal);
    }
View Full Code Here

Examples of org.opengis.filter.PropertyIsBetween

            org.opengis.filter.expression.Expression inf = this.resultStack
                    .popExpression();
            org.opengis.filter.expression.Expression expr = this.resultStack
                    .popExpression();

            PropertyIsBetween filter = filterFactory.between(expr, inf, sup);

            return filter;
        } catch (IllegalFilterException ife) {
            throw new CQLException("Exception building CompareFilter: "+ ife.getMessage(), this.cqlSource);
        }
View Full Code Here

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

Examples of org.opengis.filter.PropertyIsBetween

        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

Examples of org.opengis.filter.PropertyIsBetween

    }

    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

Examples of org.opengis.filter.PropertyIsBetween

            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

Examples of org.opengis.filter.PropertyIsBetween

        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

Examples of org.opengis.filter.PropertyIsBetween

        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

Examples of org.opengis.filter.PropertyIsBetween

        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

Examples of org.opengis.filter.PropertyIsBetween

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