QGIS/C2/Creating-a-Map/English

From Script | Spoken-Tutorial
Revision as of 17:48, 2 May 2019 by Snehalathak (Talk | contribs)

Jump to: navigation, search
Visual Cue Narration
Slide Number 1

Title Slide

Welcome to this tutorial on Creating a Map in QGIS.
Slide Number 2

Learning Objectives

In this tutorial, we will learn to,
  • Create a map using Print Composer.
  • Add map elements in the Print composer.
  • Export the map.
Slide Number 3

System Requirement

To record this tutorial, I am using
  • Ubuntu Linux OS version 16.04.
  • QGIS version 2.18
Slide Number 4

Pre-requisites


https://spoken-tutorial.org/

To follow this tutorial you should be familiar with QGIS interface.


For the prerequisite tutorials please visit our website.

Slide Number 5

Example for Demonstration

Download the folder given in the Code files link, located below the player.


Extract the contents of the downloaded zip file and save it in a folder.

Point to Code-file folder on desktop.

Double-click on Code-file folder.

Here is my Code files folder.


Double-click to open the folder.

Point to the files in the folder. In this folder you will find shape files for India and world map.
Cursor on indiaboundary.shp file.


Right-click on indiaboundary.shp file.

Locate indiaboundary.shp file.


To open this file in QGIS, right-click on the file.


The context menu opens.

From the context menu click on open with QGIS Desktop. Select the option, Open with QGIS Desktop.


The map opens directly in QGIS interface.

Cursor on QGIS Interface If you don’t see the option Open with QGIS Desktop, first open QGIS interface.


Here I have opened QGIS interface.

Click on Layer menu, from the drop-down menu select Add Vector Layer. Click on Add Vector Layer tool on the left tool bar.
Point to Vector Data Source dialog-box.


Click on Browse button next to Dataset text box.

Add Vector Layer dialog-box opens.


In the box, click on Browse button next to Dataset text box.

Cursor on dialog box.


Navigate to the Code files folder on Desktop.


Select the file, indiaboundary.shp file.

Click on Open button.

A dialog-box opens.


Navigate to Code files folder on the Desktop.


Select the file, indiaboundary.shp file.


Click on Open button.

Add Vector Layer dialog-box >> click on Open button. In the Add Vector Layer dialog-box, click on Open button.


Boundary map of India appears on the canvas.

Cursor on the canvas. Now let us add the shape file representing few cities of India.
Click on Add Vector Layer Again, click on Add Vector Layer tool on the toolbar.
Point to Add Vector Layer dialog-box.


Click on Browse button.

Add Vector Layer dialog-box opens.


In the box click on Browse button.

Cursor on the dialog box.


Navigate to the Code files folder on Desktop.


A dialog-box opens.


Navigate to Code files folder on the Desktop.


Select the file places.shp file.

Click on Open button. Click on Open button.
In the Add Vector Layer dialog-box >> click on Open button. In the Add Vector Layer dialog-box, click on Open button.


Cities are shown as point features on the map.

Right click on places layer in the Layers panel.


From the context menu, click on Properties option.

Let us label these cities.


Right click on Places layer in the Layers panel.


From the context menu, click on Properties option.

Cursor on Layer Properties dialog box.

Click on labels tab.


In the Layer Properties dialog-box.


Select the labels tab.

From the first drop-down, select Show labels for this layer option. In the drop-down located at the top, select Show labels for this layer option.
Click on Label with drop down select name from the given options. In Label with drop-down, select name from the given options.
From the Text tab, select the font, style, size, color from the drop-down. In the Text tab, we have options to choose font, style, size, color etc.
Click on Apply button and OK button. Click on Apply button and OK button.
Cursor on the map. On the canvas, India map with some cites and labels is displayed.


This map file can be exported to image format for the purpose of printing or publishing .

Cursor on the map. QGIS has a tool called Print Composer.


It allows you to create maps in the format that is easy to read.

Click on Project menu on the menu bar.


From the list, select New Print Composer.

Click on Project menu on the menu bar and select New Print Composer.
Cursor on Composer title dialog-box. Composer title dialog-box opens.
Type Map-1.


You will be prompted to enter a title for the composer.


Type India-Map as title.

Click on OK button. Click on OK button.


Print composer window opens.

Cursor on the canvas.


