Package org.opengis.filter

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


    @Test
    public void testCompoundPolygonWithHole() throws Exception {
        ContentFeatureSource fs = dataStore.getFeatureSource(tname("curves"));
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equal(ff.property(aname("name")),
                ff.literal("Compound polygon with hole"), true);
        ContentFeatureCollection fc = fs.getFeatures(filter);
        assertEquals(1, fc.size());
        SimpleFeature feature = DataUtilities.first(fc);
        Geometry g = (Geometry) feature.getDefaultGeometry();
View Full Code Here


    @Test
    public void testMultipolygon() throws Exception {
        ContentFeatureSource fs = dataStore.getFeatureSource(tname("curves"));
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equal(ff.property(aname("name")),
                ff.literal("Multipolygon with curves"), true);
        ContentFeatureCollection fc = fs.getFeatures(filter);
        assertEquals(1, fc.size());
        SimpleFeature feature = DataUtilities.first(fc);
        Geometry g = (Geometry) feature.getDefaultGeometry();
View Full Code Here

        Transaction t = new DefaultTransaction();
        SimpleFeatureType type = dataStore.getSchema(tname("river"));
         FeatureReader<SimpleFeatureType, SimpleFeature> reader;

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        PropertyIsEqualTo f = ff.equals(ff.property(aname("flow")), ff.literal(4.5));

        DefaultQuery q = new DefaultQuery(tname("river"));
        q.setPropertyNames(new String[] { aname("geom") });
        q.setFilter(f);
View Full Code Here

        SimpleFeatureType type = dataStore.getSchema(tname("river"));
        FeatureReader<SimpleFeatureType, SimpleFeature> reader;

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        FilterFunction_ceil ceil = new FilterFunction_ceil();
        ceil.setParameters((List)Collections.singletonList(ff.property(aname("flow"))));

        PropertyIsEqualTo f = ff.equals(ceil, ff.literal(5));

        DefaultQuery q = new DefaultQuery(tname("river"));
        q.setPropertyNames(new String[] { aname("geom") });
View Full Code Here

   
    public void testGetFeatureInvalidFilter() throws Exception {
        FeatureReader<SimpleFeatureType, SimpleFeature> reader;

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        PropertyIsEqualTo f = ff.equals(ff.property("invalidAttribute"), ff.literal(5));

        DefaultQuery q = new DefaultQuery(tname("river"));
        q.setPropertyNames(new String[] { aname("geom") });
        q.setFilter(f);
View Full Code Here

   
    public void testGetFeatureWriterInvalidFilter() {
        FeatureWriter<SimpleFeatureType, SimpleFeature> writer;

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        PropertyIsEqualTo f = ff.equals(ff.property("invalidAttribute"), ff.literal(5));

        // make sure a complaint related to the invalid filter is thrown here
        try {
            writer= dataStore.getFeatureWriter("river", f, Transaction.AUTO_COMMIT);
            writer.close();
View Full Code Here

     */
    public void testGetFeatureStoreModifyFeatures3() throws IOException {
        SimpleFeatureStore road = (SimpleFeatureStore) dataStore.getFeatureSource(tname("road"));

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        PropertyIsEqualTo filter = ff.equals(ff.property(aname("name")), ff.literal("r1"));

        AttributeDescriptor name = td.roadType.getDescriptor(aname("name"));
        road.modifyFeatures(new AttributeDescriptor[] { name, }, new Object[] { "changed", }, filter);
    }

View Full Code Here

        if (super.onlineTest("testGetFeatureReader")) {
            SFSDataStoreFactory factory = new SFSDataStoreFactory();
            SFSDataStore ods = (SFSDataStore) factory.createDataStore(createParams());
           
            FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
            Filter f1 = ff.equals(ff.property("CFCC"), ff.literal("A41"));
            Filter f2 = ff.equals(ff.property("CFCC"), ff.literal("A42"));
            Filter ored = ff.or(f1, f2);

            FeatureReader<SimpleFeatureType, SimpleFeature> r = ods.getFeatureReader(new Query(FEATURESOURCE, ored), Transaction.AUTO_COMMIT);
            assertNotNull(r);
View Full Code Here

            SFSDataStoreFactory factory = new SFSDataStoreFactory();
            SFSDataStore ods = (SFSDataStore) factory.createDataStore(createParams());
           
            FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
            Filter f1 = ff.equals(ff.property("CFCC"), ff.literal("A41"));
            Filter f2 = ff.equals(ff.property("CFCC"), ff.literal("A42"));
            Filter ored = ff.or(f1, f2);

            FeatureReader<SimpleFeatureType, SimpleFeature> r = ods.getFeatureReader(new Query(FEATURESOURCE, ored), Transaction.AUTO_COMMIT);
            assertNotNull(r);
            assertTrue(r.hasNext());
View Full Code Here

    public void testPropertyName() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory2(null);
        ExpressionBuilder b = new ExpressionBuilder();
        Expression e;

        assertEquals(ff.property("x"), b.property("x").build());
        assertEquals(ff.property("x"), b.property().property("x").build());
        assertEquals(ff.property("x"), b.property().name("x").build());

        assertEquals(ff.property(null), b.property(null).build());
    }
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.