Package org.opengis.filter.spatial

Examples of org.opengis.filter.spatial.Equals


    }

    @Test
    public void and() {
        PropertyIsNull nn = ff.isNull(ff.property("bar"));
        Equals eq = ff.equal(ff.property("foo"), ff.literal("john"));
        And and = ff.and(nn, eq);
    }
View Full Code Here


    }

    public void testEqualsParse() throws Exception {
        FilterMockData.equals(document, document);

        Equals equals = (Equals) parse();

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

    }

    public void testEqualsParse() throws Exception {
        FilterMockData.equals(document, document);

        Equals equals = (Equals) parse();

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

        // Test Equals
        PropertyName att = fac.property("testGeometry");
        GeometryFactory gf = new GeometryFactory(new PrecisionModel());
        Literal geom = fac.literal(gf.createLineString(coords));
       
        Equals filter = fac.equal(att, geom);
        assertAttributeName(filter, "testGeometry");

        filter = fac.equal(att, att);
        assertAttributeName(filter, "testGeometry");
View Full Code Here

        init("not-active");
        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        Polygon ls = gf.createPolygon(sf.create(new double[] { 3, 2, 6, 2, 6, 7, 3, 7, 3, 2 }, 2));
        Equals f = ff.equal(ff.property("geo"), ff.literal(ls));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(1, features.size());
        SimpleFeatureIterator fsi = features.features();
        assertTrue(fsi.hasNext());
        assertEquals(fsi.next().getID(), "not-active.13");
View Full Code Here

        // Test Equals
        PropertyName left = new AttributeExpressionImpl(testSchema, "testGeometry");
        GeometryFactory gf = new GeometryFactory(new PrecisionModel());
        LineString geom = gf.createLineString(coords);
        Literal right = new LiteralExpressionImpl(geom);
        Equals filter = fac.equal(left, right);

        LOGGER.finer( filter.toString());           
        LOGGER.finer( "contains feature: " + filter.evaluate(testFeature));
        assertTrue(filter.evaluate(testFeature));

        Function function = new GeometryFunction(geom);
        filter = fac.equal(left, function);
        LOGGER.finer( filter.toString());           
        LOGGER.finer( "contains feature: " + filter.evaluate(testFeature));
        assertTrue(filter.evaluate(testFeature));

        coords[0] = new Coordinate(0, 0);
        right = new LiteralExpressionImpl(geom);
        filter = fac.equal(left, right);

        LOGGER.finer( filter.toString());           
        LOGGER.finer( "contains feature: " + filter.evaluate(testFeature));
        assertFalse(filter.evaluate(testFeature));

        filter = fac.equal(left, new LiteralExpressionImpl(null));

        LOGGER.finer( filter.toString());           
        LOGGER.finer( "contains feature: " + filter.evaluate(testFeature));
        assertFalse(filter.evaluate(testFeature));
       
       
  }
View Full Code Here

    public void testEqualsFilter() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        // should match only "r3"
        GeometryFactory gf = new GeometryFactory();
        Geometry g = gf.createGeometry((Geometry) td.roadFeatures[2].getDefaultGeometry());
        Equals cs = ff.equal(ff.literal(g), ff.property(aname("geom")));
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(cs);
        checkSingleResult(features, "r3");
    }
View Full Code Here

TOP

Related Classes of org.opengis.filter.spatial.Equals

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.