Lab 08 - Map making

This lab is a gratefully modified version of lab 7 from Bradley A. Shellito’s Introduction to Geospatial Technologies 529

Learning Objective

This lab introduces you to the concept of using GIS data to create a print quality map. This map should contain the following:

  • The population per square kilometer for all counties in California, set up in an appropriate color scheme
  • The data displayed in a projection with units of measurement other than decimal degrees (The default units used by the lab data are meters; make sure the scale bar reflects this information.)
  • An appropriate legend (Make sure your legend items have regular names and that the legend is not called “legend.”)
  • An appropriate title (Make sure your map title doesn’t include the word “map” in it.)
  • A north arrow
  • A scale bar
  • Text information: your name, the date, and the sources of the data
  • Appropriate borders, colors, and design layout (Your map should be well designed and should not look as if the map elements were thrown together randomly.) The goals for you to take away from this lab:
  • Familiarize yourself with the Map Layout functions of QGIS
  • Arrange and print professional-quality maps from geographic data using the various layout elements

Outline:

Submission requirements

Materials (click to download)

Data Name Description
GEOG111_Lab2Questions.docx Handout to turn in

Tutorial

Initial Pre-Mapping Tasks in QGIS

If needed, refer to Geospatial Lab Application 5.1: GIS Introduction: QGIS Version for specifics on how to do the following.

  1. Start QGIS.
  2. Add the CalBounds feature class from the CalMap geodatabase in the C:\Chapter7QGIS folder to the Layers panel. Leave the CalBounds layer’s symbology alone for now; you’ll change it in the next step.
  3. Pan and zoom the Map View so that all of California fills up the Map View.

Important note: The data used in this Geospatial Lab Application has already been projected to the U.S. National Atlas Equal Area projection for you to use. However, there are many more projections to choose from if you desire; you can change the projection of a data layer by right-clicking on it, selecting Export then Save Features As, and then choosing a projected coordinate system in which to change the layer.

  1. Set the properties of the project you’re working with so that QGIS will be able to render some of the map elements you’ll be working with (such as the scale bar) properly. From the Project pull-down menu, choose Properties.
  2. Select the CRS tab.
  3. In the box next to Filter, type US National Atlas Equal Area to search through all available projections and find the one you need.
  4. Under Coordinate reference systems of the world, click on the US National Atlas Equal Area option and then click Apply. You have now set the CRS of the project environment to the chosen projection. Click OK to close the dialog box.

imcenter

Setting Graduated Symbology in QGIS

  1. QGIS enables you to change a feature’s symbology from a single symbol to multiple symbols or colors and allows for a variety of different data classification methods.
  2. Right-click on CalBounds in the Map Legend and select Properties. Click on the Symbology tab. To display the states as graduated symbols, use the following settings (and leave all the other settings alone):
    1. From the pull-down menu to the top of the menu, select Graduated.
    2. For Column, select PopDens (each county’s population per square kilometer from the year 2010).
    3. Use 5 for the number of classes.
    4. Use Quantile (Equal Count) for the mode.
    5. For the color ramp options, use the pull-down menu to select an appropriate choice.
  3. When you have things arranged as you want them, click Apply to make the changes. Take a look at the map and make any further color changes you think are needed.
  4. Click OK to close the dialog box.

imcenter

  1. The symbology of CalBounds has changed in the Map View, and the values that make up each of the breaks can be seen in the Layers panel. If the breaks and classes are not already displayed, you can show them by clicking the black arrow button to the left of the CalBounds layer in the Layers panel.

The Map Layout in QGIS

To begin laying out the print-quality version of the map, you need to begin working in the Map Layout (also known as the Map Composer). This mode of QGIS works like a blank canvas, allowing you to construct a map using various elements.

  1. To begin, from the Project pull-down menu choose New Print Layout.
  2. Before the Map Layout opens, you are prompted to give your layout a title. Type in a descriptive title, such as California Population Density 2010 or something similar. Click OK after you’ve entered the title.
  3. A new window, the Map Layout, opens. In the Map Layout, the screen represents the printed page of an 8½ × 11 piece of paper, so be careful when you’re working near the edges of the page and keep all elements of the map within that border.
  4. The layout has several toolbars horizontally across its top, with a new set of tools; locate and examine these navigation tools. (Note: Any of the toolbars can be turned on and off by choosing the View pull-down menu, choosing Toolbars, and placing a checkmark in the appropriate box. This section refers to the Layout, Navigation, and Actions toolbars.)
  5. Starting at the left and moving right, the tools and their uses are as follows:
    1. The blue disk is used to save a layout.
    2. The white paper creates a new layout.
    3. The white paper over the gray paper is used to create a duplicate layout.
    4. The white paper with the wrench opens the Layout Manager.
    5. The yellow folder allows you to add a template to the layout.
    6. The blue disk with the green bar allows you to save a template.
    7. The printer icon is used when you’re printing (see later in the lab).h. The next three icons allow you to export your layout to either (1) an image, (2) SVG format, or (3) PDF format.
    8. The two curved arrows allow you to either undo to the last change you made or redo the last change you made (which is useful when you need to back up a step in your map design). The second row of tools is as follows:
    9. The plus and minus magnifying glasses are used to zoom in and out of the layout.
    10. The magnifying glass with the 1:1 text zooms the map to 100%.
    11. The magnifying glass with three arrows zooms to the full extent.
    12. The twin curved blue lines icon are used to refresh the view.
    13. The lock and unlock icons allow you to fix items in place in the layout (lock) or remove this fix so they can be moved (unlock).
    14. The square and circle icons allow you to gather up several items and treat them as a single group (group items) or to turn a group of items back into individual items (ungroup).
    15. The last four icons with the blue and yellow boxes are used for raising, aligning, distributing, or resizing map elements to better fit into the layout.
  6. The vertical toolbar down the left-hand side of the screen is the Toolbox toolbar, and it provides additional tools:

