Package org.opengis.filter

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


            // shortcut exit, we had a exact match
            nearest.setValue(maxBelow, null);
        } else {
            // grab mind of values higher than the target
            Query qAbove = new Query(query);
            Filter aboveFilter = ff.greater(ff.property(attribute), ff.literal(targetValue));
            qAbove.setFilter(ff.and(query.getFilter(), aboveFilter));
            MinVisitor min = new MinVisitor(attribute);
            handleVisitor(qAbove, min);
            Comparable minAbove = (Comparable) min.getResult().getValue();
            nearest.setValue(maxBelow, minAbove);
View Full Code Here


    public void testUniqueWithFilter() throws Exception {
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyName p = ff.property( aname("stringProperty") );
       
        UniqueVisitor v = new MyUniqueVisitor(p);
        Filter f = ff.greater( ff.property( aname("doubleProperty") ), ff.literal(1) );
        Query q = new Query( tname("ft1"), f);
        dataStore.getFeatureSource(tname("ft1")).accepts(q, v, null);
        assertFalse(visited);
        Set result = v.getResult().toSet();
        assertEquals(2, result.size());
View Full Code Here

        FilterFactory ff = dataStore.getFilterFactory();
        PropertyName p = ff.property( aname("doubleProperty") );
       
        MinVisitor v = new MyMinVisitor(p);
       
        Filter f = ff.greater( ff.property( aname("doubleProperty") ), ff.literal(1) );
        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

        dataStore.setExposePrimaryKeyColumns(exposePrimaryKeys);
        FilterFactory ff = dataStore.getFilterFactory();
        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));
    }
View Full Code Here

        FilterFactory ff = dataStore.getFilterFactory();
       
        Filter j = ff.equal(ff.property(aname("stringProperty")), ff.property(aname("name")), true);
        Query q = new Query(tname("ft1"));
        q.getJoins().add(new Join(tname("ftjoin"), j));
        q.setFilter(ff.greater(ff.property(aname("intProperty")), ff.literal(0)));
        q.setStartIndex(1);
        q.setSortBy(new SortBy[]{ff.sort(aname("intProperty"), SortOrder.ASCENDING)});
       
        SimpleFeatureCollection features = dataStore.getFeatureSource(tname("ft1")).getFeatures(q);
        assertEquals(1, features.size());
View Full Code Here

                    FeatureSource fs = remoteStore.getFeatureSource(TOPP_STATES);
                    remoteWFSStatesAvailable = Boolean.TRUE;
                    // check a basic response can be answered correctly
                    Query dq = new Query(TOPP_STATES);
                    FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
                    dq.setFilter(ff.greater(ff.property("PERSONS"), ff.literal(20000000)));
                    FeatureCollection fc = fs.getFeatures(dq);
                    if(fc.size() != 1) {
                        logger.log(Level.WARNING, "Remote database status invalid, there should be one and only one " +
                                "feature with more than 20M persons in topp:states");
                        remoteWFSStatesAvailable = Boolean.FALSE;
View Full Code Here

                    FeatureSource fs = remoteStore.getFeatureSource(TOPP_STATES);
                    remoteWFSStatesAvailable = Boolean.TRUE;
                    // check a basic response can be answered correctly
                    Query dq = new Query(TOPP_STATES);
                    FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
                    dq.setFilter(ff.greater(ff.property("PERSONS"), ff.literal(20000000)));
                    FeatureCollection fc = fs.getFeatures(dq);
                    if(fc.size() != 1) {
                        logger.log(Level.WARNING, "Remote database status invalid, there should be one and only one " +
                                "feature with more than 20M persons in topp:states");
                        remoteWFSStatesAvailable = Boolean.FALSE;
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.