Package org.opengis.filter

Examples of org.opengis.filter.FilterFactory2.equal()


    private org.opengis.filter.Filter createGeometryTypeFilter( String geomName, String type )
            throws IllegalFilterException {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Function function = ff.function("geometryType", ff.property(geomName));
        return ff.equal(function, ff.literal(type)); //$NON-NLS-1$
    }

    private boolean writeToShapefile(SimpleFeatureCollection fc, SimpleFeatureType type, File file ) throws IOException {
       
        if (!canWrite(file)) {
View Full Code Here


                Expression geometry2 = (Expression) value[1].getValue();

                // GeometryFilter filter = factory.createGeometryFilter( type );
                switch (type) {
                case FilterType.GEOMETRY_EQUALS:
                    return factory.equal(geometry1, geometry2);

                case FilterType.GEOMETRY_DISJOINT:
                    return factory.disjoint(geometry1, geometry2);

                case FilterType.GEOMETRY_INTERSECTS:
View Full Code Here

                                                ff.literal(range.getMinValue()))
                                ));
                    else {
                        // SINGLE value
                        filters.add(
                                ff.equal(
                                        ff.property(propertyName),
                                        ff.literal(value),true)
                                    );
                    }
                } else { //domainType == DomainType.RANGE
View Full Code Here

                        + "FROM \"road\" "
                        + "WHERE \"name\" = 'XXX')");

        // the filter for the Query
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.equal(ff.property("name"), ff.literal("XXX"), true);

        SimpleFeatureType roadSchema = dataStore.getSchema("road");
        dialect.handleSelectHints(sql, roadSchema, new Query("road", filter));

        assertFalse(sql.toString().contains("WITH"));
View Full Code Here

                "SELECT \"fid\",\"id\",\"geom\".STAsBinary() as \"geom\",\"name\" "
                        + "FROM \"road\" " + "WHERE \"name\" = 'XXX')");

        // the filter for the Query
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.equal(ff.property("name"), ff.literal("XXX"), true);

        SimpleFeatureType roadSchema = dataStore.getSchema("road");
        dialect.handleSelectHints(sql, roadSchema, new Query("road", filter));

        assertTrue(sql.toString().contains("WITH(NOLOCK)"));
View Full Code Here

                        + "FROM \"schema\".\"road\" "
                        + "WHERE \"name\" = 'XXX')");

        // the filter for the Query
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.equal(ff.property("name"), ff.literal("XXX"), true);

        SimpleFeatureType roadSchema = dataStore.getSchema("road");
        originalSchema = dataStore.getDatabaseSchema();
        dataStore.setDatabaseSchema("schema");
        dialect.handleSelectHints(sql, roadSchema, new Query("road", filter));
View Full Code Here

        Expression property = this.resultStack.popExpression();

        FilterFactory2 ff = (FilterFactory2) filterFactory; // TODO this cast must be removed. It depends of Geometry implementation

        return ff.equal(property, geom);
    }
    public BinarySpatialOperator buildSpatialDisjointFilter() throws CQLException {
        Literal geom = this.resultStack.popLiteral();

        Expression property = this.resultStack.popExpression();
View Full Code Here

                System.out.println();
            }
            if (ed.getName().contains("qed"))
                continue;
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
            Filter filter = ff.equal(ff.property("CITY"), ff.literal("Trento"), true);
            Query query = new Query("locations", filter);
            fts = source.getFeatures(query);
            System.out.println(fts.size());
            System.out.println(fts.features().next());
        }
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
    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));
    }

    @Test
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.