Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning QGIS 2.0
Learning QGIS 2.0

Learning QGIS 2.0: This book takes you through every stage you need to create superb maps using QGIS 2.0 – from installation on your favorite OS to data editing and spatial analysis right through to designing your print maps.

By Anita Graser
$15.99 $10.99
Book Sep 2013 110 pages 1st Edition
eBook
$15.99 $10.99
Print
$26.99
Subscription
$15.99 Monthly
eBook
$15.99 $10.99
Print
$26.99
Subscription
$15.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Sep 17, 2013
Length 110 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781782167488
Category :
Table of content icon View table of contents Preview book icon Preview Book

Learning QGIS 2.0

Chapter 1. Getting Started with QGIS

In this chapter, we will install and configure the QGIS geographic information system. We will also get to know the user interface and how to customize it. By the end of this chapter, you will have QGIS running on your machine and be ready to start with the tutorials.

Installing QGIS


QGIS runs on Windows, various Linux distributions, Unix, Mac OS X, and Android. Also, the QGIS Project provides ready-to-use packages as well as instructions for building from source code on download.qgis.org. We will cover how to install QGIS on the two most common systems, Windows and Ubuntu, as well as how to avoid the most common pitfalls.

Like many other open source projects, QGIS offers you a choice between a stable release version and the cutting-edge developer version, also called master. QGIS master will contain the latest and greatest developments, but be warned that on some days, it might not work as reliably as you are used to. For the tutorials in this book, we will be using the QGIS 2.0 release.

Installing on Windows

On Windows, we have two different options to install QGIS: standalone installer and OSGeo4W installer. The standalone installer is one big download (approximately of 130 MB), which contains a QGIS release and the Geographic Resources Analysis Support System (GRASS) GIS in one package. The OSGeo4W installer is a small, flexible installation tool that makes it possible to download and install QGIS and many more OSGeo tools with all their dependencies. The main advantage of this over the standalone installer is that it makes updating QGIS and its dependencies very easy. You can always have access to both the current release and the developer version, if you chose so, but of course, you are never forced to update. That's why I recommend using OSGeo4W. The OSGeo4W installer can be downloaded from osgeo4w.osgeo.org (or directly from download.osgeo.org/osgeo4w/osgeo4w-setup.exe). Download it and keep it! In the future, whenever you want to change or update your system, just run it again.

Tip

Regardless of the installer you choose, make sure to avoid special characters in the installation path, as they can cause problems later on, for example, during plugin installation.

When the OSGeo4W installer starts, we get to choose between the Express Desktop, Express Web-GIS, and Advanced installation. To install the QGIS release version, we can simply select the Express Desktop option and the next dialog will list the available desktop applications such as QGIS, uDig, and GRASS GIS. We simply select QGIS, click on Next and download and installation will start automatically. When the installation has finished, there will be desktop shortcuts and start menu entries for OSGeo4W and QGIS.

If we want to install QGIS master, we need to go through the Advanced installation. This installation path offers many options such as Download without installing and Install from Local Directory, which can be used to download all the necessary packages on one machine to later install them on machines without Internet access. It's usually not necessary to change the default settings, but if your machine is, for example, hidden behind a proxy, you will be able to specify it here. After the installer fetches the latest package information from OSGeo's servers, we get to pick the packages for installation. QGIS master is listed in the desktop category as qgis-dev. To select it for installation, click on the text that reads Skip and it will change and display the version number. The installer will automatically select all the necessary dependencies (such as GDAL, SAGA, OTB, and GRASS), so we don't have to worry about that. After clicking on Next, the download and installation starts automatically just like in the Express version. The dialog will look like the following screenshot:

If you try to run QGIS and get a pop up saying The procedure entry point <some-name> could not be located in the dynamic link library <dll-name>.dll, you are facing a common issue on Windows systems: a DLL conflict. They are easy to fix; just copy the DLL file mentioned in the error message from C:\OSGeo4W\bin\ to C:\OSGeo4W\apps\qgis\bin\ (adjust paths if necessary).

Installing on Ubuntu

