Package org.opengis.filter

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


    }

    public void testGetFeaturesWithLessThanOrEqualToFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsLessThanOrEqualTo f = ff.lessOrEqual(ff.property("speed_is"), ff.literal(150));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(9, features.size());
    }

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


    public void testCompareDateFilter() throws Exception {
        init();
        Date testDate = df.parse("2009-06-28 00:00:00");
        FilterFactory ff = dataStore.getFilterFactory();

        Filter f = ff.lessOrEqual(ff.property("installed_tdt"), ff.literal(testDate));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(4, features.size());
        SimpleFeatureIterator it = features.features();
        while (it.hasNext()) {
            Date date = (Date) it.next().getAttribute("installed_tdt");
View Full Code Here

        }
       
        // grab max of values lower than the target
        FilterFactory ff = getDataStore().getFilterFactory();
        Query qBelow = new Query(query);
        Filter lessFilter = ff.lessOrEqual(ff.property(attribute), ff.literal(targetValue));
        qBelow.setFilter(ff.and(query.getFilter(), lessFilter));
        MaxVisitor max = new MaxVisitor(attribute);
        handleVisitor(qBelow, max);
        Comparable maxBelow = (Comparable) max.getResult().getValue();
        if(maxBelow != null && maxBelow.equals(targetValue)) {
View Full Code Here

       
        DateFormat df = new SimpleDateFormat("yyyy-dd-MM");
        df.setTimeZone( TimeZone.getTimeZone("PST"));
       
        //less than
        Filter f = ff.lessOrEqual( ff.property( aname("d") ), ff.literal( df.parse("2009-28-06")
         ) );
        assertEquals( 2, fs.getCount( new DefaultQuery(tname("dates"),f ) ) );
       
        f = ff.lessOrEqual( ff.property( aname("d") ),ff.literal( df.parse("2009-28-06") ) );
        assertEquals( 2, fs.getCount( new DefaultQuery(tname("dates"),f ) ) );
View Full Code Here

        //less than
        Filter f = ff.lessOrEqual( ff.property( aname("d") ), ff.literal( df.parse("2009-28-06")
         ) );
        assertEquals( 2, fs.getCount( new DefaultQuery(tname("dates"),f ) ) );
       
        f = ff.lessOrEqual( ff.property( aname("d") ),ff.literal( df.parse("2009-28-06") ) );
        assertEquals( 2, fs.getCount( new DefaultQuery(tname("dates"),f ) ) );
    }
   
    public void testFilterByTimeStamp() throws Exception {
        FeatureSource fs = dataStore.getFeatureSource( tname("dates") );
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.