AW: [Qgis-developer] synchronization function suggestion

Hugentobler Marco marco.hugentobler at karto.baug.ethz.ch
Fri May 1 04:02:02 EDT 2009


Hi Maxim

I'm also in favour of such a function. To change attribute values, there is already a function in QgsVectorLayer. But to change geometries, there is no such function (as you pointed out).
My suggestion is to call the function changeGeometry and to pass feature id and geometry as arguments, since the function does not do anything with attributes:

bool QgsVectorLayer::changeGeometry(int featureId, QgsGeometry* geom)

Regards,
Marco




-----Ursprüngliche Nachricht-----
Von: qgis-developer-bounces at lists.osgeo.org im Auftrag von Maxim Dubinin
Gesendet: Do 30.04.2009 21:55
An: qgis-developer
Betreff: [Qgis-developer] synchronization function suggestion
 
Hi all,

Sometime ago we were stuggling with editing features within a layer. I'm not
talking about QgsVectorLayer methods that are already implemented and working fine,
but other basic geometry editing functions, that sometimes
require to store results in the same layer. Like clip, buffer etc.

The main problem is that, while methods that are already in API are
able to do that (lets take moveVertex for example), new ones should
work around to reflect changes without comitting.

So we want to propose to add a generic function to synchronize changed
geometries. This function might be useful for future
API extension or plugins, that will add functionality to work on
geometries within a layer. Something like:

bool QgsVectorLayer::updateFeature(QgsFeature &feat)
{
  mChangedGeometries[feat.id()]=*feat.geometry();
  setModified( true, true );
  return true;
}


Any thoughts?

Maxim

PS: this is from a conversation with our developer, so I might have
misinterpreted something, but it seems logical to me. We can work on
the implementation, if there are no objections.



_______________________________________________
Qgis-developer mailing list
Qgis-developer at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



More information about the Qgis-developer mailing list