[Qgis-developer] featureAdded(QgsFeatureId) signal

Paolo Corti pcorti at gmail.com
Fri Nov 29 01:45:35 PST 2013


On Fri, Nov 29, 2013 at 9:01 AM, Denis Rouzaud <denis.rouzaud at gmail.com> wrote:
> Hi Paolo,
>
> In your code you update the geometry in the provider.
> You should not do this since the feature is not there yet, it's still in the
> edit session (edit buffer).
>
> There is two ways to do this: either work totally in the buffer or totally
> in the provider.
> There is an agreement that working in the provider in plugins should be
> avoided. Moreover, if I understand correctly your workflow working with the
> buffer seems more appropriate.
>
> Then, you should use
> layer.changeGeometry(fid, geom) instead of
> layer.dataProvider().changeGeometries(...)
>
> Hope it helps a bit,
>

Thanks Denis
that was, now it works perfectly :)
and yes, working in the buffer is more appropriate, as I want to
manage the user edits within a standard QGIS edit session.
I should have read more carefully the documentation.
cheers
p

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti


More information about the Qgis-developer mailing list