Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Writing Data in GeoServer WFS Data Store

Hi stefano,

I've just spent some time playing around with uDig 1.1 and Geoserver 1.4.M1 and all of these functions work perfectly (at least on the data types that I was testing with).  I should say that any Geoserver versions earler that 1.4.M1 is not recommended because there are a significant number of bugs that were fixed during August during my big WFS bug hunt.  In addition, only uDig 1.1.RC4 and later have had any significant amount of QA work done on WFS editing.

If you are using these same versions, please send me the information I requested in the other email and also send me the feature type definition you are using.

Best of luck,

Jesse


On 20-Sep-06, at 3:32 AM, Stefano wrote:

hi,

I've a problem:

I've written same procedures for edit (add, remove, modify) a feature using the metods

"FeatureStore:removeFeatures", "FeatureStore.modifyFeatures" and "FeatureStore.addFeatures".

If the data source is PostGis, the procedures work, but if the Data source is a GeoServer wfs

the procedure for add a feature generates an exception at line "featureStore.addFeatures(ftrCol)":

  "java.io.IOException: An error occured while committing"          

 

This is the code:

 
 

            public static final void AddFeature(FeatureSource featureSource) throws IllegalAttributeException, IOException{

                        FeatureType featureType = featureSource.getSchema();

                        Object values[] = new Object[featureType.getAttributeCount()];

                        Feature feature = featureType.create(values);

                        FeatureCollection ftrCol = FeatureCollections.newCollection();

                        ftrCol.add(feature);

                        FeatureStore  featureStore = (FeatureStore)featureSource;

                        featureStore.addFeatures(ftrCol);  // <-- Generate an IOException if the Data source is a GeoServer wfs

            }

 
 

Then I try the next code:

 
 

            public static final Feature AddFeature(FeatureSource featureSource) throws IllegalAttributeException, IOException{

                        FeatureType featureType = featureSource.getSchema();

                        FeatureStore  featureStore = (FeatureStore)featureSource;

                        FeatureWriter featureWriter = featureStore.getDataStore().getFeatureWriterAppend(featureType.getTypeName(), featureStore.getTransaction());

                        Feature feature = featureWriter.next();

                        featureWriter.write();

                        featureWriter.close();

                        return feature;

            }

 

It work if the Data Source is PostGis but don't work if the data source is a GeoServer wfs and generate

the next Exception at vhe call "getFeatureWriterAppend":

“java.lang.UnsupportedOperationException: Schema creation not supported"       

 
> http://lists.refractions.net/mailman/listinfo/udig-devel > > > > _______________________________________________ > User-friendly Desktop Internet GIS (uDig) > http://udig.refractions.net > http://lists.refractions.net/mailman/listinfo/udig-devel > > > ------------------------------------------------------------------------ > > _______________________________________________ > User-friendly Desktop Internet GIS (uDig) > http://udig.refractions.net > http://lists.refractions.net/mailman/listinfo/udig-devel >

Back to the top