Package org.opengis.filter

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


        // greater than
        f = ff.greater(ff.property("PERSONS"), ff.literal(10000000));
        assertEquals(6, fs.getFeatures(f).size());
       
        // mix in a filter that cannot be encoded
        f = ff.and(f, ff.like(ff.property("STATE_NAME"), "C*"));
        assertEquals(1, fs.getFeatures(f).size());
    }
   
    public void testAttributesWritingSqlite() throws Exception {
        if (!ogrSupports("SQLite")) {
View Full Code Here


    }
   
    public void testLike() throws IOException {
        SimpleFeatureSource fs = dataStore.getFeatureSource(tname("users"));
        FilterFactory ff = dataStore.getFilterFactory();
        Filter filter = ff.like(ff.property(aname("nick")), "*A*");
        int count = fs.getCount(new Query(tname("users"), filter));
        // we had a case insensitive comparison due to the type, so we get two matches
        assertEquals(2, count);
    }

View Full Code Here

    }

    public void testGetFeaturesWithIsLikeFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsLike f = ff.like(ff.property("standard_ss"), "IEEE 802.11?");
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(11, features.size());
    }

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

        // greater than
        f = ff.greater(ff.property("PERSONS"), ff.literal(10000000));
        assertEquals(6, fs.getFeatures(f).size());
       
        // mix in a filter that cannot be encoded
        f = ff.and(f, ff.like(ff.property("STATE_NAME"), "C*"));
        assertEquals(1, fs.getFeatures(f).size());
    }
   
    public void testGeometryFilters() throws Exception {
        OGRDataStore s = new OGRDataStore(getAbsolutePath(STATE_POP), null, null);
View Full Code Here

        assertTrue(list.contains("name"));
        assertTrue(list.contains("id"));

        Function fnCall = factory.function("Max", new Expression[] { id, name });

        PropertyIsLike fn = factory.like(fnCall, "does-not-matter");
        names = DataUtilities.attributeNames(fn);
        list = Arrays.asList(names);
        assertTrue(list.contains("name"));
        assertTrue(list.contains("id"));
View Full Code Here

        List<PropertyName> readAtts = Arrays.asList(ff.property("the_geom"), ff.property("FID"));
        tam.putLimits("cite_readatts", buildings, new VectorAccessLimits(CatalogMode.HIDE,
                readAtts, fid113, null, null));

        // disallow writing on Restricted Street
        Filter restrictedStreet = ff.not(ff.like(ff.property("ADDRESS"), "*Restricted Street*", "*", "?",
                "\\"));
        tam.putLimits("cite_insertfilter", buildings, new VectorAccessLimits(CatalogMode.HIDE, null,
                null, null, restrictedStreet));
       
        // allows writing only on 113
View Full Code Here

        // limits the attributes, but specifies no filtering
        tam.putLimits("cite_readattsnf", buildings, new VectorAccessLimits(CatalogMode.HIDE,
                readAtts, Filter.INCLUDE, null, Filter.INCLUDE));

        // disallow writing on Restricted Street
        Filter restrictedStreet = ff.not(ff.like(ff.property("ADDRESS"), "*Restricted Street*", "*", "?",
                "\\"));
        tam.putLimits("cite_insertfilter", buildings, new VectorAccessLimits(CatalogMode.HIDE, null,
                null, null, restrictedStreet));
       
        // allows writing only on 113
View Full Code Here

        expected = Sets.newHashSet(ft1);
        actual = Sets.newHashSet(catalog.list(FeatureTypeInfo.class, filter));
        assertEquals(expected, actual);
       
        //match action - like
        filter = factory.like(factory.property("keywords"), "key*d1", "*","?","\\", true, MatchAction.ANY);
        expected = Sets.newHashSet(ft1, ft2);
        actual = Sets.newHashSet(catalog.list(FeatureTypeInfo.class, filter));
        assertEquals(expected, actual);
       
        filter = factory.like(factory.property("keywords"), "key*d1", "*","?","\\", true, MatchAction.ALL);
View Full Code Here

        filter = factory.like(factory.property("keywords"), "key*d1", "*","?","\\", true, MatchAction.ANY);
        expected = Sets.newHashSet(ft1, ft2);
        actual = Sets.newHashSet(catalog.list(FeatureTypeInfo.class, filter));
        assertEquals(expected, actual);
       
        filter = factory.like(factory.property("keywords"), "key*d1", "*","?","\\", true, MatchAction.ALL);
        expected = Sets.newHashSet(ft2);
        actual = Sets.newHashSet(catalog.list(FeatureTypeInfo.class, filter));
        assertEquals(expected, actual);
       
        filter = factory.like(factory.property("keywords"), "key*d1", "*","?","\\", true, MatchAction.ONE);
View Full Code Here

        filter = factory.like(factory.property("keywords"), "key*d1", "*","?","\\", true, MatchAction.ALL);
        expected = Sets.newHashSet(ft2);
        actual = Sets.newHashSet(catalog.list(FeatureTypeInfo.class, filter));
        assertEquals(expected, actual);
       
        filter = factory.like(factory.property("keywords"), "key*d1", "*","?","\\", true, MatchAction.ONE);
        expected = Sets.newHashSet(ft1);
        actual = Sets.newHashSet(catalog.list(FeatureTypeInfo.class, filter));
        assertEquals(expected, actual);
       
        //multivalued literals
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.