Created
October 7, 2011 11:32
-
-
Save NathanW2/1270106 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mapC = qgis.utils.iface.mapCanvas() | |
layer = mapC.currentLayer() | |
provider = layer.dataProvider() | |
feat = QgsFeature() | |
provider.nextFeature(feat) | |
myGeom = QgsGeometry( feat.geometry() ) | |
layer.startEditing() | |
while provider.nextFeature(feat): | |
feat.setGeom(myGeom) | |
layer.updateFeature(feat) | |
layer.commitChanges() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
diff --git a/python/core/qgsvectorlayer.sip b/python/core/qgsvectorlayer.sip
index 98eee7e..28b94ff 100644
--- a/python/core/qgsvectorlayer.sip
+++ b/python/core/qgsvectorlayer.sip
@@ -272,10 +272,17 @@ public:
bool featureAtId(int featureId, QgsFeature& f, bool fetchGeometries = true, bool fetchAttributes = true);
/** Adds a feature
@return True in case of success and False in case of error
*/
bool addFeature(QgsFeature& f, bool alsoUpdateExtent = TRUE);
+
/** Insert a new vertex before the given vertex number,
diff --git a/src/core/qgsvectorlayer.cpp b/src/core/qgsvectorlayer.cpp
index 42683c5..bc8fb74 100644
--- a/src/core/qgsvectorlayer.cpp
+++ b/src/core/qgsvectorlayer.cpp
@@ -1947,6 +1947,42 @@ bool QgsVectorLayer::addFeature( QgsFeature& f, bool alsoUpdateExtent )
return true;
}
+bool QgsVectorLayer::updateFeature( QgsFeature &f )
+{
+}
bool QgsVectorLayer::insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex )
{
diff --git a/src/core/qgsvectorlayer.h b/src/core/qgsvectorlayer.h
index 0db953b..4fc740c 100644
--- a/src/core/qgsvectorlayer.h
+++ b/src/core/qgsvectorlayer.h
@@ -351,6 +351,11 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
*/
bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
/** Insert a new vertex before the given vertex number,