Skip to content

Instantly share code, notes, and snippets.

@CEZERT
Created September 30, 2021 13:49
Show Gist options
  • Save CEZERT/59f69acd556f97d169fd10073807f37e to your computer and use it in GitHub Desktop.
Save CEZERT/59f69acd556f97d169fd10073807f37e to your computer and use it in GitHub Desktop.
layer = iface.activeLayer()
features = layer.getFeatures()
newFeature = QgsFeature(layer.fields())
newFeature["ID_POINT_D"]=20084
pt = QgsGeometry().fromPointXY(QgsPointXY(2.272507912597,51.020400936747))
newFeature.setGeometry(pt)
layer.startEditing()
layer.addFeature(newFeature)
'''
layer.commitChanges()
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment