4.1. Lesson: Using Print Layout

Now that you’ve got a map, you need to be able to print it or to export it to a document. The reason is, a GIS map file is not an image. Rather, it saves the state of the GIS program, with references to all the layers, their labels,colors, etc. So for someone who doesn’t have the data or the same GIS program (such as QGIS), the map file will be useless. Luckily, QGIS can export its map file to a format that anyone’s computer can read, as well as printing out the map if you have a printer connected. Both exporting and printing is handled via the Print Layout.

The goal for this lesson: To use the QGIS Print Layout to create a basic map with all the required settings.

4.1.1. basic Follow Along: The Layout Manager

QGIS allows you to create multiple maps using the same map file. For this reason, it has a tool called the Layout Manager.

  1. Click on the Project ► Layout Manager… menu entry to open this tool. You’ll see a blank Layout manager dialog appear.

    ../../../_images/layout_manager_dialog.png
  2. Under New from Template, select Empty layout and press the Create… button.

  3. Give the new layout the name of Swellendam and click OK.

  4. You will now see the Print Layout window:

    ../../../_images/print_composer_dialog.png

You could also create this new layout via the Project ► New Print Layout… menu.

Whichever route you take, the new print layout is now accessible from the Project ► Layouts ► menu, as in the image below.

../../../_images/print_composer_menu.png

4.1.2. basic Follow Along: Crearea Hărții de Bază

În acest exemplu, compoziția arată deja în modul dorit. Asigurați-vă că și a dvs. arată așa cum ați intenționat.

  1. Right-click on the sheet in the central part of the layout window and choose Page properties… in the context menu.

  2. Check that the values in the Item Properties tab are set to the following:

    • Size: A4

    • Orientation: Landscape

    Acum aveți aspectul paginii pe care l-ați dorit, dar această pagină este în continuare neagră. Îi lipsește în mod clar o hartă. Haideți să reparăm asta!

  3. Click on the addMap Add Map button.

    With this tool activated, you will be able to place a map on the page.

  4. Faceți clic și trasați un dreptunghi pe pagina albă:

    ../../../_images/drag_add_map.png

    Harta va apărea pe pagină.

  5. Deplasați harta făcând clic și mișcând-o după dorință:

    ../../../_images/move_map.png
  6. Resize it by clicking and dragging the boxes on the edges:

    ../../../_images/resize_map.png

    Notă

    Harta poate să prezinte un lot diferit, desigur! Acest lucru depinde de modul în care este configurat propriul proiect. Dar nu vă faceți griji! Aceste instrucțiuni sunt generale, astfel încât ele vor lucra la fel, indiferent de ceea ce se afișează pe hartă.

  7. Asigurați-vă că lăsați marginile în jurul conturului, și un spațiu în partea de sus pentru titlu.

  8. Măriți și micșorați pagina (dar nu și harta!) folosind aceste butoane:

    zoomFullExtent zoomIn zoomOut

  9. Zoom and pan the map in the main QGIS window. You can also pan the map using the moveItemContent Move item content tool.

    The map view updates as you zoom in or zoom out.

  10. If, for any reason, the map view does not refresh correctly, you can force the map to refresh by clicking the refresh Refresh view button.

    Remember that the size and position you’ve given the map doesn’t need to be final. You can always come back and change it later if you’re not satisfied. For now, you need to ensure that you’ve saved your work on this map. Because a Print Layout in QGIS is part of the main map file, you must save your project.

  11. Go to the Layout ► fileSave Save Project. This is a convenient shortcut to the one in the main dialog.

4.1.3. basic Follow Along: Adăugarea unui Titlu

