Export Map Print
In addition to saving the current map view as an image, QGIS Print Composer provides many common map layout functions, such as adding titles, labels, legends, North arrow, scalebar, etc, and will export to image formats (such as .jpg, .png) as well as vectorized high-resolution PDF and .svg.
- First make sure the North Arrow and Scalebar Plugins are activated
- Go to menu Plugins | Plugin Manager
- Scroll down to find NorthArrow and ScaleBar and make sure both are checked, click OK
- In QGIS add a vector layer and symbolize it for exporting
- In this exercise we will Add Vector Data and browse to /china/TW_POP with the encoding = BIG5
- Right click on the layer, go to Properties | Style, and set a graduated color scheme for the Pop_2000 field (as we did in the Symbolize section)
- In this example, we've used a WhiteToBlue ramp with six classes
To use the scalebar our project must in a projected CRS with measurable units, not in WGS84 (which is an unprojected grid of latitude and longitude).
- Go to menu Settings | Project Properties | CRS, check Enable on-the-fly transform
- Search for Authority: EPSG, and type ID number "2333" into the form, then click FIND
- The CRS should reset to Xian 1980 Gauss-Kruger zone 19
- Notice in the proj4 definition the units = m
- Click APPLY and OK to return to the Map View
- If the Map View is empty, right click on the layer and ZOOM TO EXTENT
- Make sure the PLUGINS toolbar is checked, and click on the SCALEBAR tool
- In the Scalebar Plugin window set the placement, style, color, and CHECK "enable scale bar," then OK
- The scalebar should appear on the Map View (if the units look wrong, try to reset the CRS as in the previous step)
- Click on the NORTH ARROW plugin (on the plugins toolbar)
- Check the settings and make sure to CHECK "enable North Arrow", then OK
- The North Arrow should appear on the Map View
- Now we can compose a Map Layer. Go to the menu FILE | NEW PRINT COMPOSER
- A wide window will appear, with a blank Map Layout on the left, tools along the top, and three tabs on the right: General Settings, Item Settings, Command History
- Click on the green Add New Map button, then drag a box onto the Map Layout area and let go
- The current Map View of the Taiwan Layer will appear in the Map Layout
- Notice that any object added to the Map Layout will be the ACTIVE object when its four corners have small gray squares
- Try clicking on the Add New Map button again, this time dragging a very small rectangle over one side of the existing map object
- Now you should see two map objects, with the second one added being active
- To remove the ACTIVE map object, click the DELETE KEY on your keyboard
- Click DELETE to remove the second map object we added. Notice that the first map object is no longer ACTIVE. Click on the MOVE | SELECT tool (which looks like a hand with an arrow), then click on the map object to make it active again
- Now you should be able to add or remove objects easily from the Map Layout
- Let's start again with the Taiwan map view added to our layout. Click on the MOVE ITEM CONTENT tool (a hand over a globe) and drag the Taiwan map object. You will see that the object remains fixed but the map moves around inside of the object frame.
- Click on the MOVE | SELECT tool again and drag the map object. This time you will see that the whole object frame moves on the Map Layout pallette, while the content inside the frame remains the same.
- Now you should be able to move objects or their contents on the Map Layout
- Position the Taiwan map object roughly in the center of the Map Layout and leave room at the top for a title
- Click on the LABEL tool and towards the top left of the Map Layout. You will see a very tiny Label object appear with the default text: Quantum GIS
- Click on the ITEM tab to the right, you will see the controls related to the ACTIVE OBJECT, which in this case is the Label Object
- Update the text with "Taiwan Districts"
- Reset the Font to size 24 Bold, close the font controls
- Click on the MOVE | SELECT tool and drag the lower right corner of the Label Object until the full text is visible. You can also reposition the entire object.
- Now click on the SCALEBAR tool (which looks like a railroad on a blue square) and then click on the Map Layout to the lower left of the Taiwan map object.
- You will see a tiny scalebar object appear
- Recall that in our CRS setting (EPSG:2333) the map units = meters
- Click on the ITEM tab and look at the "Segment size (map units)" which should be a figure in meters
- Now change the "Map units per bar unit" to 1000 (in other words, set the bar units to kilometers instead of meters!)
- Changing the Map Units ber bar unit should have changed the appearance of the scalebar. Now it should look like a scale in KM. Type in the units in the UNIT LABEL form (in this case KM). Click on the Mapscale object and drag the right hand edge to the right to enlarge it. Now try typing in a different number in the "Segment size" form (for example, change the value from 40,000 to 80,000). You will see how the scalebar has adjusted itself. You may use the SELECT | MOVE tool (when the hand looks closed) to move the object around to a better position
Although we added the North Arrow to the Map View, it will not show up in the Print Composer
- Now click on the ADD VECTOR LEGEND tool (which looks like a bullet points list) and then click on the Map Layout to the lower right of the Taiwan map object.
- You will see a LEGEND object appear
- Click on the ITEM tab and look at the "Segment size (map units)" which should be a figure in meters
- Now change the "Map units per bar unit" to 1000 (in other words, set the bar units to kilometers instead of meters!)
- Changing the Map Units ber bar unit should have changed the appearance of the scalebar. Now it should look like a scale in KM. Click on the Mapscale object and drag the right hand edge to the right to enlarge it. Now try typing in a different number in the "Segment size" form (for example, change the value from 40,000 to 80,000). You will see how the scalebar has adjusted itself. You may use the SELECT | MOVE tool (when the hand looks closed) to move the object around to a better position
- Try adding your own label and adjust it to replace the default Legend Title
- You may also change the DRAWING ORDER of the objects on the Map Layout with the RAISE SELECTED ITEMS TOOL (on the far right of the toolbar)
- Finally we can add our own icons or images to the Map Layout with the ADD IMAGE tool (a small gray camera)
- Click on the ADD IMAGE tool, then Click on the Map Layout. A default object will appear on the map. Now click on the ITEM tab and it will take a moment to load the default icons in the Quantum Picture Options PREVIEW
- Go to OPTIONS | LOAD and click on the BROWSE icon (...) to load an image from your hard drive.
- After selecting an image click OPEN and it will appear in the image object frame.
- When the Map Layout is finalized, you may go to menu FILE and select from a number of export options, such as EXPORT AS IMAGE, EXPORT AS PDF, EXPORT AS SVG, or PRINT to paper. You may also save the Layout itself as a template, if you should need to make multiple map images with the same design.
- Congratulations, you've gone from learning QGIS to creating high-resolution maps!
|