Snapping Rules

Snapping rules are definitions that determine how snapping occurs for a certain layer. Snapping is mainly used in the editing of geometries. Let's start with an example:

 

<snappingRules>
	<snappingRule>
		<distance>20</distance>
		<layer>structures</layer>
		<type>2</type>
	</snappingRule>
</snappingRules>
Here we see the definition of 1 snapping rule. It has 3 tags:

 

  • distance : From what distance should snapping occur? This is expressed in units from the CRS of the layer.
  • layer : To what layer should snapping occur? The ID of the layer defined here, is a target layer to which snapping is done.
  • type : The choice of snapping algorithm.
    • 1 : Closest point; snaps only to corner points.
    • 2 : Nearest; snaps not only to corner points, but to any point on the edges as well.

If you wish to snap to multiple layers, then define multiple snapping rules.