Package org.geotools.data.simple

Examples of org.geotools.data.simple.SimpleFeatureCollection.accepts()


           
            store.setTransaction( transaction );
           
            ProgressListener progessListener = GeoToolsAdapters.progress( SubMonitor.convert(monitor,"processing "+source.getName(), 90));         //$NON-NLS-1$

            output.accepts(new FeatureVisitor(){
                boolean warning = true;
                public void visit( Feature rawFeature ) {
                    SimpleFeature feature = (SimpleFeature) rawFeature;
                    String fid = feature.getID();
                   
View Full Code Here


           
            store.setTransaction( transaction );
           
            ProgressListener progessListener = GeoToolsAdapters.progress( SubMonitor.convert(monitor,"processing "+source.getName(), 90));         //$NON-NLS-1$

            output.accepts(new FeatureVisitor(){
                boolean warning = true;
                public void visit( Feature rawFeature ) {
                    SimpleFeature feature = (SimpleFeature) rawFeature;
                    String fid = feature.getID();
                   
View Full Code Here

        // is as expected.
        assertEquals(8, origional.getCount(Query.ALL));
        final SortedSet<String> allFids = new TreeSet<String>();
        SimpleFeatureCollection collection = origional.getFeatures();
        TestProgressListener progress = new TestProgressListener();
        collection.accepts(new FeatureVisitor() {
            public void visit(Feature feature) {
                allFids.add(feature.getIdentifier().getID());
            }
        }, progress);
        assertTrue("visitor completed", progress.completed);
View Full Code Here

        queryOneFeature.setPropertyNames(Query.ALL_NAMES);

        collection = featureStore1.getFeatures(queryOneFeature);
        progress.reset();
        final SortedSet<String> fids = new TreeSet<String>();
        collection.accepts(new FeatureVisitor() {
            public void visit(Feature feature) {
                fids.add(feature.getIdentifier().getID());
            }
        }, progress);
        assertTrue("visitor completed", progress.completed);
View Full Code Here

            // Creating a CoverageSliceCatalogSource and check if it behaves correctly
            CoverageSlicesCatalogSource src = new CoverageSlicesCatalogSource(sliceCat, "2");
            assertEquals(3, src.getCount(q));
            SimpleFeatureCollection coll = src.getGranules(q);
            cv.reset();
            coll.accepts(cv, null);
            assertEquals(3, cv.getCount());
            assertTrue(src.getBounds(q).contains(
                    referencedEnvelope.toBounds(referencedEnvelope.getCoordinateReferenceSystem())));
            assertEquals(src.getSchema(), schema);
View Full Code Here

     * @throws IOException
     */
    private void cleanupGranules(Query query, boolean checkForReferences, boolean deleteData) throws IOException {
        final SimpleFeatureCollection collection = granuleCatalog.getGranules(query);
        UniqueVisitor visitor = new UniqueVisitor(parentReader.locationAttributeName);
        collection.accepts(visitor, null);
        Set<String> features = visitor.getUnique();
        final String coverageName = query.getTypeName();

        for (String feature: features) {
            final URL rasterPath = pathType.resolvePath(DataUtilities.fileToURL(parentReader.parentDirectory).toString(), feature);
View Full Code Here

        for (String typeName : coverageNames) {
            if (!coverageName.equalsIgnoreCase(typeName)) {
                Query query = new Query(typeName);
                final SimpleFeatureCollection collection = granuleCatalog.getGranules(query);
                UniqueVisitor visitor = new UniqueVisitor(parentReader.locationAttributeName);
                collection.accepts(visitor, null);
                Set<String> features = visitor.getUnique();
                if (features.size() > 0) {
                    return true;
                }
            }
View Full Code Here

            for (Property prop: destProps) {
                destAttributes.add(prop.getName());
            }
           
            // Collecting granules
            originCollection.accepts( new AbstractFeatureVisitor(){
                public void visit( Feature feature ) {
                    if(feature instanceof SimpleFeature)
                    {
                            // get the feature
                            final SimpleFeature sourceFeature = (SimpleFeature) feature;
View Full Code Here

    public void testMultiLine() throws Exception {
        SimpleFeatureSource road = store.getFeatureSource("multiline");
        FeatureId fid1 = ff.featureId("fid1");
        Filter select = ff.id(Collections.singleton(fid1));
        SimpleFeatureCollection featureCollection = road.getFeatures(select);
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                assertEquals("jody \ngarnett", name);
            }
View Full Code Here

        SimpleFeatureSource table = store.getFeatureSource("table");
        // GenericEntity.f004=description-f004|name-f004
        FeatureId fid1 = ff.featureId("GenericEntity.f004");
        Filter select = ff.id(Collections.singleton(fid1));
        SimpleFeatureCollection featureCollection = table.getFeatures(select);
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                assertEquals("name-f004", name);
            }
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.