Package org.opengis.filter

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


        Literal minus = ff.literal("x");
        Literal ds = ff.literal(":");
        Literal gs = ff.literal(";");

       
        Function f = ff.function("numberFormat2", new Expression[]{pattern, number, minus, ds, gs});
        assertEquals(null, f.evaluate(null, String.class));
    }

}
View Full Code Here


        for (int i = 0; i < 100; i++) {
            Future<Exception> f = es.submit(new Callable<Exception>() {

                public Exception call() throws Exception {
                    try {
                        ff.function("Length", ff.property("."));
                        return null;
                    } catch (Exception e) {
                        return e;
                    }
                }
View Full Code Here

        }
    }

    public void testToLowerCase() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Function f = ff.function("strToLowerCase", ff.literal("UPCASE"));
        assertEquals("upcase", f.evaluate(null));
    }
   
    public void testToUpperCase() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
View Full Code Here

        assertEquals("upcase", f.evaluate(null));
    }
   
    public void testToUpperCase() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Function f = ff.function("strToUpperCase", ff.literal("lowcase"));
        assertEquals("LOWCASE", f.evaluate(null));
    }
}
View Full Code Here

    public void testDateParse() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Literal pattern = ff.literal("yyyy");
        Literal year = ff.literal("1975");
       
        Function f = ff.function("dateParse", new Expression[]{pattern, year});
        Calendar cal = f.evaluate(null , Calendar.class);
        //System.out.println(cal);
        assertEquals(1975, cal.get(Calendar.YEAR));
    }
   
View Full Code Here

        Calendar cal = Calendar.getInstance();
        cal.clear();
        cal.set(Calendar.YEAR, 2000);
        Literal date = ff.literal(cal.getTime());
       
        Function f = ff.function("dateFormat", new Expression[]{pattern, date});
        String year = f.evaluate(null , String.class);
        assertEquals("2000", year);
    }
}
View Full Code Here

public class FilterFunction_offsetTest {

    @Test
    public void testInvert() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory();
        Function function = ff.function("offset", ff.property("the_geom"), ff.literal(1), ff.literal(2));
       
        assertTrue(function instanceof GeometryTransformation);
        GeometryTransformation gt = (GeometryTransformation) function;
        ReferencedEnvelope re = new ReferencedEnvelope(0, 1, 0, 1, DefaultGeographicCRS.WGS84);
        ReferencedEnvelope inverted = gt.invert(re);
View Full Code Here

       
        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.equal(
            ff.function("__equals", ff.property(aname("stringProperty")), ff.literal("one")),
            ff.literal(true), true));

        SimpleFeatureCollection features = dataStore.getFeatureSource(tname("ft1")).getFeatures(q);
        assertEquals(1, features.size());
       
View Full Code Here

       
        //test with post filter on table being joined
        q = new Query(tname("ft1"));
        Join join = new Join(tname("ftjoin"), j);
        join.filter(ff.equal(
            ff.function("__equals", ff.property(aname("name")), ff.literal("one")),
            ff.literal(true), true));
        q.getJoins().add(join);
       
        features = dataStore.getFeatureSource(tname("ft1")).getFeatures(q);
        assertEquals(1, features.size());
View Full Code Here

        Query q = new Query(tname("ft1"));
        Join join = new Join(tname("ftjoin"), j);
        join.setProperties(Query.NO_PROPERTIES);
        q.getJoins().add(join);
        q.setFilter(ff.equal(
            ff.function("__equals", ff.property(aname("stringProperty")), ff.literal("one")),
            ff.literal(true), true));

        SimpleFeatureCollection features = dataStore.getFeatureSource(tname("ft1")).getFeatures(q);
        assertEquals(1, features.size());
       
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.