Point to the panels.

Print Composer provides you with a blank canvas.


On the right-side beside the canvas, you will find two panels.

Cursor on Panels. The upper panel and the lower panel.
Click on View menu.


From the drop-down select Panels.

To enable the panels, click on View menu.


From the menu scroll down and select Panels.

Point to sub-menu. The sub-menu shows the list of panels.


Here some panels are already selected.

Click on the panel name from sub-menu.


Click on the panel name to select it.


The panel appears on the right side of the canvas.

Cursor on tool bar.


Point to tool bars.

All Print Composer tools are available in menus and as icons on the toolbars.


The tool bars are present on the left as well as on the top of the Composer window.

Cursor on the window. For more information, please see additional material provided along with this tutorial.
In the Print Composer window, from the tool bar, click on Zoom full button.

(Magnifying glass symbol with 3 blue arrows)

Now let us start to assemble our map.


In the Print Composer window, click on Zoom full button on the tool bar.


This will display the layout to its full extent.

Cursor on the Print Composer window. Now we have to bring the map view that we see in the QGIS Canvas to the Composer.
In the Print Composer window.

Click on Add new map tool on the left tool bar.

Click on Add new map tool on the tool bar.
Move the cursor on the composer window.


Move the cursor on the composer window.


The cursor is now seen as plus (+) symbol.


This shows that Add Map button is active.

Click and hold the left mouse button and drag a rectangle on the Composer window.


Click and drag a box on the blank page.

Click and drag the left-mouse button to draw a rectangle on the Composer window.


Leave margins along the edges.

Cursor on the composer window. You will see that the rectangle window will be rendered with the map from the main QGIS canvas.
Cursor on the composer window. The rendered map may not be covering the full window.
Click on Move content tool on the left tool bar. Click on Move item content tool on the left tool bar.
Use left mouse button and move the map in the window. Using left mouse button, move the map in the window and centre it.


Leave space along the top for the title.

Cursor on the map. Now we will add a grid and zebra border to the main map.
In Item Properties Panel, scroll down to Grids section. In Item Properties Panel, scroll down to Grids section.
Click on small black-triangle next to Item Properties. Click on small black-triangle next to Grids to view the expanded menu.
Click the Green plus (+), Add a new grid button.


Click the Green plus (+), Add a new grid button.


Now all the features in the grid section are enabled.

Click on Change button next to CRS. If required, there is an option to change CRS.


I will leave it as such.

Click on drop-down arrows and select 10 in X and Y directions. Select the Interval values as 10 degrees in both X and Y direction using drop-down arrows.
Scroll down to the Grid frame section.


Select Zebra.

Scroll down to the Grid frame section and select a Frame style.


I will select Zebra.

Select options from drop-down to change frame size, thickness, color etc. There are options to change frame size, thickness, color, etc.


Select the options that suits your requirement.

Check the Draw Coordinates check-box. Scroll down and check the Draw Coordinates check-box.
In Distance to map frame, click on the upward/downward arrow. Adjust the Distance to map frame till the coordinates are legible.


Click on the upward or downward arrow to move the labels.

Select the Coordinate precision as 1.


Select the Coordinate precision as 1.


This will display the coordinates upto the first decimal.

Cursor on the map. Next, we will add a North Arrow to the map.


The Print Composer comes with a good collection of map related images.

Click on Add imageicon on the tool bar. Click on Add image icon on the tool bar.
Holding your left mouse button, click and draw a small rectangle on the top-right corner of the map canvas. Bring the cursor to the map composer window.


Holding your left mouse button, click and draw a small rectangle on the top-right corner of the map canvas.

Click on the black arrow next to Search directories section.


Click on the north arrow image.

Under Item Properties tab in the right panel, expand the Search directories section.


Select by clicking on the north arrow image of your liking.


The image appears in the box in the map Composer window.

Click on the map composer window. Click on the map Composer window.


You will see the North Arrow image on the top-right corner of the map.

Click on Add new scalebar tool from the tool bar. Now we will add a scale bar to the map.


Click on Add new scalebar tool from the tool bar.

Cursor on the map. Click on the map where you want the scalebar to appear.
Click on bottom-left corner.

In the right panel under Segments section, adjust the number of segments and their size.


I will add the scale bar at the bottom-left corner.


