Book Image

Mastering QGIS - Second Edition

By : Kurt Menke, GISP, Paolo Corti, Richard Smith Jr., GISP, Luigi Pirelli, John Van Hoesen, GISP
Book Image

Mastering QGIS - Second Edition

By: Kurt Menke, GISP, Paolo Corti, Richard Smith Jr., GISP, Luigi Pirelli, John Van Hoesen, GISP

Overview of this book

QGIS is an open source solution to GIS. It is widely used by GIS professionals all over the world. It is the leading alternative to the proprietary GIS software. Although QGIS is described as intuitive, it is also by default complex. Knowing which tools to use and how to apply them is essential to producing valuable deliverables on time. Starting with a refresher on the QGIS basics, this book will take you all the way through to creating your first custom QGIS plugin. From the refresher, we will recap how to create, populate, and manage a spatial database. You’ll also walk through styling GIS data, from creating custom symbols and color ramps to using blending modes. In the next section, you will discover how to prepare vector, heat maps, and create live layer effects, labeling, and raster data for processing. You’ll also discover advanced data creation and editing techniques. The last third of the book covers the more technical aspects of QGIS such as using LAStools and GRASS GIS’s integration with the Processing Toolbox, how to automate workflows with batch processing, and how to create graphical models. Finally, you will see how to create and run Python data processing scripts and write your own QGIS plugin with pyqgis. By the end of the book, you will understand how to work with all the aspects of QGIS, and will be ready to use it for any type of GIS work.
Table of Contents (19 chapters)
Mastering QGIS - Second Edition
Credits
Foreword
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Working with CRS


When working with spatial data, it is important that a CRS is assigned to the data and the QGIS project. To view the CRS for the QGIS project, click on Project Properties under Project and choose the CRS tab.

It is recommended that all data added to a QGIS project be projected into the same CRS as the QGIS project. However, if this is not possible or convenient, QGIS can project layers on the fly to the project's CRS.

Note

If you want to quickly search for a CRS, you can enter the EPSG code to quickly filter through the CRS list. An EPSG code refers to a specific CRS stored in the EPSG Geodetic Parameter Dataset online registry which contains numerous global, regional, and local CRS. An example of a commonly used EPSG code is 4326, which refers to WGS 84. The EPSG online registry is available at http://www.epsg-registry.org/.

To enable on-the-fly projection, perform the following steps:

  1. Click on Project Properties under Project.

  2. Choose the CRS tab and Enable 'on the fly' CRS transformation.

  3. Set the CRS that you wish to apply to the project and make all layers that are not set to the project's CRS transform on the fly.

To view the CRS for a layer, perform the following steps:

  1. Open the layer's properties by either navigating to Layer | Properties or by right-clicking on the layer in the Layers panel.

  2. Choose Properties from the context menu and then choose the General tab.

  3. If the layer's CRS is not set or is incorrect, click on Specify to open the CRS selector window and select the correct CRS.

To project a layer to a different CRS, perform the following steps:

  1. Right-click on the layer in the Layers panel and then choose Save As from the context menu.

  2. In the Save vector layer as dialog, set the file format and filename, then set CRS to Selected CRS, click on Change to set the target CRS, and save the file.

To create a new CRS or modify an existing CRS, perform the following steps:

  1. Click on Custom CRS under Settings to open the Custom Coordinate Reference System Definition window.

  2. Click on the Add new CRS button to add a new entry to the CRS list.

  3. With the new CRS selected, we can set the name and parameters of the CRS. The CRS properties are set using the PROJ.4 format. To modify an existing CRS, click on Copy existing CRS and select the CRS from which you wish to copy parameters; otherwise, enter the parameters manually. Some background on PROJ.4 is provided below.

    Tip

    PROJ.4 is another OSGeo (http://osgeo.org) project used by QGIS, and it is similar to OGR and GDAL. This project is for managing coordinate systems and projections. For a detailed user manual for the PROJ.4 format used to specify the CRS parameters in QGIS, download it from ftp://ftp.remotesensing.org/proj/OF90-284.pdf.