Geographic Information Systems Asked by Vianney Bajart on May 22, 2021
I have implemented a custom digitizing tool derivated from QgsMapToolDigitizeFeature
class.
Here is the code written to save the feature into the layer:
layer.dataProvider().addFeatures([feature])
layer.commitChanges()
layer.triggerRepaint()
self.canvas().refresh()
A
. The feature A
is properly added to the layer.B
. The feature B
is properly added to the layer.A
vertices but not on B
.How to make the snapping work on newly created features?
Any ideas?
Just replacing:
layer.dataProvider().addFeatures([feature])
with:
layer.addFeature(feature)
solved my problem. Snapping works as expected now.
Answered by Vianney Bajart on May 22, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP