Introduction Qgis Software
Introduction Qgis Software
• http://www.qgis.org
• http://www.osgeo.org
Agenda
• Overview of GIS
• Introduction to Quantum GIS
• Vector Data
• Raster Data
• Plugins
• Fields and Attribution
• Creating Data
• Map Layout
1. Overview of GIS
• Geographic Information System
• Wikipedia definition - it is a system designed to
capture, store, manipulate, analyze, manage,
and present all types of geographically
referenced data.
• It is used in many applications: Small
municipalities, forestry, military, commercial
businesses, etc., etc.,
• What do you do with it?
GIS
• Easily measure distances
• Easily measure areas
• Find overlap between features
• Proximity
• Everything is related by location.
o Tobler's Law
USGS Earthquake Zones
http://earthquake.usgs.gov
Simple Maps
Outputs from a GIS
• Maps
o Printed
•Digital (PDF, JPEG
•Spreadsheets
• Databases
• Files
o Shapefiles
o KML
2. Introduction to Quantum GIS
• Open Source – It comes with the right to
download, run, copy, alter, and redistribute the
software.
• With source code users have the option
o Suggest improvements
o Make improvements themselves
o Hire a professional to make the changes
o Save software from abandonment
Common OS Licensing
• Licenses to run in both open and proprietary
systems
o Apache Software License
o BSD (Berkeley Software Distribution)
o MIT (Massachusetts Institute of Technology)
• License to run in open environments
o GPL (General Public License)
o LPGL (Lesser General Public License)
o MPL (Mozilla Public License)
QGIS
• The QGIS project began in February, 2002
• Produced by a Development team
– Gary Sherman, Founder
• The first release was in July of that year
• The first version supported only PostGIS and
had no map navigation tools or layer control.
QGIS is GPL
Installing Quantum
• http://www.qgis.org
• I am going to stick with Windows and Linux
Installs.
– OSX - http://www.kyngchaos.com/software/qgis
• Linux – depending on your distribution of choice
you'll have a Debian or RPM install.
o Most systems with a large user base have
a GIS repository
o Ubuntu, Debian, Fedora
Windows
• Windows Installer Method
o Standalone Installer (recommended for new
users)
o Installs Quantum (Currently 1.8)
Also installs Current Release of GRASS
Also installs python 2.7 that runs inside of
QGIS
• Updates uninstall and reinstall the software and
save your settings. Must be done manually
Windows Installer cont'
• Standalone Method
o Geographic Data Abstraction Library
o Installs libraries for SID and ECW
o SID and ECW are proprietary formats that
have special agreements to be used with
GDAL
o http://www.gdal.org/
OSGEO Install
• OSGeo provides an installer that provides
everything.
o Runs in a “cygwin” type environment
o Cygwin provides unix commands and
environments on windows machines.
o Provides a means to an easy(ier) upgrade
path between releases.
o Isn't “installed” on your computer.
OSGEO Installer Cont'
• Quantum GIS
• GDAL
• GRASS
• OpenEV
• And UDIG (a great
data viewer).
3. Quantum GIS Interface
Layer Window
Map Canvas
Menus and Toolbars
Toolbars and Panels
• Right Click in
menu Area
• Add Panels
• Add
Toolbars.
Status Bar
• Projection of
the QGIS
project
• Scale
• Coordinates
Basic Buttons
• Hover mouse over them they will pop up a text message telling
the user their purpose.
The Exercises are going to be an actual project completed by North River Geographic Systems,
Inc in 2009. We are going to cover the Conasauga River Watershed. The watershed is located on
the border of Tennessee and Georgia. The data is made up of ESRI Shapefiles. That is the
easiest data format to work with for these exercises.
1. If you haven't already, open QGIS. There should be an icon on your desktop or on your start menu
(or both).
Once QGIS has opened right click with your mouse in the toolbar area.
Turn off your Managed Layers toolbar. Turn Off your Map Navigation Toolbar. They have disappeared
from the interface. Now turn them back on. If you want you can move them from their default
location by grabbing the left corner of the toolbar and moving it.
2. Turn your Layers Panel off. Now turn it on by navigating from the View Menu at the top of QGIS
3. Click your Add Vector Data button at the top. Browse to your data folder located under
c:\gisdata\QGIStraining\data . Add the CountyBoundaries.shp shapefile to your map. If you do
not see any data please be sure to check that you are adding shapefiles.
4. Click your add vector data button at the top and add the subbasin.shp file. You should have something
that looks like:
5. Using your identify features tool list all the counties in Georgia and the Counties in Tennessee. In order
to identify a feature you must have that layer selected in your layer window.
Georgia Tennessee
6. Add the 2010 Urban Areas Shapefile.
What are the three biggest Urban Areas that touch/are within the Watershed?
7. Using your navigation tools Zoom to the full extent of all the data layers. You should see something similiar
to the graphic below.
It's time to start looking at your data and working with it.. Most of the data you will be working with was
downloaded from the Census Bureau, the National Hydro Dataset, and the USDA DataGateway. Some
of these datasets were built by me during the course of the CRA project.
7. Once you have saved it remove the watershed shapefile by right clicking on it and selecting remove. Add it
again. Right click and select Load Style. Load the qml file you just saved. All of your original settings for this
layer have been restored.
8. Select North Coahulla using the select tool.
9. Right click and select “Save Selection As”. You have just saved the North Coahulla section of the
watershed.
10. Right click watershed.shp and open the Attribute table. We haven't covered this part yet in the class but
it's good to know for the purposes of the exercise.
16. You have just calculated the Acreage of each watershed. What is the biggest watershed? What is the total
size in acres of the Watershed? (HINT Vector Menu → Analysis Tools → Basic Statistics.
4. Adding Raster Data
• Supports OGR Raster Formats
o Geotiff
o ESRi Grid
o Jpeg
3. Right Click the image layer and select rename. Name it “Whitfield County 2009” . Note that it added to top of
your layer window. Last thing added gets placed on top of the layers.
4. Right click the Whitfield County 2009 layer and go to properties. Set the transparency at 40%.
Add the file float35w085_1.flt from the ElevationModel directory to your display. Note that it is an ESRI Grid
format.You will need to use the “Add Raster” button to add the DEM
8. Right click on the DEM and go to Properties. Click on the style tab. Change the contrast enhancement to Stretch
to Min Max.
9. You should now see an image that covers the extent of Murray County and also covers a major portion of the
watershed. Make the Watershed Transparent. Use the identify features tool to identify elevations on the DEM.
10. Go to the Raster Menu at the top of QGIS. Click on Analysis and then DEM (terrain Models). There is one thing
we will need to change before running this command. We will need to set the scale.
Scale is the ration of vertical units to horizontal. Since the DEM is in a geographic Projection and has vertical units
in meters scale will need to be set. If the horizontal unit of the source DEM is degrees (WGS84), you can use
scale=111120 if the vertical units are meters or scale=370400 if they are in feet.
11. On the DEM menu name an output file. Make sure the mode is set to hillshade. Make sure the scale is set to
111120.00 . Before clicking OK make sure the Load onto Canvas checkbox is checked.
12. Inspect the hillshaded DEM. Once you are happy save
your exercise!
5. Plugins
• QGIS has a standard list of things that it does
o Buffers
o Projections
o Clips
o Unions
• There are some things that users want it to do
that it doesn't.
Fetching Plugins
Plugin Interface
While you're working on a project you might need access to more functionality. QGIS does a lot, Plugins allow you
to do more.
1. Click on the plugins menu at the top of QGIS. Notice you have several choices under the main menu for plugins
into QGIS. Python being one of them. Grass being another. Click on the start button in windows and drive to the
QGIS folder under installed programs (Programs (x86)). Notice that Grass is installed under the QGIS Folder. What
is Grass and how long has it been around? (You can use Google!)
2. Open the QGIS plugin manager. How many default plugins are available to QGIS?
3. Open the QGIS Fetch Python Plugins Menu. How many plugins are available? (acceptable answer can be A Lot
)
4. Install the OpenLayers Plugin.
5. Once installed go back to the plugins menu and add the
OpenLayers Overview.
11. Once you are done looking at the plugins, close QGIS!
6. Attributes
• GIS is more than just Geometry – there are
attributes built into the data.
Attribution depends on the database
• We are using Shapefiles
• It also reads PostGIS, SQL Server, ESRI's
SDE, Spatialite, etc, etc.
1. Open QGIS and add the Watershed layer to your display. Open the attribute table by right clicking on the layer
and clicking “Open Attribute Table”.
2. You need to calculate the square miles of each watershed. Toggle Editing.
3. Add a column by clicking on the add column icon. Atributtes for the new column depend on the
database format being used. In this case we are using dbase (dbf). Make your new column name
sqmiles. Make the Type decimal number. Make the width 6 and the precision (number of decimal
places) 4.
4. Since this shapefile is in Georgia West
Stateplane NAD 83 US Feet (Projections are
coming in a bit), The important thing to know
is the Area (Shape_Area) is in Square
Feet. There are 640 Acres in a Square Mile.
F. Click OK. Click the editing icon and save your edits. Congratulations. You've just calculated Acres
for the watershed.
5. Add the Streams shapefile to QGIS. This data came from the National Hydro Dataset and has had
more attributes added to it. The Conasauga River is the main River that flows through the watershed.
Open the attribute table and search for the Conasauga River using the GNIS_Name as the search
field. Type in Conasauga.
Click the Show Selected Only. Notice it did a wild card search by default and looked for the word
“Conasauga” in the results. Some results are showing Conasauga Creek while others are showing
Conasauga River. Notice the Creek to the north west of the main river.
6. Now we're going to build an
SQL Statement using Advanced
Search. Click Advanced Search.
7. Now that you have selected the main stem of the Conasauga River, unselect it using the Unselect
Icon on the Attribute table.
8. Remove the following attributes from the Shapefile: Enabled, From_Node, To_Node, fromelev,
ToElev. You will have to enable editing and then click the Delete Column icon.
9. Once you have finished, Stop editing by clicking the Editing icon located on the Attribute Menu. You
will be prompted to save your edits.
7. Creating new Data and Editing
• You can create new types of data in QGIS
o Shapefiles
o Spatialite Layer
• Layers contain basic Geometry shapes
o Points
o Lines
o Polygons
Map Projections
• Geographic Coordinate Systems
o Defines locations on spherical model of the earth
• Projected Coordinate System
o Defines locations on flat model of the earth
Geographic Coordinate System
• Defines Locations with Latitude Longitude
Values
o Latitude – north and south of the equator
o Longitude - east and west of prime meridian
o Prime meridian is Greenwich
Projected Coordinate System
• Define Locations with map
units
o X and Y measured from a
Origin
o Projected Coordinate
system includes
o Units in feet or meters
o A Map Projection
o Underlying Geographic
Coordinate System
EPSG Geodetic Parameter Registry
• Gatekeepers of Projections
• Also knows as SRIDS (Spatial Reference
System Identifier)
• http://www.epsg-registry.org/
Create a new shapefile
EPSG:4326
• QGIS has 4326 as a Default Projection
– Which is WGS 84
• It can be changed
Define the Properties of the
Shapefile
• Points, Lines, or Polygons
• Projection ( Coordinate
Reference System)
• Attribution
o Text
o Whole Number
o Decimal Number
Spatialite
• You can make a spatialite layer
o Very "similar" to ESRI's Geodatabase Format
o All files are kept in one file/database
o Can be accessed from a number of softwares
QGIS
Python
GDAL
Mapnik
• Cannot be accessed by ESRI Software.....yet.
Editing Data
• Once data is created or
added to the Map View it
can be edited two different
ways
• Right click on the layer
and Toggle Editing
• Go to layer menu and
Toggle Editing
Editing Menus
1. Open exercise 7-.qgs under the Editing directory. Now – when the .qgs project is opened something fun might
happen. If the project hasn't been set up with relative path names you might have to reset the project.
7. Once you finish tracing the pond right click your mouse. You will be prompted to fill in the attributes. Don't worry
about filling anything out. Save your edits.
....and you're almost done. Time for the fun stuff. You need to make a map. There will be no
screenshots of a map. This one is all up to you.
1. Open QGIS.
8. Notice you can group, ungroup, and align certain items. You can
also add labels.
9. Click on File in the upper left hand corner and look at your export
options.
10. Add an image and look at the pre-loaded images. You can add
a North Arrow and Sync that with the map. When you sync the
North Arrow it will turn if the map turns.
Conclusion
• It is possible to use Freely available GIS Tools
to complete small or big projects
o It's an active community – Join in
o http://www.qgis.org
o User Manual -
http://qgis.org/en/documentation/manuals.html
o Wiki - http://qgis.org/en/community.html
Contributors
• Randal Hale – North River Geographic
Systems, Inc
• Carol Kraemer – North River Geographic
Systems, Inc