Package org.opengis.filter

Examples of org.opengis.filter.PropertyIsEqualTo


    public void testEstimatedBoundsWithQuery() throws Exception {
        // enable fast bbox
        ((OracleDialect) ((JDBCDataStore) dataStore).getSQLDialect()).setEstimatedExtentsEnabled(true);
       
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equals(ff.property(aname("stringProperty")), ff.literal("one"));

        DefaultQuery query = new DefaultQuery();
        query.setFilter(filter);

        ReferencedEnvelope bounds = dataStore.getFeatureSource(tname("ft1")).getBounds(query);
View Full Code Here


    public void testRun() throws Exception {
        Object thing = parser.parse(getClass().getResourceAsStream("test1.xml"));
        assertNotNull(thing);
        assertTrue(thing instanceof PropertyIsEqualTo);

        PropertyIsEqualTo equal = (PropertyIsEqualTo) thing;
        assertTrue(equal.getExpression1() instanceof PropertyName);
        assertTrue(equal.getExpression2() instanceof Literal);

        PropertyName name = (PropertyName) equal.getExpression1();
        assertEquals("testString", name.getPropertyName());

        Literal literal = (Literal) equal.getExpression2();
        assertEquals("2", literal.toString());
    }
View Full Code Here

    }

    public void testPropertyIsEqualToParse() throws Exception {
        FilterMockData.propertyIsEqualTo(document, document);

        PropertyIsEqualTo equalTo = (PropertyIsEqualTo) parse();
        assertNotNull(equalTo);

        assertNotNull(equalTo.getExpression1());
        assertNotNull(equalTo.getExpression2());
    }
View Full Code Here

        assertNotNull(equalTo.getExpression1());
        assertNotNull(equalTo.getExpression2());
    }

    public void testPropertyIsEqualToEncode() throws Exception {
        PropertyIsEqualTo equalTo = FilterMockData.propertyIsEqualTo();

        Document dom = encode(equalTo, OGC.PropertyIsEqualTo);
        assertEquals(1,
            dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyName.getLocalPart()).getLength());
        assertEquals(1,
View Full Code Here

    }

    public void testPropertyIsEqualToParse() throws Exception {
        FilterMockData.propertyIsEqualTo(document, document);

        PropertyIsEqualTo equalTo = (PropertyIsEqualTo) parse();
        assertNotNull(equalTo);

        assertNotNull(equalTo.getExpression1());
        assertNotNull(equalTo.getExpression2());
    }
View Full Code Here

        assertNotNull(equalTo.getExpression1());
        assertNotNull(equalTo.getExpression2());
    }

    public void testPropertyIsEqualToEncode() throws Exception {
        PropertyIsEqualTo equalTo = FilterMockData.propertyIsEqualTo();

        Document dom = encode(equalTo, OGC.PropertyIsEqualTo);
        assertEquals(1,
            dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyName.getLocalPart()).getLength());
        assertEquals(1,
View Full Code Here

    public void testEstimatedBoundsWithQuery() throws Exception {
        // enable fast bbox
        ((PostGISDialect) ((JDBCDataStore) dataStore).getSQLDialect()).setEstimatedExtentsEnabled(true);
       
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo filter = ff.equals(ff.property(aname("stringProperty")), ff.literal("one"));

        DefaultQuery query = new DefaultQuery();
        query.setFilter(filter);

        ReferencedEnvelope bounds = dataStore.getFeatureSource(tname("ft1")).getBounds(query);
View Full Code Here

        args[0] = filterFactory.literal(property);

        Function function = filterFactory.function("PropertyExists", args);
        Literal literalTrue = filterFactory.literal(Boolean.TRUE);
       
        PropertyIsEqualTo propExistsFilter = filterFactory.equals(function,
                literalTrue);

        return propExistsFilter;
    }
View Full Code Here

    Function function = filterFactory.function("relatePattern", args);

    assert function != null: "a relatePattern function is expected";

    PropertyIsEqualTo filter = ff.equals(function, ff.literal(true));

    return filter;
  }
View Full Code Here

    }

    private void testPropertyIsEqualDate(Filter f, Date expected) {
        Assert.assertTrue(f instanceof PropertyIsEqualTo);

        PropertyIsEqualTo eq = (PropertyIsEqualTo) f;
        Assert.assertTrue(eq.getExpression1() instanceof PropertyName);
        Assert.assertTrue(eq.getExpression2() instanceof Literal);
       
        Object o = eq.getExpression2().evaluate(null);
        Assert.assertTrue(o instanceof Date);
       
        Date d = (Date) o;
        Assert.assertEquals(expected, d);
    }
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.