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. 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.
Click on the Layout manager dialog appear.
menu entry to open this tool. You’ll see a blankUnder New from Template, select Empty layout and press the Create… button.
Give the new layout the name of Swellendam and click OK.
You will now see the Print Layout window:
You could also create this new layout via the
menu.Whichever route you take, the new print layout is now accessible from the
menu, as in the image below.4.1.2. Follow Along: 기초 맵 작성
이 예제에서 맵은 이미 원하는 대로 작성돼 있습니다. 사용자 맵도 마찬가지인지 확인하십시오.
Right-click on the sheet in the central part of the layout window and choose Page properties… in the context menu.
Check that the values in the Item Properties tab are set to the following:
Size:
A4
Orientation:
Landscape
이제 원하는 대로 페이지 레이아웃을 설정했지만, 이 페이지는 맵을 담고 있지 않습니다. 맵을 불러봅시다!
-
With this tool activated, you will be able to place a map on the page.
빈 페이지 상에서 클릭 & 드래그로 사각형을 그립니다.
페이지 상에 맵이 나타날 것입니다.
클릭 & 드래그로 맵을 이리저리 옮겨보십시오.
Resize it by clicking and dragging the boxes on the edges:
참고
물론 사용자 맵은 예제와 달라보일 겁니다! 사용자 자신의 프로젝트 설정에 따라 달라집니다. 하지만 걱정하지 마세요! 이것은 일반적인 지침이므로 맵 자체가 어떻게 보이던지 상관없이 동일하게 작용할 것입니다.
페이지 주변을 따라 여백을 남기고, 위쪽에 제목을 위한 공간을 남겨두십시오.
다음 버튼을 사용해서 (맵이 아니라) 페이지를 줌인/줌아웃해보십시오.
Zoom and pan the map in the main QGIS window. You can also pan the map using the Move item content tool.
The map view updates as you zoom in or zoom out.
If, for any reason, the map view does not refresh correctly, you can force the map to refresh by clicking the 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.
Go to the . This is a convenient shortcut to the one in the main dialog.
4.1.3. Follow Along: 제목 추가
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.
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.
페이지의 상단 한 가운데로 오도록 크기와 위치를 조정합니다. 맵의 크기와 위치를 조정한 방법 그대로 제목을 조정할 수 있습니다.
제목을 이동하면 페이지 한 가운데 맞출 수 있도록 지시선이 나타나는 것을 알 수 있습니다.
However, there is also a tool in the Actions Toolbar to help position the title relative to the map (not the page):
Click the map to select it
Hold in Shift on your keyboard and click on the label so that both the map and the label are selected.
Look for the Align selected items left button and click on the dropdown arrow next to it to reveal the positioning options and click Align center:
Now the label frame is centered on the map, but not the contents. To center the contents of the label:
라벨을 클릭해서 선택합니다.
Click on the Item Properties tab in the side panel of the layout window.
라벨 텍스트를 “Swellendam” 로 변경합니다.
Use this interface to set the font and alignment options under the Appearance section:
Choose a large but sensible font (the example will use the default font with a size of
36
)Set the Horizontal Alignment to Center.
폰트 색상도 바꿀 수 있지만, 기본 설정인 검은색을 유지하는 것이 최선일 것입니다.
제목의 텍스트 상자에 테를 두르지 않는 것이 기본 설정입니다. 그러나 테를 두르고 싶다면 그렇게 할 수 있습니다.
Item Properties 탭에서 아래 방향으로 스크롤해서 Frame 옵션을 찾으십시오.
Frame 체크박스를 클릭해서 테를 활성화합니다. 또 테의 색상 및 굵기도 바꿀 수 있습니다.
이 예제에서는 테를 활성화하지 않을 것이기 때문에, 페이지가 다음과 같이 보입니다.
To make sure that you don’t accidentally move these elements around now that you’ve aligned them, you can lock items into place:
4.1.4. 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.
4.1.5. Follow Along: 범례 항목 지정
범례에 보이는 모든 것이 꼭 필요한 것은 아닙니다. 따라서 필요하지 않은 일부 항목을 제거해보겠습니다.
In the Item Properties tab, you’ll find the Legend items group.
Uncheck the Auto update box, allowing you to directly modify the legend items
Select the entry with buildings
항목의 명칭을 바꿀 수도 있습니다.
동일한 목록에서 레이어를 선택한 다음,
Rename the layers to
Places
,Roads and Streets
,Surface Water
, andRivers
.
You can also reorder the items:
이때 범례가 새 레이어명 때문에 넓어질 수 있으므로, 범례 또는 맵을 이동하거나 크기를 조정해야 할 수도 있습니다. 그 결과는 다음과 같습니다.
4.1.6. Follow Along: 사용자 맵 내보내기
참고
여러분의 작업을 자주 저장해야 한다는 사실을 기억하시나요?
Finally the map is ready for export! You’ll see the export buttons near the top left corner of the layout window:
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.
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.
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.
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.
이 예제에서는 PDF 포맷을 사용하겠습니다.
Choose a save location and a file name as usual. The following dialog will show up.
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.
Click the hyperlink in the message to open the folder in which the PDF has been saved in your system’s file manager
Open it and see how your layout looks.
Everything is OK? Congratulations on your first completed QGIS map project!
Anything unsatisfying? Go back to the QGIS window, do the appropriate modifications and export again.
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.