On Ubuntu, the QGIS project provides packages for both the release and developer version. Be aware, though, that you can only install one version at a time. The packages are not listed in the default Ubuntu repositories. Therefore, we have to add the appropriate repositories to Ubuntu's sources list, which you can find in /etc/apt/sources.list. You can open the file with any text editor.

Make sure that you have super user rights, as you need them to save your edits. One option is to use gedit, which is installed on Ubuntu by default. To edit the sources.list file, use the following command:

sudo gedit /etc/apt/sources.list

Make sure to add only one of the following four package source options to avoid conflicts due to incompatible packages. The specific lines you have to add to the source list depend on your Ubuntu version.

The first and default option is to install the current release version. To install the QGIS release on Precise Penguin, add the following lines to your file:

deb     http://qgis.org/debian precise main
deb-src http://qgis.org/debian precise main

If necessary, replace precise with raring, oneiric, natty, or lucid to fit your system. For an updated list of supported Ubuntu versions, check download.qgis.org.

The second option is to install the QGIS master, which is currently available for precise, quantal, and raring. Add the following lines to your file:

deb     http://qgis.org/debian-nightly precise main
deb-src http://qgis.org/debian-nightly precise main

Tip

The preceding versions depend on other packages such as GDAL and proj4, which are available in the Ubuntu repositories. It is worth mentioning that these packages are often quite old.

Therefore, the third option is to install the QGIS release version with updated dependencies, which are provided by the ubuntugis repository. Add the following lines to your file:

deb     http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu precise main
deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu precise main

The fourth option is QGIS master with updated dependencies. Add the following lines to your file:

deb     http://qgis.org/ubuntugis-nightly precise main
deb-src http://qgis.org/ubuntugis-nightly precise main
deb     http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu precise main

After choosing the repository, we add the qgis.org repository public key to our apt keyring. This will avoid warnings you might otherwise get when installing from a non-default repository. Run the following command in the terminal:

gpg --keyserver keyserver.ubuntu.com --recv 997D3880
gpg --export --armor 997D3880 | sudo apt-key add –

Note

The key information might have changed since this book went into print. Please refer to hub.qgis.org/projects/quantum-gis/wiki/Download#26-Ubuntu for the latest updates.

Finally, to install QGIS, run the following commands:

sudo apt-get update
sudo apt-get install qgis python-qgis qgis-plugin-grass

Running QGIS for the first time


By default, QGIS will use the operating system's default language. To follow the tutorials in this book, it is advisable to change the language to English by navigating to Settings | Options | Locale. On the first run, the toolbars are arranged in two rows and depending on your screen resolution, this can hide many buttons. To be able to work efficiently, I therefore suggest arranging the toolbars. I like to put some toolbars to the left and right screen borders to save vertical screen estate—especially on wide-screen displays.

Additionally, we activate the file browser by navigating to View | Panels | Browser. It will provide us quick access to our spatial data. In the end, your screen should look similar to the following screenshot:

Next, we activate some must-have plugins by navigating to Plugins | Manage and Install Plugins. Plugins are activated by ticking the checkbox beside their name. To begin with, I recommend the following:

  • Coordinate Capture: This plugin is useful for picking coordinates in the map

  • fTools: This plugin offers vector analysis and management tools

  • GdalTools: This plugin offers raster analysis and management tools

  • Processing: This plugin provides access to many useful raster and vector analysis tools as well as a model builder for task automation

To make it easier to find specific plugins, we can filter the list of plugins using the Search input field at the top of the window, which you can see in the following screenshot:

Introducing the QGIS user interface


Now that we have set up QGIS, let's get accustomed to the interface! The biggest area is reserved for the map. To the left of the map, there are the Layers and the Browser panels. Below the map, we find important information such as (from left to right), current map coordinates, map scale, and the (currently inactive) project coordinate reference system (CRS).

Next, there are multiple toolbars to explore. If you arranged them as shown in the previous section, you'll find the following toolbars in the top row:

  • File: This toolbar contains tools to create, open, save, and print projects

  • Manage Layers: This toolbar contains tools to add layers from vector or raster files, databases, web services, text files, or create new layers

  • Database: Currently, this toolbar only contains DB Manager, but other database-related tools will appear here when they are installed

  • Help: This points to the user manual download

