Book Image

QGIS 2 Cookbook

By : Mandel, Olaya Ferrero, Anita Graser
Book Image

QGIS 2 Cookbook

By: Mandel, Olaya Ferrero, Anita Graser

Overview of this book

QGIS is a user-friendly, cross-platform desktop geographic information system used to make maps and analyze spatial data. QGIS allows users to understand, question, interpret, and visualize spatial data in many ways that reveal relationships, patterns, and trends in the form of maps. This book is a collection of simple to advanced techniques that are needed in everyday geospatial work, and shows how to accomplish them with QGIS. You will begin by understanding the different types of data management techniques, as well as how data exploration works. You will then learn how to perform classic vector and raster analysis with QGIS, apart from creating time-based visualizations. Finally, you will learn how to create interactive and visually appealing maps with custom cartography. By the end of this book, you will have all the necessary knowledge to handle spatial data management, exploration, and visualization tasks in QGIS.
Table of Contents (14 chapters)
13
Index

Saving a raster layer

Raster layers can be exported to a different file. The export process can be used to crop the layer or perform resampling, creating a modified layer. This recipe shows you how to do this.

Getting ready

Open the elev_lid792_1m layer in your QGIS project.

How to do it…

  1. Right-click on the name of the raster layer in the QGIS table of contents and select the Save as... menu. You will see the following window:
    How to do it…
  2. In the Resolution fields, replace both of them with a value of 2. The original resolution (the size of the cell) is 1, as you saw in a previous recipe.
  3. Enter an output file path in the Save as field.
  4. Click on OK. The layer will be saved with a coarser resolution than the original one.

How it works…

The GDAL library is used to save the file. Not all formats supported for input are also supported for output, but the most common ones are supported for both operations.

There's more…

The layer can be exported with a reduced extent. In the QGIS canvas, zoom to a small part of the raster layer. Then open the Save as dialog. In the Extent section, click on the Map view extent button. The bounding coordinates of the current map view will be placed in the four coordinate fields.

Enter a file path to save the file to and click on OK. A layer with a reduced extent covering only the region shown in the map view will be exported.