Monday, October 7, 2013

Edit line segments to snap to vertex nodes in Quantum GIS

I use QGIS to manage a linear network dataset for shortest path routing analysis. In order to perform the analysis, one of the requirements is to ensure that the line segments end points are snapped properly to the network nodes; if they are not snapped, then the routing would not be able to traverse pass the segment. There are tools in QGIS to help snap line segments to vertices, as illustrated below.

  1. In QGIS, load and display the line segments and point node layers, e.g. segments and stations.

    The layers are displayed.
  2. Select Settings | Snapping Options.

    The Snapping options dialog box appears.
  3. Toggle on the point nodes layer, e.g. stations. In the Tolerance field, type in a value which is reasonable for the dataset, e.g. 20 meters or 200 meters.

  4. Click OK.
  5. In the Layers pane, select the line segments layer. Then click the Select Single Feature icon. Click on the line segment to be snapped.

    The segment is highlighted.
  6. Press down the Toggle Editing icon.

    The vertex handles are displayed on the selected segment.
  7. Click the Node Tool icon. Click on the line segment.

    Red boxes appear around the vertex handles.
  8. Click on the line segment vertex that will be snapped to the node.

    A blue box appears around the vertex.
  9. Drag the blue vertex to the node.

    The line segment is snapped to the node.
  10. Press the Toggle Editing icon to end the editing.

    A prompt appears.
  11. Click Save.

    The changes are saved.

No comments: