Is there a way to enable or disable topological editing with python in QGIS? I'm trying to set a bunch of rules, one of them being the editing, when starting up a project, but I can't seem to find how to enable this. For that matter, there's even no
iface.SnapppingToolBar()
1 Answer 1
You can do the following to enable snapping and then topological editing (it happens at QgsProject
level):
new_conf = QgsSnappingConfig(QgsProject.instance().snappingConfig())
new_conf.setEnabled(True)
QgsProject.instance().setSnappingConfig(new_conf)
QgsProject.instance().setTopologicalEditing(True)
You may also look at this related question How to enable/disable snapping functionality with PyQGIS? that mention QgsSnappingUtils
class to ease manipulation of snapping editing configuration