Now your map is looking good on the page, but your readers/users are not being told what’s going on yet. They need some context, which is what you’ll provide for them by adding map elements. First, let us add a title.

  1. Click on the label Add Label button

  2. Click on the page, above the map, accept the suggested values in the New Item Properties dialog, and a label will appear at the top of the map.

  3. Redimensionați-o și puneți-o în partea centrală, de sus, a paginii. Aceasta poate fi redimensionată și mutată în același mod în care se redimensionează și se mută harta.

    Pe măsură ce mutați titlul, veți observa că liniile directoare apar pentru a vă ajuta să-l poziționați în centrul paginii.

    However, there is also a tool in the Actions Toolbar to help position the title relative to the map (not the page):

    alignLeft

  4. Click the map to select it

  5. Hold in Shift on your keyboard and click on the label so that both the map and the label are selected.

  6. Look for the alignLeft Align selected items left button and click on the dropdown arrow next to it to reveal the positioning options and click alignHCenter Align center:

    ../../../_images/align_center_dropdown.png

    Now the label frame is centered on the map, but not the contents. To center the contents of the label:

    1. Selectați eticheta făcând clic pe ea.

    2. Click on the Item Properties tab in the side panel of the layout window.

    3. Modificați textul etichetei în „Swellendam”:

      ../../../_images/title_font_alignment.png
    4. Use this interface to set the font and alignment options under the Appearance section:

      1. Choose a large but sensible font (the example will use the default font with a size of 36)

      2. Set the Horizontal Alignment to Center.

      De asemenea, puteți schimba culoarea fontului, dar probabil că cel mai bine este să-l păstrați negru, așa cum este în mod implicit.

    5. Setarea implicită nu adăugă un cadru casetei de text a titlului. Cu toate acestea, dacă doriți să adăugați un cadru, puteți proceda astfel:

      1. În fila Proprietăților elementului, derulați caseta verticală până veți vedea opțiunea Frame.

      2. Clic pe caseta Frame pentru a activa cadrul. Puteți schimba culoarea cadrului și lățimea.

    În acest exemplu, nu vom activa rama, așa că aceasta este pagina noastră de până acum:

    ../../../_images/page_so_far.png

    To make sure that you don’t accidentally move these elements around now that you’ve aligned them, you can lock items into place:

    1. Select both the label and the map items

    2. Click the lockItems Lock Selected Items button in the Actions Toolbar.

      Notă

      Click the unlockAll Unlock All Items button in the Actions Toolbar to be able to edit the items again.

4.1.4. basic Follow Along:

The map reader also needs to be able to see what various things on the map actually mean. In some cases, like the place names, this is quite obvious. In other cases, it’s more difficult to guess, like the colors of the forests. Let’s add a new legend.

  1. Click on the addLegend Add Legend button

  2. Click on the page to place the legend, accept the suggested values in the New Item Properties dialog,

  3. A legend is added to the layout page, showing layers symbology as set in the main dialog.

  4. As usual, you can click and move the item to where you want it:

    ../../../_images/legend_added.png

4.1.5. moderate Follow Along: Personalizarea Articolelor din Legendă

Nu este chiar totul necesar în legendă, deci, să eliminăm unele elemente nedorite.

  1. In the Item Properties tab, you’ll find the Legend items group.

  2. Uncheck the unchecked Auto update box, allowing you to directly modify the legend items

  3. Select the entry with buildings

  4. Delete it from the legend by clicking the signMinus button

Puteți redenumi, de asemenea, elementele.

  1. Selectați un strat din aceeași listă.

  2. Click the symbologyEdit Edit selected item properties button.

  3. Rename the layers to Places, Roads and Streets, Surface Water, and Rivers.

You can also reorder the items:

../../../_images/categories_reordered.png

Pe măsură ce legenda va fi probabil extinsă cu noile nume de straturi, ați putea dori să mutați și să redimensionați legenda și/sau harta. Acesta este rezultatul:

../../../_images/map_composer_result.png

4.1.6. basic Follow Along: Exportarea Hărții Dvs.

Notă

Ți-ai amintit să vă salvați munca adesea?

Finally the map is ready for export! You’ll see the export buttons near the top left corner of the layout window:

  • filePrint Print Layout: interfaces with a printer. Since the printer options will differ depending on the model of printer that you’re working with, it’s probably better to consult the printer manual or a general guide to printing for more information on this topic.

    The other buttons allow you to export the map page to a file.

  • saveMapAsImage Export as Image: gives you a selection of various common image formats to choose from. This is probably the simplest option, but the image it creates is „dead” and difficult to edit.

  • saveAsSVG Export as SVG: If you’re sending the map to a cartographer (who may want to edit the map for publication), it’s best to export as an SVG. SVG stands for „Scalable Vector Graphic”, and can be imported to programs like Inkscape or other vector image editing software.

  • saveAsPDF Export as PDF: If you need to send the map to a client, it’s most common to use a PDF, because it’s easier to set up printing options for a PDF. Some cartographers may prefer PDF as well, if they have a program that allows them to import and edit this format.

Pentru scopurile noastre, vom folosi PDF.

  1. Click the saveAsPDF Export as PDF button

  2. Choose a save location and a file name as usual. The following dialog will show up.

    ../../../_images/layout_export_pdf.png
  3. You can safely use the default values now and click Save.

    QGIS will proceed to the map export and push a message on top of the print layout dialog as soon as it finishes.

  4. Click the hyperlink in the message to open the folder in which the PDF has been saved in your system’s file manager

  5. Open it and see how your layout looks.

    Everything is OK? Congratulations on your first completed QGIS map project!

  6. Anything unsatisfying? Go back to the QGIS window, do the appropriate modifications and export again.

  7. Remember to save your project file.

4.1.7. In Conclusion

Now you know how to create a basic static map layout. We can go a step further and create a map layout that adapts dynamically, with more layout items.