On Tue, Apr 16, 2013 at 12:53 AM, Nathan Woodrow <[email protected]> wrote: > What would be the API calls in order to add a new feature to a layer and > commit the result?
layer.startEditing() layer.editBuffer().addFeature( feature ) layer.commitChanges() Anyway if someone wants to add a new feature permanently, it should be rather done this way: layer.dataProvider().addFeatures( [feature] ) It's more efficient and it does not mess with the editing state of the layer (imagine you are editing a layer and a plugin action will commit all your changes without asking!). Martin _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
