[Qgis-developer] Editing the geometry of a feature
Martin Dobias
wonder.sk at gmail.com
Wed Oct 24 18:20:35 EDT 2007
Hi Roger,
> The correct feature and geometry are referenced however for some reason the new position is lost before the feature is drawn to screen.
>
> I have also tried commitAttributeChanges(const std::set<QString>& deleted, ... ,std::map<QString,QString> >& changed); without success.
>
>
>
> Please tell me how I can change the position of a feature?
first, it seems that you're using qgis 0.8.x to do development... I
strongly advise you to use 0.9 for new development. Some parts of API
has been changed (improved).
second, what your code does is that it simply modifies the local copy
of geometry, it definitely will not change the geometry. To modify
geometry you should get layer's provider and call its
changeGeometryValues() function. Not all providers support
modifications of the geometries, to find out whether it's possible use
provider's capabilities() function in where ChangeGeometries flag must
be set.
cheers
Martin
More information about the Qgis-developer
mailing list