Package org.opengis.filter

Examples of org.opengis.filter.FilterFactory.less()


        AttributeTypeBuilder builder = new AttributeTypeBuilder();
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Function length = ff.function("LengthFunction", new Expression[]{ff.property(".")});
       
        // strict less
        builder.addRestriction(ff.less(length, ff.literal(20)));
        builder.setBinding(String.class);
        AttributeDescriptor attribute = builder.buildDescriptor("attribute");
        assertEquals(19, FeatureTypes.getFieldLength(attribute));
       
        // flip expression
View Full Code Here


    }

    public void testGetFeaturesWithIsLessThanFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsLessThan f = ff.less(ff.property("speed_is"), ff.literal(150));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(0, features.size());
    }

    public void testGetFeaturesWithLessThanOrEqualToFilter() throws Exception {
View Full Code Here

        FilterFactory ff = dataStore.getFilterFactory();
        PropertyName p = ff.property( aname("doubleProperty") );
       
        SumVisitor v = new MySumVisitor(p);
       
        Filter f = ff.less( ff.property( aname("doubleProperty") ), ff.literal(2) );
        Query q = new DefaultQuery( tname("ft1"), f);
        dataStore.getFeatureSource( tname("ft1")).accepts( q, v, null);
        assertFalse(visited);
        assertEquals( 1.1, v.getResult().toDouble(), 0.01 );
    }
View Full Code Here

        FilterFactory ff = dataStore.getFilterFactory();
        PropertyName p = ff.property( aname("doubleProperty") );
       
        MaxVisitor v = new MyMaxVisitor(p);
       
        Filter f = ff.less( ff.property( aname("doubleProperty") ), ff.literal(2) );
        Query q = new DefaultQuery( tname("ft1"), f);
        dataStore.getFeatureSource( tname("ft1")).accepts( q, v, null);
        assertFalse(visited);
        assertEquals( 1.1, v.getResult().toDouble(), 0.01 );
    }
View Full Code Here

        Query q = new Query(tname("ft1"));
        Join j = new Join(tname("ftjoin"),
            ff.equal(ff.property(aname("stringProperty")), ff.property(aname("name")), true));
        j.filter(ff.greater(ff.property(aname("join1intProperty")), ff.literal(1)));
        q.getJoins().add(j);
        q.setFilter(ff.less(ff.property(aname("intProperty")), ff.literal(3)));
       
        assertEquals(1, dataStore.getFeatureSource(tname("ft1")).getCount(q));
    }

    public void testSimpleJoinWithPostFilter() throws Exception {
View Full Code Here

        return f;
    }

    private SimpleFeatureSource getView() throws IllegalFilterException, IOException, SchemaException {
        FilterFactory fac = CommonFactoryFinder.getFilterFactory(null);
        Filter f = fac.less(fac.property("id"), fac.literal(3));

        SimpleFeatureSource view = DataUtilities.createView(ds, new Query(typeName, f));
        return view;
    }
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.