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
>