Package org.geotools.feature.simple

Examples of org.geotools.feature.simple.SimpleFeatureBuilder.buildFeature()


        try {
            // create a feature to add
            SimpleFeatureBuilder builder = new SimpleFeatureBuilder(schema);
            builder.set("INT32_COL", Integer.valueOf(1000));
            builder.set("STRING_COL", "inside transaction");
            SimpleFeature feature = builder.buildFeature(null);

            // add the feature
            transFs.addFeatures(DataUtilities.collection(feature));

            // now confirm for that transaction the feature is fetched, and outside
View Full Code Here


        builder.add("theDescription");
        builder.add(GML3MockData.point());
        builder.add(null);
        builder.add(null);

        SimpleFeature feature = (SimpleFeature) builder.buildFeature("fid.1");
       
        TestConfiguration configuration  = new TestConfiguration();
        Encoder encoder = new Encoder( configuration );
        Document dom = encoder.encodeAsDOM(feature, TEST.TestFeature);
        NodeList countList = dom.getElementsByTagName("test:count");
View Full Code Here

            fbuilder.add("watersample." + i);
            fbuilder.add(new Integer(i));
            fbuilder.add(new Integer(10 + i));
            fbuilder.add(new Float(i));

            SimpleFeature f = fbuilder.buildFeature(fid);
            dataStore.addFeature(f);
        }
        return dataStore;
    }
}
View Full Code Here

        GeometryFactory gf = JTSFactoryFinder.getGeometryFactory();

        SimpleFeatureBuilder fb = new SimpleFeatureBuilder(featureType);
        fb.set("the_geom", gf.createPoint(new Coordinate(10, 10)));
        fb.set("name", "The name");
        feature = fb.buildFeature(null);
       
        File shpFile = new File("./target/screenMapTest/"
                + feature.getFeatureType().getName().getLocalPart() + ".shp");
        shpFile.getParentFile().mkdirs();
View Full Code Here

        for (int i = 0; i < natt; i++) {
            builder.add(unmarshallSimpleAttribute(s));
        }
        //return builder.feature(fid);
        return builder.buildFeature(fid);
    }
   
    /*
     * Looks up a feature builder from the builder cache; if not found then
     * it will create a new one and add it to the cache.
View Full Code Here

        final SimpleFeatureTypeBuilder featureTypeBuilder = new SimpleFeatureTypeBuilder();
        featureTypeBuilder.setName("runtimeT");
        featureTypeBuilder.add("updated", Date.class);
        SimpleFeatureType featureType = featureTypeBuilder.buildFeatureType();
        SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(featureType);
        SimpleFeature feature = featureBuilder.buildFeature("0");
        collector.collect(file);
        collector.setProperties(feature);
        Date date = (Date) feature.getAttribute("updated");
        assertEquals(lastModified, date.getTime());
    }
View Full Code Here

        DefaultFeatureCollection features = new DefaultFeatureCollection();
       
        sb.add( "one" );
        sb.add( "the first feature");
        sb.add( gf.createPoint( new Coordinate(1, 1) ) ) ;
        features.add( sb.buildFeature("1"));
       
        sb.add( "two" );
        sb.add( "the second feature");
        sb.add( gf.createPoint( new Coordinate(2, 2) ) ) ;
        features.add( sb.buildFeature("2"));
View Full Code Here

        features.add( sb.buildFeature("1"));
       
        sb.add( "two" );
        sb.add( "the second feature");
        sb.add( gf.createPoint( new Coordinate(2, 2) ) ) ;
        features.add( sb.buildFeature("2"));
       
        Encoder encoder = new Encoder(new KMLConfiguration());
        encoder.setIndenting(true);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        encoder.encode(features, KML.kml, out );
View Full Code Here

        ArrayList features = new ArrayList();
       
        sb.add( "one" );
        sb.add( "the first feature");
        sb.add( gf.createPoint( new Coordinate(1, 1) ) ) ;
        features.add( sb.buildFeature("1"));
       
        sb.add( "two" );
        sb.add( "the second feature");
        sb.add( gf.createPoint( new Coordinate(2, 2) ) ) ;
        features.add( sb.buildFeature("2"));
View Full Code Here

        features.add( sb.buildFeature("1"));
       
        sb.add( "two" );
        sb.add( "the second feature");
        sb.add( gf.createPoint( new Coordinate(2, 2) ) ) ;
        features.add( sb.buildFeature("2"));
       
        sb = new SimpleFeatureBuilder(DocumentTypeBinding.FeatureType);
        sb.set( "Feature", features );
        SimpleFeature f = sb.buildFeature("kml");
       
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.