3

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()

enter image description here

asked May 25, 2021 at 11:10

1 Answer 1

5

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

answered May 25, 2021 at 11:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.