imcenter

1. The hand is used for panning and adjusting the content of a particular window—for instance, for moving the position of what’s showing on the map without changing the map itself.
2. The magnifying glass is used to zoom in on elements on the map.
3. The cursor pointing to the box is used to move map elements to different places in the layout.
4. The icon with the blue arrows on a piece of paper is used to move the content of items.
5. The icon with the hammer and the three blue points joined together is used for editing nodes.
6. The other tools are used to add map elements to the layout, and you’ll use them later in the lab. You can use these icons to add a new map, an image, a new label, a new legend, and a new scale bar, as well as shapes, nodes, and arrow shapes for annotating the map, the attribute table of a layer, and an HTML frame for displaying Web content.

Choosing Landscape or Portrait Mode in QGIS

  1. Before going any further with your map, you have to choose whether the map should be oriented in portrait or landscape mode. Portrait mode aligns the layout vertically (so that it’s longer than it is wide), while landscape mode aligns the layout horizontally (so that it’s wider than it is long). If you were mapping the United States, you’d likely choose landscape mode to place the entire country so it filled the page. However, when mapping California, you’d likely use portrait mode as it better fits the dimension of the state. To select whether you want to use portrait or landscape, right-click on the layout itself (the big blank white area) and from the pop-up menu that appears, choose Page properties.

imcenter

  1. A new set of tabs appear on the right-hand side of the screen. Click on the Item Properties tab.
  2. Under Page Size, next to Orientation, choose Portrait. You see the layout shift to the vertically oriented Portrait mode. By selecting Landscape or Portrait from this option, you can change the orientation of the printed map.

Map Elements in QGIS

  1. Again, think of the layout (or composition) as a blank sheet of paper that you can use to construct a map. Numerous map elements can be added, including the map canvas, scale bars, north arrows, and a legend. In the Items tab on the right-hand side of the layout, you can see a list of the elements you have added to the layout. When you choose an element in this Items tab, it is also chosen on the layout. You can also turn on an element by placing a checkmark in the box next to its name in the Items tab, and you can turn off an element by removing the checkmark next to it.
  2. Each element has properties (such as borders, fill colors, and size and position) that can be accessed by choosing the Item Properties tab on the right-hand side of the layout.
  3. You can move and resize elements by selecting them with the mouse and resizing as you would any other object.
  4. You can delete map elements by selecting them and pressing the Delete key on the keyboard.

Placing a Map into the Layout in QGIS

  1. The first element to add to the layout is the default map—in this case, an element that shows all the visible layers in the Map Legend.
  2. Click on the Add New Map icon in the vertical Toolbox toolbar. You can then draw a box on the layout to display the current Map View. Draw a rectangular box on the layout to create the canvas.
  3. You can click and drag the canvas around the map or resize it as you see fit (using the four blue tabs at its corners), and you can treat the entire canvas as if it’s a single map element. Keep in mind that you’ll be adding several more map elements (such as a legend or a title) and adjust the size, spacing, and balance of the elements accordingly.
  4. You can’t manipulate individual layers (for instance, you can’t click and drag a particular county somewhere else), but by using the Move Item Content icon on the vertical toolbar, you can drag the contents of the map around and alter what’s displayed inside the canvas.
  5. To make further adjustments to the map (such as creating a border or altering the color of the border), select the Item Properties tab on the right side of the screen and scroll down to see what choices are available (such as expanding the Frame option to change the appearance of the map’s border or the Background option to change the fill color of the map). Investigate the other choices under Item Properties (such as the options under Main Properties for adjusting the scale of the layers being displayed on the map) to set up the canvas the way you’d like it to appear in the final printed layout.

