Book Image

QGIS 2 Cookbook

By : Alex Mandel, Víctor Olaya Ferrero, Anita Graser, Alexander Bruy
Book Image

QGIS 2 Cookbook

By: Alex Mandel, Víctor Olaya Ferrero, Anita Graser, Alexander Bruy

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 (19 chapters)
QGIS 2 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Batch reprojection


Layers can be reprojected in a batch operation without having to enter parameters individually on the Save as dialog. This recipe shows you how to reproject a set of layers to a different CRS using an algorithm from the Processing Toolbox menu. You will see how to reproject all the files accompanying the Davis_DBO_centerline.shp file that you reprojected in the Reprojecting a layer recipe.

How to do it…

  1. In the filter box of the Processing Toolbox menu, type Reproject to filter the list of available algorithms. Locate the Reproject layer algorithm, right-click on it, and select Execute as batch process. The batch processing interface will be shown, as follows:

  2. In the upper cell of the Input layer column, click on the ... button and select Select from filesystem. A file selector dialog will appear. Select the content of the davis folder in the dataset and add the files to the table.

  3. In the first cell in the Target CRS column, click on the ... button. A CRS selector will appear. Select the EPSG:26911 CRS, as you did in a previous recipe when converting a single layer. Copy the value to the rest of rows in the column by double-clicking on the column header.

  4. Set all the values in the Reprojected layer column. Select a file in the first cell, and then use the Fill with parameter value option to automatically fill the rest of rows.

  5. Once the table is complete, click on Run to reproject the layers.

How it works…

The reprojection algorithm is a part of the Processing framework, so you can select the output format by changing the output file extension. You can use this to not only reproject a set of input layers but to also convert their format, all in a single step.

There's more…

Raster layers can also be reprojected with another algorithm from the Processing Toolbox menu named Warp (reproject). These inputs are rather similar to the ones in the reprojection tool for vector layers with some additional parameters that are specific to raster layers. Select the algorithm, right-click on it, and select Execute as batch process to run it and convert a set of raster layers.