In the right panel under Segments section, you can adjust the number of segments and their size.

Click on Add new Label tool from the left tool bar. We will now add the title for our map.


Click on Add new Label tool from the left tool bar.

Bring the cursor to the map composer window.


Holding your left mouse button, draw a box at the top-center of the map.

Bring the cursor to the map composer window.


Holding your left mouse button, draw a box at the top-center of the map.

On the right panel, under Label, Main Properties>> in the text box, type Map of India. On the right panel you will see Item Properties tab for Label.

Under Main Properties, in the text box, type Map of India.

In the Appearance section, click on Font tab. In the Appearance section, click on Font tab.
Select Font dialog-box opens, select suitable Font, Font style and size.


Click on OK button.

Select Font dialog-box opens, select suitable Font, Font style and Size.


Click on OK button.

Click in the composer window. Change the font color, margins and alignment as per your preference.


After you have finished making changes, click in the composer window to view the changes.

Cursor on the label. The label with selected font and size appears on the map in the Composer window.
Cursor on the window. Next let us add an Inset map.
Cursor on main QGIS window.


Click on the Zoom In button in the tool bar.

Switch to the main QGIS window.


Click on the Zoom In button on the tool bar.

Bring the cursor to the map, zoom the area around Mumbai.


Draw a rectangle around Mumbai.

Bring the cursor to the map, zoom the area around Mumbai.


Draw a rectangle around Mumbai to zoom to the area.

Switch to Print Composer window. We are now ready to add the map inset.


Switch to Print Composer window.

Click on Add new map tool from the tool bar.


Drag a rectangle at the top-left corner.

Click on Add new map tool from the tool bar.


Draw a rectangle at the top left corner of the Composer window.

Select Move item Content tool from the tool bar.


Move the map in the inset.

Select Move item Content tool from the tool bar.


Place the cursor on the inset map.


Move the map in the inset to the location of your preference.

Cursor on maps.


Click on inset map.

You will have 2 map objects in the Print Composer, Main map and inset map.
In the Item Properties panel, scroll down to the Frame section.


Change the color and thickness of the frame border.

In the Item Properties panel, scroll down to the Frame section and check the box next to it.


Change the color and thickness of the frame border for the inset map,

Click on Background color drop-down and choose the color from the color triangle. Change the background color for the inset map.


So that it is easy to distinguish against the map background.

Cursor on the map. Explore other map elements such as Legends, shapes, arrows etc.
Cursor on the map. Once you have finished making required changes, you can save or export the map.
Click on Composer menu on the menu bar. Click on Composer menu on the menu bar.


Here we have options to export the map as Image, PDF or SVG.

Click on Export as Image option. Let us export the map as an image.


Select Export as Image option.

Cursor on Save composition as dialog-box .


Name: India-Cities.

Save composition as dialog-box opens.


give an appropriate file name , location and format.

Select file format as PNG.


Click on Save button.

I will choose PNG format.


Click on Save button.

Cursor on Image export options dialog-box.


Select 800x600 size.


Click on Save button.

Image export options dialog-box opens.

Choose appropriate resolution, page-width and height.


I will set page width as 800 pixels.


Click on Save button.

Here is the map saved as an image file.

This map can now be printed or published.

Slide Number 6

Summary

Let's summarize,

In this tutorial we have learnt to,

  • Create maps using Print Composer.
  • Add map elements in the Composer.
  • Export the map.
Slide Number 7

Assignment

Assignment
  • Using the world dataset given in the Code files link, create a map of Asia Continent.
  • Create an inset map of India.
  • Add a map legend.
Show the images of assignments. Your completed assignment should look as shown here.
Slide Number 8

About the Spoken Tutorial Project

The video at the following link summarises the spoken tutorial project. Please download and watch it.


Slide Number 9

Spoken Tutorial Workshops


The spoken tutorial project team conducts workshops and gives certificates on passing online tests

For more details please write to us.

Slide Number 10

Forum for specific questions

Please post your timed queries on this forum.
Slide number 11 The Spoken Tutorial Project is funded by NMEICT, MHRD Government of India.

More information on this mission is available at the following link.

Slide number 11 This tutorial is contributed by Prajwal.M from NIT Surathkal and Snehalatha from IIT Bombay.

Thank you for watching.

Contributors and Content Editors

Nancyvarkey, Snehalathak