Creating high-resolution output with QGIS can be tricky. “Save as image” saves the current map extent and creates a world file, but the output size cannot be specified directly. It simply saves the currently visible map. Most of the time this resolution will not be satisfactory.
Using “Print Composer” enables you to create full-grown maps including legend, scale bar, text annotations, north arrow, attribute table, decorations, etc. You are free to chose any size/resolution for the output image. Unfortunately, this way you will not get a world file.
That’s where the third possibility comes in handy: Using QGIS from command line to create a snapshot of a map. This way, you can create images of any size and with corresponding world file. The work-flow can be divided into the following steps:
- Create and design your project: Add layers and styles.
- Zoom to the desired zoom level.
- Write down the extent of the map window. Use coordinates in the project’s projection. (You can skip this step and don’t specify –extent option. The project will be restored in it’s original saved state if you do so.)
- Close the project
- Go to command line and run
C:\...>qgis --project myproject.qgs --snapshot image.png --width 1500 --height 1000 --extent xmin,ymin,xmax,ymax
QGIS will start, load the project, create the snapshot, and close again. That’s it!
Things to be aware of: QGIS will start, load the project, set the given extent (if specified), enlarge the map canvas and then take the snapshot. As a consequence, the extent given doesn’t match the extent of the resulting image. The image will have a bigger extent and contain surrounding areas.
Together with the new labeling tools this can be a fast and (semi-)automatic way to create nice looking high-resolution map images and corresponding world files from QGIS projects.