Package org.opengis.filter

Examples of org.opengis.filter.PropertyIsEqualTo.accept()


        ls.setUserData(CRS.decode("urn:x-ogc:def:crs:EPSG:6.11.2:4326"));
       
        // make sure a class cast does not occur, see: http://jira.codehaus.org/browse/GEOS-1860
        Function function = ff.function("geometryType", ff.property("geom"));
        PropertyIsEqualTo original = ff.equals(ff.literal("Point"), function);
        Filter clone = (Filter) original.accept(reprojector, null);
        assertNotSame(original, clone);
        assertEquals(original, clone);

        // try the opposite, literal and function
        original = ff.equals(function, ff.literal("Point"));
View Full Code Here


        assertNotSame(original, clone);
        assertEquals(original, clone);

        // try the opposite, literal and function
        original = ff.equals(function, ff.literal("Point"));
        clone = (Filter) original.accept(reprojector, null);
        assertNotSame(original, clone);
        assertEquals(original, clone);
    }
   
    public void testIntersectsWithFunction() throws Exception {
View Full Code Here

    @Test
    public void testCompareFilter() throws Exception {
        PropertyIsEqualTo complexFilter = ff.equal(ff.property("measurement/result"), ff
                .literal(1.1), true, MatchAction.ALL);

        Filter unrolled = (Filter) complexFilter.accept(visitor, null);
        assertNotNull(unrolled);
        assertTrue(unrolled instanceof PropertyIsEqualTo);
        assertNotSame(complexFilter, unrolled);
        assertTrue(((PropertyIsEqualTo) unrolled).isMatchingCase());
        assertEquals(MatchAction.ALL, ((PropertyIsEqualTo) unrolled).getMatchAction());
View Full Code Here

        PropertyIsEqualTo complexFilter = ff.equals(ff.property("gml:name"), ff
                .literal("SWADLINCOTE"));

        visitor = new UnmappingFilterVisitor(mapping);

        Filter unrolled = (Filter) complexFilter.accept(visitor, null);
        assertNotNull(unrolled);
        assertNotSame(complexFilter, unrolled);

        assertTrue(unrolled.getClass().getName(), unrolled instanceof org.opengis.filter.Or);
View Full Code Here

   
    @Test
    public void testBinaryComparison() {
        PropertyIsEqualTo equal = ff.equal(ff.property("a"), ff.property("b"), false);
        NullHandlingVisitor visitor = new NullHandlingVisitor();
        Filter result = (Filter) equal.accept(visitor, null);
        assertTrue(result instanceof And);
        Filter expected = ff.and(Arrays.asList(equal, propertyNotNull("a"), propertyNotNull("b")));
        assertEquals(expected, result);
       
        equal = ff.equal(ff.property("a"), ff.literal(10), false);
View Full Code Here

        assertTrue(result instanceof And);
        Filter expected = ff.and(Arrays.asList(equal, propertyNotNull("a"), propertyNotNull("b")));
        assertEquals(expected, result);
       
        equal = ff.equal(ff.property("a"), ff.literal(10), false);
        result = (Filter) equal.accept(visitor, null);
        assertTrue(result instanceof And);
        expected = ff.and(Arrays.asList(equal, propertyNotNull("a")));
        assertEquals(expected, result);
       
        equal = ff.equal(ff.literal(10), ff.property("b"), false);
View Full Code Here

        assertTrue(result instanceof And);
        expected = ff.and(Arrays.asList(equal, propertyNotNull("a")));
        assertEquals(expected, result);
       
        equal = ff.equal(ff.literal(10), ff.property("b"), false);
        result = (Filter) equal.accept(visitor, null);
        assertTrue(result instanceof And);
        expected = ff.and(Arrays.asList(equal, propertyNotNull("b")));
        assertEquals(expected, result);
       
        equal = ff.equal(ff.literal(10), ff.literal(20), false);
View Full Code Here

        assertTrue(result instanceof And);
        expected = ff.and(Arrays.asList(equal, propertyNotNull("b")));
        assertEquals(expected, result);
       
        equal = ff.equal(ff.literal(10), ff.literal(20), false);
        result = (Filter) equal.accept(visitor, null);
        assertEquals(equal, result);
    }
   
    @Test
    public void testNullableAttributes() {
View Full Code Here

   
    public void testCompareFunctionNull() {
        Function f = ff.function("env", ff.literal("var"));
        PropertyIsEqualTo filter = ff.equal(f, ff.literal("test"), false);
       
        Filter simplified = (Filter) filter.accept(visitor, null);
        assertEquals(Filter.EXCLUDE, simplified);
    }
   
    public void testCompareConstantFunction() {
        EnvFunction.setLocalValue("var", "test");
View Full Code Here

    public void testCompareConstantFunction() {
        EnvFunction.setLocalValue("var", "test");
        Function f = ff.function("env", ff.literal("var"));
        PropertyIsEqualTo filter = ff.equal(f, ff.literal("test"), false);
       
        Filter simplified = (Filter) filter.accept(visitor, null);
        assertEquals(Filter.INCLUDE, simplified);
    }
   
    public void testSimplifyStaticExclude()
    {
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.