Package org.opengis.filter.spatial

Examples of org.opengis.filter.spatial.BBOX


              double minx=addedBounds.getMinX();
        double miny=addedBounds.getMinY();
        double maxx=addedBounds.getMaxX();
        double maxy=addedBounds.getMaxY();
        String srs=CRS.lookupIdentifier(schema.getCoordinateReferenceSystem(), false);
        BBOX bboxFilter = fac.bbox(name, minx, miny, maxx, maxy, srs);
       
                query.setFilter(bboxFilter);
                FeatureCollection<SimpleFeatureType, SimpleFeature>  features = source.getFeatures(query);
                this.table.update(features);
            }
            // update modified features
            if( modifiedBounds!=null ){
              double minx=modifiedBounds.getMinX();
        double miny=modifiedBounds.getMinY();
        double maxx=modifiedBounds.getMaxX();
        double maxy=modifiedBounds.getMaxY();
        String srs=CRS.lookupIdentifier(schema.getCoordinateReferenceSystem(), false);
        BBOX bboxFilter = fac.bbox(name, minx, miny, maxx, maxy, srs);

                query.setFilter(bboxFilter);
                FeatureCollection<SimpleFeatureType, SimpleFeature>  features = source.getFeatures(query);
                this.table.update(features);
            }       
View Full Code Here


        SimpleFeature[] features = UDIGTestUtil.createDefaultTestFeatures("test", 1); //$NON-NLS-1$
        FilterFactory factory= CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        SimpleFeatureType featureType = features[0].getFeatureType();
        BoundingBox bounds = features[0].getBounds();
        CoordinateReferenceSystem crs= featureType.getCoordinateReferenceSystem();
    BBOX filter = factory.bbox(featureType.getGeometryDescriptor().getName().getLocalPart(), bounds.getMinX(),
            bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY(), CRS.lookupIdentifier(crs, false));
        cp.setContents(new Object[]{filter},new Transfer[]{UDigByteAndLocalTransfer.getInstance()});
        assertSame(filter, cp.getContents(UDigByteAndLocalTransfer.getInstance()));

//        cp.setContents(new Object[]{filter},new Transfer[]{FilterTextTransfer.getInstance()});
View Full Code Here

   
    SimpleFeatureType featureType = editLayer.getSchema();   
    String geomName = featureType.getGeometryDescriptor().getLocalName();
   
    PropertyName attributeExpr = ff.property(geomName);
    BBOX filter = ff.bbox(attributeExpr, bounds);
   
    FeatureSource<SimpleFeatureType, SimpleFeature> source = editLayer.getResource(FeatureSource.class, monitor);   
    return source.getFeatures(filter);
}
View Full Code Here

            // 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

    public FeatureIterator getSortedFeatures(GeometryDescriptor geom,
        ReferencedEnvelope latLongEnv, ReferencedEnvelope nativeEnv,
        Connection cacheConn) throws Exception {
        // build the bbox filter
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        BBOX filter = ff.bbox(geom.getLocalName(), nativeEnv.getMinX(),
                nativeEnv.getMinY(), nativeEnv.getMaxX(), nativeEnv.getMaxY(), null);

        // build an optimized query (only the necessary attributes
        DefaultQuery q = new DefaultQuery();
        q.setFilter(filter);
View Full Code Here

                if (reproject) {
                    aoi = aoi.transform(sourceCrs, true);
                }
              // apply filters.
                // 1) bbox filter
                BBOX bboxFilter = filterFactory.bbox(schema.getGeometryDescriptor().getLocalName(),
                        aoi.getMinX() , aoi.getMinY(), aoi.getMaxX(), aoi.getMaxY(), null);
                DefaultQuery q = new DefaultQuery(schema.getTypeName(), bboxFilter);
               
                String mapId = null;              
View Full Code Here

        FeatureSource fs = featureType.getFeatureSource(null, null);
       
        // build the bbox filter
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
       
        BBOX filter = ff.bbox(geom.getLocalName(), nativeEnv.getMinX(),
                nativeEnv.getMinY(), nativeEnv.getMaxX(), nativeEnv.getMaxY(), null);

        // build an optimized query (only the necessary attributes
        DefaultQuery q = new DefaultQuery();
        q.setFilter(filter);
View Full Code Here

        assertEquals(bbox, clone);
    }
   
    public void testBboxReproject() {
        // see if coordinates gets flipped, urn forces lat/lon interpretation
        BBOX bbox = ff.bbox(ff.property("geom"), 10, 15, 20, 25, "urn:x-ogc:def:crs:EPSG:6.11.2:4326");
        Filter clone = (Filter) bbox.accept(reprojector, null);
        assertNotSame(bbox, clone);
        BBOX clonedBbox = (BBOX) clone;
        assertEquals(bbox.getPropertyName(), clonedBbox.getPropertyName());
        assertTrue(15 == clonedBbox.getMinX());
        assertTrue(10 == clonedBbox.getMinY());
        assertTrue(25 == clonedBbox.getMaxX());
        assertTrue(20 == clonedBbox.getMaxY());
        assertEquals("EPSG:4326", clonedBbox.getSRS());
    }
View Full Code Here

        String wkt = "GEOGCS[\"WGS 84\", DATUM[\"World Geodetic System 1984\", SPHEROID[\"WGS 84\", 6378137.0, 298.257223563]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"degree\", 0.017453292519943295], AXIS[\"Geodetic longitude\", EAST], AXIS[\"Geodetic latitude\", NORTH]]";
        CoordinateReferenceSystem crs = CRS.parseWKT(wkt);
        SimpleFeatureType newFt = FeatureTypes.transform(ft, crs);
        reprojector = new ReprojectingFilterVisitor(ff, newFt);
       
        BBOX bbox = ff.bbox(ff.property("geom"), 10, 15, 20, 25, "urn:x-ogc:def:crs:EPSG:6.11.2:4326");
        Filter clone = (Filter) bbox.accept(reprojector, null);
        assertNotSame(bbox, clone);
        BBOX clonedBbox = (BBOX) clone;
        assertEquals(bbox.getPropertyName(), clonedBbox.getPropertyName());
        assertTrue(15 == clonedBbox.getMinX());
        assertTrue(10 == clonedBbox.getMinY());
        assertTrue(25 == clonedBbox.getMaxX());
        assertTrue(20 == clonedBbox.getMaxY());
        // the srs code cannot be found, but it's legal to use a WKT description instead
        CoordinateReferenceSystem reprojected = CRS.parseWKT(clonedBbox.getSRS());
        assertTrue(CRS.equalsIgnoreMetadata(crs, reprojected));
    }
View Full Code Here

        assertTrue(CRS.equalsIgnoreMetadata(crs, reprojected));
    }
   
    public void testBboxReprojectUnreferencedProperty() {
        // see if coordinates gets flipped, urn forces lat/lon interpretation
        BBOX bbox = ff.bbox(ff.property("line"), 10, 15, 20, 25, "urn:x-ogc:def:crs:EPSG:6.11.2:4326");
        Filter clone = (Filter) bbox.accept(reprojector, null);
        assertNotSame(bbox, clone);
        assertEquals(bbox, clone);
    }
View Full Code Here

TOP

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

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.