Ingo Weinzierl wrote:
> Hi people,
>
> I have a problem with my FeatureWriter. I try to write some features from a 
> shape file to a geoserver (v. 1.0.0), using geotools 2.4 .
>   


> Here a part of my code:
>
>       WFSDataStoreFactory wfsStoreFactory = new WFSDataStoreFactory();
>         DataStore ds = wfsStoreFactory.createDataStore(params);
>         Transaction tx  = new DefaultTransaction();
>          FeatureWriter featureWriter =
>               ds.getFeatureWriterAppend("topp:USK_GF_ERGEBNIS", tx);
>
>
>        // Some other code
>
>
>       while( iterator.hasNext() ){
>               Feature feature = iterator.next();
>                 Feature wfsFeature = featureWriter.next(); 
>                    
>                 wfsFeature = feature;
>                 featureWriter.write();
>         }
>
> Following Exception is thrown:
>   
wfsFeature = feature does not do anything .... you need to grab your 
arguments from "feature" into an Object[], and then set that array into 
your wfsFeature.
> Somebody an idea how to solve that problem? Or another way to save features 
> on 
> a geoserver?
>   
You can use FeatureStore.addFetures( FeatureCollection ). You will find 
some of the demo code for a FOSS4G2006 does this.

Jody


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to