Spatial Analysis of Accessibility of Wells using Map Algebra
In this tutorial we'll apply map algebra to determine the accessibilty of wells. This tutorial was developed together with Kurt Menke (Bird's Eye View GIS).
7. Report the results
7.3. Style the Analysis Results
Now we can style the layers.
The first step in showing the results will be to style the wells_final data by whether the wells are accessible or not.
1. In the Layers panel click on the to open the Layer styling panel. Set wells_final as the target layer.
2. Change from a Single symbol to a Categorized renderer. Then set the Column to Accessible. Click Classify.
3.
When using this renderer QGIS will create a category to capture any
NULL values. Here there are no wells with NULL values in the Accessible column. Select the entry where the Value reads all other values and click the Delete
button to remove it. Give the wells with a value of 1 a green symbol
with a size of 4 mm. Give the wells with a value of zero a red color
with a size of 2 mm.
4. In the Legend column rename the entry with a Value of 1 to Accessible and the entry with a Value of zero to Inaccessible.
5. Scroll down in the Layer styling panel and find the Layer Rendering section. Expand it and select Draw effects. The Customize effects icon becomes active. Click on it to open the Effects properties panel. Here you can add Inner and Outer Glows, Drop Shadows, and other effects. Click the box next to Drop Shadow. Select the Drop Shadow effect so that you are seeing the parameters of the Drop Shadow. Reduce the Offset distance to 1.0 mm. Click the Go back button to return to the main styling panel.
6. Switch to the Labels tab of the Layer styling panel.
7. Change the setting from No labels to Single labels. Set the Label with column to welldepth.
You
will now use a labeling expression very similar to that used at the end
of the "Preparing Data from Hardcopy Maps" chapter where we labelled
the peaks. You will set the expression up so the labels read something
like: Well Depth: 76.4 m.
8. Click the Expression button to open the Expression Dialog window.
9.To begin, add the string Well Depth in front of the well depth value by adding 'Well Depth: '
before the existing expression.
10. To accomplish the second component you will use the format_number
function. Use the search box to find the format_number
function. Insert it right before the welldepth field. Remember, this function requires a number and a number of decimal places. The number will be the welldepth field and the number of places 2.
11. Use what you learned about the String Concatenation operator and the the New line operator to nicely format the label and add the units to the end.
12. Your expression should resemble 'Well Depth:'|| '\n' || format_number(welldepth,2) || ' m'
.
13. Set the Font to a sans serif font with a Size of 9 points.
14. Switch to the Placement tab and set the Placement to Offset from point. Select the lower right Quadrant placement with an Offset X Y setting of 1.5 mm each.
15. Finally click the Automated placement settings button to open the Automated Placement Engine window. Uncheck the box for Allow truncated labels on edges of map option. This will prevent labels from being cut off.
16. To complete the styling you will work with the dtm layer. Make this layer the target layer in the Layer styling panel. Click the drop-down for the Color ramp and choose Create new color ramp.
17. The Color ramp type window opens. Choose Catalog:cpt-city as the type. Click OK.
18. The Cpt-city Color Ramp window will open. Select the Topography category.
19. Choose sd-a and click OK.
Did you know that you can save this color ramp to your style library? To do this access the color ramp context menu and select Save color ramp. The Save New Color Ramp window will open allowing you to give it a Name and provide Tag(s).
20. Scroll down to the Layer Rendering section and set the Blending mode back to Normal.
21. Finally right-click on the dtm layer and choose Duplicate from the context menu.
22. Drag the dtm copy layer above the dtm layer and turn it on.
23. Make this duplicated dtm layer the target layer in the Layer styling panel. Change the renderer to Hillshade. Scroll down to the Layer Rendering section and set the Blending mode back to Multiply.