8 Viewing a Query to QGIS
You don’t have to save a query as a table to view it in QGIS. Sometimes you just want to see the results, but don’t need to keep a table that you might not need later. Let’s see the spatial join we just did in the QGIS map canvas:
- After you run the code to do the spatial join above, you will see a check box below the table that says Load as new layer. Click in the box to check it off. New options will appear.
- Check the box next to Column with unique values and select id from the list.
- Check the box next to Geometry column and select geom from the list.
- Fill in the Layer name (prefix) with “Flowlines in Watersheds”.
- Click the Load button. It may take it a few minutes to load because the flowlines layer is large.
Now you have access to the Layer Properties and all the other tools you might use with any other vector layer in QGIS. For fun, let’s style this layer:
- Open up the Layer Properties (right click on the layer in the Layers Panel and select Properties).
- Click on the Symbology tab.
- Instead of Single Symbol, let’s pick Categorized from the top drop-down menu.
- For the Column, pick Watershed_Name
- Click the Classify button near the bottom.
- Finally, click OK to close the dialog and apply our changes.