Package org.opengis.filter

Examples of org.opengis.filter.PropertyIsEqualTo


        encoder.encode(id);
        assertEquals("WHERE (id = 'fid1')", output.toString());
    }
   
    public void testEscapeQuote() throws FilterToSQLException {
        PropertyIsEqualTo equals = filterFac.equals(filterFac.property("attribute"), filterFac.literal("A'A"));
        encoder.encode(equals);
        assertEquals("WHERE attribute = 'A''A'", output.toString());
    }
View Full Code Here


            public String toString() {
                return "A'A";
            }
       
        };
        PropertyIsEqualTo equals = ff.equals(ff.property("attribute"), ff.literal(fancyLiteral));
        StringWriter output = new StringWriter();
        FilterToSQL encoder = new FilterToSQL(output);
        encoder.encode(equals);
        assertEquals("WHERE attribute = 'A''A'", output.toString());
    }
View Full Code Here

        assertEquals("WHERE attribute = 'A''A'", output.toString());
    }
   
    public void testNumberEscapes() throws Exception {
        Add a = filterFac.add(filterFac.property("testAttr"), filterFac.literal(5));
        PropertyIsEqualTo equal = filterFac.equal(filterFac.property("testAttr"), a, false);
        StringWriter output = new StringWriter();
        FilterToSQL encoder = new FilterToSQL(output);
        // this test must pass even when the target feature type is not known
        // encoder.setFeatureType(integerFType);
        encoder.encode(equal);
View Full Code Here

        encoder.encode(equal);
        assertEquals("WHERE testAttr = testAttr + 5", output.toString());
    }

    public void testInline() throws Exception {
        PropertyIsEqualTo equal = filterFac.equal(filterFac.property("testAttr"), filterFac.literal(5), false);
        StringWriter output = new StringWriter();
        FilterToSQL encoder = new FilterToSQL(output);
        encoder.setInline(true);
       
        encoder.encode(equal);
View Full Code Here

     * Sets up a schema and a test feature.
     *
     * @throws IllegalFilterException If the constructed filter is not valid.
     */
    public void testCompare() throws IllegalFilterException {
        PropertyIsEqualTo filter = fac.equals(fac.property("testString"), fac.literal("test string data"));
        assertAttributeName(filter, "testString");
    }
View Full Code Here

    public void testLogic() throws IllegalFilterException {
       
        PropertyName testAttribute = fac.property("testString");

        // Set up true sub filter
        PropertyIsEqualTo filterTrue = fac.equals(testAttribute, fac.literal("test string data"));

        // Set up false sub filter
        PropertyIsEqualTo filterFalse = fac.equals(testAttribute, fac.literal("incorrect test string data"));

        // Test OR for false negatives
        Or filter = fac.or(Arrays.asList((org.opengis.filter.Filter) filterFalse,
                (org.opengis.filter.Filter) filterTrue));
View Full Code Here

        assertAttributeName(filter, "testString");
    }
   
    public void testDynamicProperty() throws Exception {
        Function func = fac.function("property", fac.function("env", fac.literal("pname")));
        PropertyIsEqualTo filter = fac.equals(func, fac.literal("test"));
        try {
            EnvFunction.setLocalValue("pname", "name");
            assertAttributeName(filter, "name");
        } finally {
            EnvFunction.clearLocalValues();
View Full Code Here

     */
    public void testRestrictionCheck() {
        FilterFactory fac = CommonFactoryFinder.getFilterFactory(null);

        String attributeName = "string";
        PropertyIsEqualTo filter = fac.equals(fac.property("."), fac
                .literal("Value"));

        SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); //$NON-NLS-1$
        builder.setName("test");
        builder.restriction(filter).add(attributeName, String.class);
View Full Code Here

    }

    public void testCountWithIsEqualFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equals(ff.property("vendor_s"), ff.literal("D-Link"));
        Query query = new Query();
        query.setFilter(filter);
        assertEquals(4, featureSource.getCount(query));
    }
View Full Code Here

    }

    public void testGetFeaturesWithAndLogicFilter() 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", -1, -1, 10, 10, "EPSG:" + SOURCE_SRID);
        And filter = ff.and(property, bbox);
        SimpleFeatureCollection features = featureSource.getFeatures(filter);
        assertEquals(3, features.size());
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.