Package org.geotools.data.simple

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


        }, null);
        // GenericEntity.f003=description-f003|<null>
        fid1 = ff.featureId("GenericEntity.f003");
        select = ff.id(Collections.singleton(fid1));
        featureCollection = table.getFeatures(select);
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                System.out.println(name);
                assertNull("represent null", name);
View Full Code Here


        }, null);
        // GenericEntity.f007=description-f007|
        fid1 = ff.featureId("GenericEntity.f007");
        select = ff.id(Collections.singleton(fid1));
        featureCollection = table.getFeatures(select);
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                assertEquals("represent empty string", "", name);
            }
View Full Code Here

        }, null);
        // "  GenericEntity.f009=description-f009| "
        fid1 = ff.featureId("GenericEntity.f009");
        select = ff.id(Collections.singleton(fid1));
        featureCollection = table.getFeatures(select);
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                assertEquals("represent empty string", " ", name);
            }
View Full Code Here

        }

        ValidationVisitor visitor = new ValidationVisitor();

        // Pass visitor and the progress bar to feature collection
        featureCollection.accepts(visitor, progress);
        return visitor.numInvalidGeometries;
    }
    // docs end validate

    /**
 
View Full Code Here

         //TEST classifier with everything in a single bin
         final Set<String>[] binValues2 = new Set[1];
         binValues2[0] = new HashSet<String>();
         //assign each of the features to one of the bins
         try {
      fc.accepts(new FeatureVisitor(){
        public void visit(Feature feature) {       
          binValues2[0].add(((SimpleFeature)feature).getAttribute(attribName).toString() );
         
        }}, null);
    } catch (IOException e) {
View Full Code Here

        
         //do a preliminary test to make sure each rule's filter returns some results    
         assertNotNull(StyleGenerator.toStyleExpression(rules.get(0).getFilter()));
         final Filter filter = rules.get(0).getFilter();
         try {
      fc.accepts(new FeatureVisitor(){

        public void visit(Feature feature) {
          if (!filter.evaluate(feature)){
            fail("Not all features accepted.");
          }
View Full Code Here

        // build the result feature collection
        final SimpleFeatureBuilder fb = new SimpleFeatureBuilder(targetSchema);
        final List<SimpleFeature> features = new ArrayList<SimpleFeature>();
        try {
            fc.accepts(new FeatureVisitor() {
               
                @Override
                public void visit(Feature feature) {
                    fb.init((SimpleFeature) feature);
                    SimpleFeature f = fb.buildFeature(feature.getIdentifier().getID());
View Full Code Here

        assertFalse( "selection non empty", features.isEmpty() );       
        assertTrue( "selection non empty", features.size() > 0 );
        ReferencedEnvelope bounds = features.getBounds();
       
        final Set<FeatureId> selection = new LinkedHashSet<FeatureId>();
        features.accepts( new FeatureVisitor() {
            public void visit(Feature feature) {
                selection.add( feature.getIdentifier() );
            }
        }, null );
        assertFalse( selection.isEmpty() );
View Full Code Here

   
    // graphExample start
    final LineGraphGenerator generator = new BasicLineGraphGenerator();
    SimpleFeatureCollection fc = featureSource.getFeatures();
   
    fc.accepts(new FeatureVisitor() {
        public void visit(Feature feature) {
            generator.add(feature);
        }
    }, null);
    Graph graph = generator.getGraph();
View Full Code Here

            andFil = ff.and(boundsCheck, polyCheck);
           
            try {
                fcResult = featureSource.getFeatures(andFil);
                // go through results and copy out the found features
                fcResult.accepts(new FeatureVisitor() {
                    public void visit(Feature feature) {
                        found.add((SimpleFeature) feature);
                    }
                }, null);
            } catch (IOException e1) {
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.