Examples of bbox()


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

    private SimpleFeatureIterator squares(ReferencedEnvelope bounds, double size)
            throws IOException {

        // Limit squares to bounding box
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.bbox(ff.property(GEOM), bounds);

        // Align bound to square size and expand by 150%
        bounds = align(bounds, size, 1.6);

        // Create grid for given bounds
View Full Code Here

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

            // we cannot convert our request to the data CRS
            // so we cannot return any features
            ProjectPlugin.getPlugin().log(e);
            return null;
        }
        BBOX filter = filterFactory.bbox(geomAttributeName, layerBounds.getMinX(),
            layerBounds.getMinY(), layerBounds.getMaxX(), layerBounds.getMaxY(), srs);
        Query query=new DefaultQuery(schema.getName().getLocalPart(), filter);

        return source.getFeatures(query);
    }
View Full Code Here

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

        try {

            SimpleFeatureType schema = layer.getSchema();
            Name geom = getGeometryAttDescriptor(schema).getName();
           
            Filter bboxFilter =factory.bbox(factory.property(geom), boundingBox);
           

            return bboxFilter;
        } catch (Exception e) {
            ProjectPlugin.getPlugin().log(e);
View Full Code Here

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

        {
            if(filter.getExpression2() instanceof Literal && ((Literal) filter.getExpression2()).getValue() instanceof BoundingBox) {
                BoundingBox expr2 = (BoundingBox) ((Literal) filter.getExpression2()).getValue();

                FilterFactory2 factory = getFactory(extraData);
                return factory.bbox(factory.property(geomName), expr2);

            } else if(filter.getExpression2() instanceof Literal && ((Literal) filter.getExpression2()).getValue() instanceof Polygon) {
                Polygon expr2 = (Polygon) ((Literal) filter.getExpression2()).getValue();

                if (expr2.isRectangle()) {
View Full Code Here

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

            } else if(filter.getExpression2() instanceof Literal && ((Literal) filter.getExpression2()).getValue() instanceof Polygon) {
                Polygon expr2 = (Polygon) ((Literal) filter.getExpression2()).getValue();

                if (expr2.isRectangle()) {
                    FilterFactory2 factory = getFactory(extraData);
                    BBOX bbox = factory.bbox(factory.property(geomName), JTS.toEnvelope(expr2));

                    return bbox;
                } else {
                     return filter;
                }
View Full Code Here

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

                if( geometry2 instanceof Literal ){
                    Object literal = ((Literal) geometry2).getValue();
                    if( literal instanceof Geometry){
                        Geometry geometry = (Geometry) literal;
                        Envelope env = geometry.getEnvelopeInternal();
                        return factory.bbox(geometry1, env.getMinX(), env.getMinY(), env.getMaxX(), env.getMaxY(), null );
                    }
                }
                Disjoint disjoint = factory.disjoint(geometry1, geometry2);
                return factory.not( disjoint );
               
View Full Code Here

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

        File f = copyShapefiles("shapes/statepop.shp");
        ShapefileDataStoreFactory fac = new ShapefileDataStoreFactory();
        ShapefileDataStore ds = (ShapefileDataStore) createDataStore(fac, f.toURI().toURL(), true);
        Query q = new Query(ds.getTypeNames()[0]);
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        q.setFilter(ff.bbox("the_geom", -62, -61, 23, 22, null));
        assertEquals(0, ds.getFeatureSource().getFeatures(q).size());
        ds.dispose();
    }

    @Test
View Full Code Here

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

       
        // try with filter and no attributes
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        String geomName = schema.getGeometryDescriptor().getName().getLocalPart();
       
        query.setFilter( ff.bbox( ff.property(geomName), bounds) );
        features = featureSource.getFeatures( query );
       
        assertNotNull("selection query worked", features );
        assertTrue( "selection non empty", !features.isEmpty() );       
        assertEquals(selection.size(), features.size());
View Full Code Here

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

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Query q = new Query();
        q.setPropertyNames(new String[] {"STATE_NAME", "PERSONS"});
        ReferencedEnvelope queryBounds = new ReferencedEnvelope(-75.102613, -72.361859, 40.212597,
                41.512517, null);
        q.setFilter(ff.bbox(ff.property(""), queryBounds));
       
        // grab the features
        SimpleFeatureCollection fc = fs.getFeatures(q);
        assertTrue(fc.size() > 0);
        ds.dispose();
View Full Code Here

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

        SimpleFeatureIterator indexIter;
        FilterFactory2 fac = CommonFactoryFinder.getFilterFactory2(null);
        String geometryName = indexedDS.getSchema().getGeometryDescriptor()
                .getLocalName();

        Filter filter = fac.bbox(fac.property(geometryName), newBounds);

        features = indexedDS.getFeatureSource().getFeatures(filter);
        SimpleFeatureCollection features2 = baselineDS.getFeatureSource()
                .getFeatures(filter);
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.