1

I would like to create a set of topology rules and use them over and over again. I would also like to be able to share them with my team. Is there a way to do this in QGIS? I'm using QGIS 3.0 but I can switch to earlier versions of necessary.

2 Answers 2

3

I assume it is the topology checker you are using. The topology rules are saved in the project. If you and your team have a template project, which you use, whenever you're starting a new project, then you will have the topology rules in your project from the beginning. I don't know of any way to save the rules and import them to an existing project.

1
  • This is perfect answer. Thank you. I will give it a try and may come back and edit question if I encounter errors or confirmed it worked Apr 21, 2018 at 17:51
2

QGIS files are text files, so it should be possible to copy topology checker rules from one QGIS file and paste them into another. Save a backup copy of the QGIS project file before attempting this.

Open the original QGIS file in a text editing program (such as Notepad) and find the lines of code between the tags Topol and /Topol. Here's what it looks like in Notepad++ enter image description here

Copy this entire section of code (including the tags) and paste it into the same location of the new QGIS file. Then update each layer_id as described below.

Each layer is referenced by its layer_id, which is unique and different in each project. So you'll need to replace each layer_id with the layer_id from the current project. You can find the new layer_id's in two ways:

  • With the new project open in your text program, search for the layer name enter image description here
  • Or, open the project in QGIS and go to Layer Properties | Variables enter image description here

As you can see, this is a rather involved process. In most cases it won't be any better than starting from a template project as suggested by Sigrid, or simply re-do the topology checker settings. But it may help at times when you have many different topology checker rules set up.

2
  • Thank you csk! What will the output of doing it like this look like? Will it be a table of errors? Apr 24, 2018 at 12:52
  • 1
    This just transfers the settings from the Topology Checker plugin from one project to another. There won't be any output until you run the Topology Checker, and then the output will be the same as it always is.
    – csk
    Apr 25, 2018 at 16:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.