Examples of FeatureWriter


Examples of org.geotools.data.FeatureWriter

        tb.add( "g", Point.class );
        tb.add( "name", String.class );
       
        ds.createSchema( tb.buildFeatureType() );
       
        FeatureWriter fw = ds.getFeatureWriterAppend( "widgets", Transaction.AUTO_COMMIT );
        fw.hasNext();
        SimpleFeature sf = (SimpleFeature) fw.next();
        sf.setAttribute("g", new GeometryFactory().createPoint( new Coordinate(1,1)));
        sf.setAttribute( "name", "one");
        fw.write();
       
        fw.hasNext();
        sf = (SimpleFeature) fw.next();
        sf.setAttribute("g", new GeometryFactory().createPoint( new Coordinate(2,2)));
        sf.setAttribute( "name", "two");
        fw.write();
       
        fw.close();
        ds.dispose();
    }
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.