Package org.opengis.filter

Examples of org.opengis.filter.PropertyIsEqualTo


    }

    public void testGetFeaturesWithORLogicFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo property1 = ff.equals(ff.property("vendor_s"), ff.literal("D-Link"));
        PropertyIsEqualTo property2 = ff.equals(ff.property("vendor_s"), ff.literal("Linksys"));
        Or filter = ff.or(property1, property2);
        SimpleFeatureCollection features = featureSource.getFeatures(filter);
        assertEquals(4, features.size());
        SimpleFeatureIterator iterator = features.features();
        while (iterator.hasNext()) {
View Full Code Here


    }

    public void testGetFeaturesWithNOTLogicFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo property1 = ff.equals(ff.property("vendor_s"), ff.literal("D-Link"));
        Not filter = ff.not(property1);
        SimpleFeatureCollection features = featureSource.getFeatures(filter);
        assertEquals(7, features.size());
        SimpleFeatureIterator iterator = features.features();
        while (iterator.hasNext()) {
View Full Code Here

    }

    public void testGetFeaturesWithQuery() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equals(ff.property("modem_b"), ff.literal(true));

        Query query = new Query();
        query.setPropertyNames(new String[] { "standard_ss", "security_ss" });
        query.setFilter(filter);
View Full Code Here

            FeatureTypeConstraint[] featureTypeConstraints = layer.getLayerFeatureConstraints();
              final int featureTypeConstraintCount = 1;
              assertEquals(featureTypeConstraintCount, featureTypeConstraints.length);
              Filter filter = featureTypeConstraints[0].getFilter();
              assertTrue(filter instanceof PropertyIsEqualTo);
              PropertyIsEqualTo equal = (PropertyIsEqualTo) filter;
              assertTrue(equal.getExpression1() instanceof PropertyName);
              assertTrue(equal.getExpression2() instanceof Literal);
          }
        }
       
    }
View Full Code Here

        assertEquals(11, features.size());
    }
    public void testClipToWorldFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo property = ff.equals(ff.property("standard_ss"),
                ff.literal("IEEE 802.11b"));
        BBOX bbox = ff.bbox("geo", -190, -190, 190, 190, "EPSG:" + SOURCE_SRID);
        And filter = ff.and(property, bbox);
        SimpleFeatureCollection features = featureSource.getFeatures(filter);
        assertEquals(7, features.size());
View Full Code Here

   
    @Test
    public void testFilter() throws Exception {
        ContentFeatureSource featureSource = store.getFeatureSource("gttestdb.counties");
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        PropertyIsEqualTo isPueblo = ff.equal(ff.property("Name"),ff.literal("Pueblo"),true);
        ContentFeatureCollection features = featureSource.getFeatures(isPueblo);
        assertEquals(1, count(features));
    }
View Full Code Here

    updateProperties.put(NAME_ATT, "newName");
    state.addAction(featureType.getTypeName(), new Action.UpdateAction(typename,
                                ff.id(createFeature.getIdentifier()),
        updateProperties));
    updateProperties.put(NAME_ATT, "secondUpdate");
    PropertyIsEqualTo matchFilter = ff.equals(ff.property("name"),ff.literal("newName"));
    state.addAction(featureType.getTypeName(), new Action.UpdateAction(typename, matchFilter, updateProperties));

    updateProperties.put(NAME_ATT, "secondNoMatch");
    state.addAction(featureType.getTypeName(), new Action.UpdateAction(typename, CUSTOM_FILTERALL, updateProperties));
   
View Full Code Here

    state.addAction(featureType.getTypeName(), new Action.UpdateAction(typename,
                        ff.id(createFeature.getIdentifier()),
                        updateProperties));
    updateProperties.put(NAME_ATT, "secondUpdate");
   
    PropertyIsEqualTo matchFilter = ff.equals(ff.property("name"),ff.literal("newName"));
   
    state.addAction(featureType.getTypeName(), new Action.UpdateAction(typename, matchFilter, updateProperties));

    updateProperties.put(NAME_ATT, "secondNoMatch");
    state.addAction(featureType.getTypeName(), new Action.UpdateAction(typename, CUSTOM_FILTERALL, updateProperties));
View Full Code Here

        ff.id( createFeature.getIdentifier()),
        updateProperties);

    updateProperties.put(NAME_ATT, "secondUpdate");
   
    PropertyIsEqualTo matchFilter = ff.equals(ff.property("name"),ff.literal("newName"));
    Action.UpdateAction updateManyIncludingInsert1 = new Action.UpdateAction(typename, matchFilter, updateProperties);

    updateProperties.put(NAME_ATT, "secondNoMatch");
    Action.UpdateAction updateNone = new Action.UpdateAction(typename, CUSTOM_FILTERALL, updateProperties);
View Full Code Here

        assertEquals("featuretypename", features.getFeatureType().getLocalPart());
        assertEquals(2, features.getPropertyNames().size());
        assertTrue(features.getPropertyNames().contains(new QName("http://www.opengis.net/gpkg", "property1", "")));
        assertTrue(features.getPropertyNames().contains(new QName("http://www.opengis.net/gpkg", "property2", "")));
        assertTrue(features.getFilter() instanceof PropertyIsEqualTo);
        PropertyIsEqualTo filter = (PropertyIsEqualTo) features.getFilter();
        assertTrue(filter.getExpression1() instanceof PropertyName);
        assertTrue(filter.getExpression2() instanceof Literal);
        assertEquals("propertyx", ((PropertyName) filter.getExpression1()).getPropertyName());
        assertEquals("999", ((Literal) filter.getExpression2()).getValue());
       
        assertTrue(request.getLayer(0) instanceof GeoPackageProcessRequest.FeaturesLayer);
        GeoPackageProcessRequest.TilesLayer tiles = (GeoPackageProcessRequest.TilesLayer) request.getLayer(1);
        assertEquals("t1", tiles.getIdentifier());
        assertEquals("tiles1", tiles.getName());
View Full Code Here

TOP

Related Classes of org.opengis.filter.PropertyIsEqualTo

Copyright © 2018 www.massapicom. 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.