Placing a Scale Bar into the Layout in QGIS

  1. To add a scale bar to the map, select the Add New Scalebar icon on the toolbar and draw a box on the layout where you want the scale bar to be added.
  2. When the scale bar appears, click on it so that the four blue boxes appear at the corners. In the Item Properties box on the right-hand side of the screen, you can see several options for altering the scale bar. Use the options to change the following properties of the scale bar until it looks appropriate:
    1. The number of segments on the left or the right side of the 0 value on the scale bar
    2. The size of each segment
    3. The number of map units per bar units (to even out the breakpoints on the scale bar)
    4. The physical dimensions of the scale bar (height, line, width, etc.)
    5. The font and color used

imcenter

Placing a North Arrow into the Layout in QGIS

  1. To add a north arrow to the map, select the Add Picture icon from the toolbar and draw a box on the layout where you want the north arrow to be added and draw a box the size that you want to north arrow symbol to be.
  2. An empty box and several different graphics options appear in the Item Properties tab. The Add Picture option allows you to add a graphic of your own to the map or to select from several pre-made graphics, including several different north arrows. Expand the options under Search Directories and scroll partway down, and you see a number of options for north arrows.

imcenter

  1. Select an appropriate north arrow, and it appears in the empty box on the layout. Use the cursor to position or resize the north arrow.

Placing a Legend into the Layout in QGIS

Each layer you use in QGIS (such as CalBounds) has a set of layer properties. Anything changed in the layer properties is reflected in changes to the layout. For instance, if you change the symbology of a layer in its properties, its appearance is transferred to a legend in the layout. Similarly, whatever name is given to a layer in the Map Legend carries over to a legend in the layout.

  1. Return to the regular QGIS window. Currently, the CalBounds layer is named “CalBounds.” However, you can change this name to something more descriptive before adding a legend to the layout. In the QGIS Layers panel, right-click on the name you want to change, CalBounds, and select Rename Layer.
  2. In the Layers panel, you can type a new name for the layer (for example, Population per Square Km) and press the Enter key.
  3. Return to the layout. To add a legend to the map, click the Add New Legend icon on the toolbar and draw a box on the layout where you want the legend to be added.
  4. A default legend is added to the map, consisting of all the layers in the Map Legend with whatever names are assigned to them. Use the cursor to move and resize the legend as needed.
  5. To make changes to the default legend, click on the legend itself, and you see several options available in the Item Properties tab. You can change the name of the legend (don’t just call it “Legend”), its font, symbol width, and appearance, as well as the spacing between items.

imcenter

Adding Text to the Layout in QGIS

  1. To add text to the map (such as a title or any other text you might want to add), select the Add New Label icon from the toolbar and then draw a box on the layout where you want the text to be added of the size you want the text to be.
  2. Note that when text is added, a small box filled with the words “Lorem ipsum” (which is standard placeholder text) will be added to the layout. The lettering in the box, as well as its font, size, and color, can be changed in the Item Properties tab.
  3. In the Item Properties tab, under the Label heading, type the text you want to appear in the text box on the map. To alter the font, color, and other properties of the text, click the Font and Font Color drop-downs and choose from the available options. Note that you can alter each text box separately, create larger fonts for titles and smaller fonts for type, and so on. You can also resize each text box and move it to a new position.

Other Map Elements in QGIS

  1. Though they’re not used in this lab, other map elements can be added, including:
    1. A shape: You can add the outline of a shape (an ellipse, a rectangle, or a triangle) to the layout for additional graphics or annotation. Use the Add Ellipse icon to do this.
    2. An arrow: You can add a graphic of an arrow (not a north arrow) so that you can point out or highlight areas to add further annotation to your layout. Use the Add Arrow icon to do this.
    3. An attribute table: You can add a graphic of a layer’s attribute table to the map to enable the presentation of additional information. Use the Add Attribute Table icon to do this.
    4. An HTML frame: You can add a frame that will contain a Web page or other Web content. In the Item Properties tab, you can specify the URL for what you want to display inside the frame. Use the Add HTML Frame icon to do this.

Printing the Layout in QGIS

  1. When you have constructed the map the way you want it, choose the Layout pull-down menu, select Page Setup, and specify whether you want the map printed in landscape or portrait format and, if desired, add margins for printing.
  2. When the layout is ready, select the Print icon from the toolbar.
  3. In the Print dialog box, click Print, and QGIS prints to your computer’s default printer.
  4. If you want to convert the layout to a digital format instead of printing it, click on the Layout pull-down menu and choose one of the available options: Export as Image (to convert the layout to a format such as JPG or PNG), Export as PDF, or Export as SVG

imcenter

Submission

All you have to turn into blackboard for this week is the final image you created above.