Examples of FeatureVisitor


Examples of org.opengis.feature.FeatureVisitor

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

Examples of org.opengis.feature.FeatureVisitor

        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

Examples of org.opengis.feature.FeatureVisitor

            // assertTrue("GenStreams".equals(typeName))
            // assertTrue(fCollection.size()==sortedCollection.size());

            final List<Long> catIds = new ArrayList<Long>();

            FeatureVisitor checkSortVisitor = new FeatureVisitor() {

                public void visit(Feature feature) {
                    SimpleFeature sf = (SimpleFeature) feature;
                    assertTrue(feature instanceof PreGeneralizedSimpleFeature);
                    long catid = (Long) sf.getAttribute("CAT_ID");
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

      * @param schema
      * @param list
      */
     public ListFeatureCollection(SimpleFeatureCollection copy ) throws IOException {
         this( copy.getSchema() );
         copy.accepts( new FeatureVisitor() {
      public void visit(Feature feature) {
        list.add( (SimpleFeature) feature );
      }
    }, null );
     }
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

        if ((collection == null) ) {
            throw new IllegalArgumentException("Provided SimpleFeatureCollection is empty");
        }
        synchronized (memory) {
            try {
                collection.accepts( new FeatureVisitor(){
                    public void visit(Feature feature) {
                        addFeatureInternal( (SimpleFeature) feature );
                    }               
                }, null );
            }
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

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

Examples of org.opengis.feature.FeatureVisitor

        PropertyName exp = ff.property("foo");
        Function standardDeviation = ff.function("StandardDeviation", exp, classes);
        assertNotNull( "step 1 - standard deviation function", standardDeviation );
       
        final Classifier classifer = standardDeviation.evaluate( featureCollection, Classifier.class );
        featureCollection.accepts( new FeatureVisitor() {
            @Override
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                Object value = feature.getAttribute("foo");
                assertNotNull( feature.getID()+" foo", value );
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

     * @return
     */
    public static Set<String> fidSet(FeatureCollection<?, ?> featureCollection) {
        final HashSet<String> fids = new HashSet<String>();
        try {
            featureCollection.accepts(new FeatureVisitor() {
                public void visit(Feature feature) {
                    fids.add(feature.getIdentifier().getID());
                }
            }, null);
        } catch (IOException ignore) {
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

        final String[] properties = { "cat", "str1", "the_geom" };
        final SimpleFeatureType featureType;
        featureType = getTypeView(featureName, schemaLocation, GEOS_ARCHSITES.CRS, properties);

        final FeatureVisitor assertor = new FeatureAssertor(featureType);

        URL url = TestData.getResource(this, GEOS_ARCHSITES.DATA);
        GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);

        int nof = parser.getNumberOfFeatures();
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

        final String[] properties = { "the_geom", "STATE_NAME", "STATE_FIPS", "SUB_REGION",
                "SAMP_POP" };
        final SimpleFeatureType featureType;
        featureType = getTypeView(featureName, schemaLocation, GEOS_STATES.CRS, properties);

        final FeatureVisitor assertor = new FeatureAssertor(featureType) {
            @Override
            public void visit(final Feature feature) {
                super.visit(feature);
                final String fid = feature.getIdentifier().getID();
                final int numPolygons;
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.