The following screenshot shows what the preceding toolbars look like:

The second row of toolbars contains the following:

  • Map Navigation: This toolbar contains pan and zoom tools

  • Attributes: These tools are used to identify, select, open attribute tables, measure, and so on

  • Label: These tools are used to add, configure, and modify labels

  • Vector: This is currently empty, but will be filled by additional Python plugins

  • Web: This is currently empty, but will be filled by additional Python plugins

The following screenshot shows what the preceding toolbars look like:

On the left screen border, we put the following:

  • Plugins: This is currently empty, but will be filled by additional Python plugins

  • Raster: This toolbar includes histogram stretch, brightness, and contrast control

The following screenshot shows what the preceding toolbars look like:

Finally, on the right screen border, we find the following:

  • Digitizing: These tools enable editing, basic feature creation, and editing

  • Advanced Digitizing: This toolbar contains undo/redo, advanced editing tools, geometry simplification, and so on

The following screenshot shows what the preceding toolbars look like:

Tip

All digitizing tools are currently inactive. They will only turn active once we start editing a vector layer.

Toolbars and panels can be activated and deactivated via the View menu's Panels and Toolbars entries as well as by right-clicking on a menu or toolbar, which opens a context menu with all available toolbars and panels. All toolbar tools can also be accessed via the menu. If you deactivate the Manage Layers toolbar, for example, you will still be able to add layers using the Layer menu.

QGIS is highly customizable. You can increase your productivity by assigning shortcuts to the tools you use regularly by navigating to Settings | Configure shortcuts. Similarly, if you find that you never use a certain toolbar button or menu entry, you can hide it by navigating to Settings | Customization. For example, if you don't have access to an Oracle Spatial database, you might want to hide the associated buttons to remove clutter and save screen estate as shown in the following screenshot:

Summary


In this chapter, we installed QGIS and configured it by selecting useful defaults and arranging the user interface elements. Finally, we explored the panels, toolbars, and menus that make up the QGIS user interface, and learned how to customize them to increase productivity.

Left arrow icon Right arrow icon

Key benefits

  • Load and visualize vector and raster data
  • Create and edit spatial data and perform spatial analysis
  • Construct great maps and print them

Description

QGIS is a user friendly open source geographic information system (GIS) that runs on Linux, Unix, Mac OSX, and Windows. The popularity of open source geographic information systems and QGIS in particular has been growing rapidly over the last few years. More and more companies and institutions are adopting QGIS and even switching to QGIS as their main GIS. Learning QGIS 2.0 is a practical, hands-on guide that provides you with clear, step-by-step exercises that will help you to apply your GIS knowledge to QGIS. Containing a number of clear, practical exercises, this book will introduce you to working with QGIS, quickly and painlessly. If you want to take advantage of the wide range of functionalities that QGIS offers, then this is the book for you. This book takes you from installing and configuring QGIS, through handling spatial data to creating great maps. You will learn how to load and visualize existing spatial data and how to create data from scratch. You will perform common geoprocessing and spatial analysis tasks and automate them. We will cover how to achieve great cartographic output and print maps. You will learn everything you need to know to handle spatial data management, processing, and visualization tasks in QGIS.

What you will learn

Installing QGIS Getting comfortable with the QGIS user interface Loading vector and raster data from files, databases, and web services Creating, editing, and visualizing spatial data Performing geoprocessing tasks Automating geoprocessing and spatial analysis tasks Creating advanced cartographic output Designing great print maps

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Sep 17, 2013
Length 110 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781782167488
Category :

Table of Contents

12 Chapters
Learning QGIS 2.0 Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Getting Started with QGIS Chevron down icon Chevron up icon
Viewing Spatial Data Chevron down icon Chevron up icon
Data Creation and Editing Chevron down icon Chevron up icon
Spatial Analysis Chevron down icon Chevron up icon
Creating Great Maps Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.