BIT 2307 GIS PRACTICALS
5.1 Creating a New Project
Loading an Existing Project
• Click on [File] menu item
• Click on [Open Project]
• Navigate to the directory where the stored
projects are and select the
• project to be opened by highlighting it
• Click the [Open] button to launch QGIS with
the selected project
Saving a Project
• 5.3.1 General Information for Saving a Project
• 5.3.1.01 While working on any project it is advisable
to save regularly to guard against data lost and for
later retrieval.
• When saving a project for the first time it is
necessary to provide a name for the project file. It is
important to note that a saved project file does not
contain any map data. The project file contains
• references to map data, as well as other
information, such as layer symbology.
• Projects are stored on the hard drive with an .epf
extension
SAVING
• Steps for Saving a Project
• Click the [File] on the Main Toolbar
• Click the [Save] item, if this is the first time the
project has been saved,
• the user will be prompted to provide a path and
filename Click the [Save as] item, if the project
has been saved once, but want to save a
different version, a prompt will appear for the
user to provide a new path and filename
The First Project
• Specifying Map Properties
Map Properties - It is important that all data
loaded into a map is in the same map
properties.
• Specifying Map Properties:
• Click on the [Settings] from the main menu or
click on little projector in lower right corner of
screen
Click on the [Project Properties]
• Select the [General Tab]
• Type in a Project Title
• Select the Map Units to be used
the Map units should be in the units that your data is
in i.e. Meters, Feet or Decimal Degrees. Do not set it to
meters if the data is Decimal Degrees
• as this will generate strange results
• Select the Cursor Display Precision.
• Click on the [Projection Tab]
• Click on ‘(Enable on the Flyer Projection)’
• Click on [OK]
TASK1
• Under [General],Type Project name as
‘Penn’, set decimal degrees as the map
unit for this project, set cursor display
precision to manual and 6 decimal
places. Click [Apply]. Click on
[Projection] tab, click on ‘(Enable
Projection on the Fly’. Set Projection as
WGS 84 under Geographic Coordinate
System, Click [OK]
Rendering
By default, QGIS renders all visible layers
whenever the map canvas must
be refreshed. The events that trigger a refresh
of the map canvas include:
• Adding a layer
• Panning or zooming
• Resizing the QGIS window
• Changing the visibility of a layer or layers
QGIS allows the user to control the rendering
process in a number of ways.
• Suspending Rendering: To suspend
rendering, click the ‘(Render)’
• checkbox in the lower right corner of the
status bar.
• When the Render box is not checked, QGIS
does not redraw the canvas in response to
any of the events described above
Rendering
• Examples of when the user might want to suspend
rendering include:
• • Add many layers and symbolize them prior to
drawing
• • Add one or more large layers and set scale
dependency before drawing
• • Add one or more large layers and zoom to a specific
view before drawing
• • Any combination of the above
• Checking the ‘(Render)’ box enables rendering and
causes an immediate refresh of the map canvas.
Setting Layer Add Option:
• The user can set an option to always load
• new layers without drawing them. This means
the layer will be added to the map,
• but its visibility checkbox in the legend will be
unchecked by default.
• To set this option, choose [Options] from the
[Settings] menu and click on the [Rendering]
tab. Uncheck the ‘(New layers added to the map
should be displayed)’ checkbox. Any layer added
to the map will be off (invisible) by
• default.
Updating the Map Display during
Rendering,
• The user can set an option to update the map display as
features are drawn. By default, QGIS does not display
any features for a layer until the entire layer has been
rendered. To update the display as features are read
from the data store, choose [Options] from the
• [Settings] menu and click on the [Rendering] tab. Set
the feature count to an appropriate value to update the
display during rendering. Setting a value of 0 disables
update during drawing (this is the default). Setting a
value too low will result in poor performance as the map
canvas is continually updated during the reading of the
features. A suggested value to start with is 500.
Projections
• QGIS supports on-the-fly projection of vector layers.
This feature allows the user to display layers with
different coordinate systems and have them overlay
properly.
• QGIS has support for approximately 2,700 known
projections. Projections are stored in a database that
is installed with QGIS. Normally the user does not
need to manipulate the database directly. In fact,
doing so may cause projection support to fail.
Custom projections are stored in a user database
OTF
• In order to use OTF projection, the data must contain
information about its coordinate system.
• For PostGIS layers QGIS uses the spatial reference
identifier that was specified when the layer was created.
• For data supported by OGR, QGIS relies on the presence of
a format specific means of specifying the coordinate
system.
• In the case of shapefiles, this means a file containing the
Well Known Text (WKT) specification of the coordinate
system. The projection file has the same base name as the
shapefile and a prj extension.
• For example, a shapefile named lakes.shp would have a
corresponding projection file named lakes.prj.
Usage of Projections
• At startup, QGIS does not have On-the-Fly (OTF)
projection enabled. To use OTF projection, the
user must open the Project Properties dialog,
select a projection for the map, and enable
projections. There are two ways to open the
• Project Properties dialog:
• Select [Project Properties] from the [Settings]
Menu or Click on the projector icon in the lower
right-hand corner of the status bar
• When opening the [Project Properties] dialog
from the [Settings] menu, click on the
[Projection] tab to view the projection
settings.
• Opening the dialog from the [Projector] icon
will automatically bring the [Projection] tab
to the front.
• • (Enable on the fly projection) - This checkbox is used to enable or
disable
• OTF projection.
• When off, no projection takes place and each layer is drawn
• using the coordinates as read from the data source. When on, the
coordinates
• in each layer are projected to the coordinate system of the map canvas.
• • Projections - this is a list of all projection supported by QGIS, including
• Geographic, Projected, and Custom coordinate systems. To use a
coordinate
• system, select it from the list by expanding the appropriate node and
selecting
• the projection.
• QGIS automatically sets the map projection to
the coordinate system of the first layer loaded.
• One way to specify the map projection is to first
load a layer
• with the projection that is wanted for the entire
map. Then open the [Project Properties] dialog
and click on the “(Enable on the fly projection)”
checkbox.
• And finally, close the Project Properties dialog
and add additional layers to the map.
The Quantum GIS Interface
• [File]
• • [New Project] - create a new project
• • [Open Project] – open an existing project
• • [Open Recent Project]
• • ----------------------------------------------------------------------------------
• • [Save Project] – save a project with the existing name
• • [Save Project As] – save a project with a new name
• • [Save as Image]
• • [Export To Mapserver Map] - export as a .map for the web-
server
• MapServer
• • [Print] – call up the Map Composer
• • ----------------------------------------------------------------------------------
• • [Exit] – exit the program
• [View]
• • [Zoom Full]
• • [Zoom to Selection] in Active layer
• • [Zoom to Layer]
[Zoom Last]
• • [Refresh] – redraws the map
• • [Show Bookmarks] – list all existing
bookmarks
• • [New Bookmarks] – create a new bookmark
• • [Add a Vector Layer] – add a data layer
• • [Add a Raster Layer] – add a image layer
• • [Add a PostGIS Layer]
• • [Add WMS layer]
• • [Remove Layer]
• • [New Vector Layer] – create anew data
layer
• • [In Overview] – send to overview map
• • [Add All to Overview] – add all layers to
overview
• • [Remove All from Overview] – removes all
layers from overview
• • [Hide All Layers] – make all layers invisible
• • [Show All Layers] – make all layers visible
• Settings]
• • [Project Properties] – set project information
for layer or project
• • [Custom Projections] – build your own custom
projects
Tools
• Map Zoom Tools
• When working with a map it may be necessary to
zoom in to view an
• area in more detail, or zoom out to see a larger area.
• Zooming In
• Steps for Using the Zoom-in Function
• Zoom in to a specific area. Click and hold the left
mouse. Move the mouse to drag a rectangle to create
the area to zoom to. Release the mouse button to
• complete the zoom.
Zooming Out:
• Steps for Using the Zoom-out Function
• Zoom out to a specific Area. Click and hold the
left mouse button, Move the mouse to drag a
rectangle to create the area. The current map
extent will be resized to fit in the rectangle
drawn. As a result the smaller the rectangle
the further the map will zoom out. Release
the mouse button to complete the zoom.
Zooming to Full Extent
• Zooming to full extent resets the map view so
that every feature of very layer is contained
within the visible extent
• 10.4.3 Steps for Zooming to Full Extent
• [Zoom Full] button on the Tools toolbar
• Or click on [View] then [Zoom Full]
Zooming to Last Extent:
• General Information for Zooming to Last
Extent
• Zooming to last extent allows stepping back
to last map view.
• For example, start with a map view at full
extent then zoom in to an area on the map.
• Now click the last button; the map will return
to the previous map view, which was the full
extent.
• Steps for Zooming to Previous Extent
• For Zooming to Last Extent – Click the [Zoom
Last] button on the Tools
• Zoom to Layer
• Zoom to a layers extent will set the map
display to an area just big enough
• to show every feature in a particular layer.
Steps for Zooming to Layer Extent
• Click on the [Zoom to Layer] button on the
Map Navigation Toolbar or
• Right-click on the layer in the legend, a new
menu will popup.
• Click on [Zoom to Layer Extent]
Panning
• General Information for Panning
• Panning allows the user to move the map
display around to show areas outside of the
current viewing area without changing the
scale of the map.
Steps for Panning
• Click the [Pan] button on the Map Navigation
Toolbar.
• Move the mouse over the map.
• Click and hold down the left mouse button.
• Move the mouse, still holding down the
mouse button. The map will move
• with the mouse.
• Release the mouse button to complete the
pan operation
Measuring distance
• The measurement tool is used to calculate
distances between 2 or more user-defined
points on the map.
• Measuring Distance
• Click the [Measure Line] tool on the Map
Navigation Toolbar.
• Move the mouse over the map to the starting
position. Using the left mouse button, Click
once, and now move to the next position.
• A line will draw as the mouse moves.
• Using the left mouse button, click once to define the
end position
• Repeat steps 3 and 4 to create a multi point line as
necessary. The distance will be calculate and
displayed in a popup window. The upper window
column is the length of each segment while the
bottom column is the cumulative length
• Right Clicking will reset the measuring tool.
Measuring Area
• The measurement tool is used to calculate
area within 3 or more userdefined
• points on the map
• Click the [Measure Area] tool on the Map
Navigation Toolbar.
• Move the mouse over the map to the starting
position.
• Using the left mouse button, Click once, and
now move to the next position. A line will
draw as the mouse moves. Using the left
mouse button, click to create a second point
• Using the left mouse button, click to create a
third point
• Repeat steps 5 to create as many points for
the area as necessary.
• The total area will be calculate and displayed
in a popup window.
• Right Clicking will reset the measuring tool.
Vector Data
• Adding Vector Map Data
• QGIS supports numerous GIS data formats
that can be added to a project
• with a few simple clicks. It should first be
determined if the GIS data is in a vector
format that is compatible with Quantum GIS
by using the list below: ESRI® Shapefiles
(*.shp)
• QGIS supports vector data in a number of formats, including
shapefiles, MapInfo mif, and PostGIS layers in a PostgreSQL
database. Support for additional data types is provided by
Plug-ins, for example delimited text. Many of the features
available in QGIS work the same regardless of the vector
data source. This is by design and includes the identify, select,
labeling, and attributes functions
• PostGIS layers are stored in a PostgreSQL
database. The advantage of PostGIS is the
spatial indexing, filtering, and query capability.
Using PostGIS,vector functions such as select
and identify work more accurately than with
OGR layers in QGIS. Each GIS data set will be
added to the map project as a single layer
Adding Vector Map Data
• Adding data using [Layer] then [Add a Vector
Layer] or Click on the [Add a Vector Layer]
icon on the [Data] Toolbar
• Browse to the location of the GIS data.
• Click on the GIS data you want to add as a
new layer in your project. If you want to add
multiple layers, hold down the control key and
• select each addition layer by clicking on it.
Task
• Uncheck the render box in the lower right
corner, add afrbeppp020, airportx020,
coalfdp050, countyp020, ecoomrpr075,
ecoregp075, fedlandp020, hydrogpl020,
hydrogpp020, mortalp020, railrdl020,
roadtrl020, statep020, urbanp020, and
zmussel020 layers to the project.
• Turn the Statep020 Layer on by putting the check in the box
next to the layer name. Put a check in the render box.
• The legend is a graphical representation of all the map layers
in the current project. The default position of the legend is
docked on the left hand side of the screen. The legend offers
layer manipulation functionality including but not limited to
changing a layers symbology or its order in the drawing
process.
Steps for Changing the Layer
Name
• Right-click on the layer in the legend and a
new menu will popup. Click on the [Properties]
and the Layer Properties dialog will be
• displayed. Click on [General] Tab
• Change the text in the “Display Name” box.
This will be the new layer name. Click the
[OK] button to close the Layer Properties
dialog. The legend will update to show the
new layer name. Or right-click on the layer in
the legend and a new menu will popup Click
on [Rename] Highlight the name in the
legend and type in new name
Task
• change afrbeep020 to Africanize Honey Bees
• • airportx020 to Airports
• • coalfdp050 to Coal Fields
• • countyp020 to U.S. Counties
• • ecoomrpr075 to Ecoregions – Omernik
• • ecoregp075 to Ecoregions – Bailey
• • fedlandp020 to Federal Lands
Change
• hydrogpl020 to Rivers and Streams
• • hydrogpp020 to Lakes and Ponds
• • mortalp020 to Mortality 1988-1992
• • railrdl020 to Railroads
• • roadtrl020 to Roads
• • statesp020 to U.S. States
• • urbanp020 to Urban Areas
• • zmusslx020 to Zebra Mussels
Changing the Drawing Order:
• General Information for Changing the Drawing
Order:
• The legend indicates the order that layers are drawn
in. The first layer in the legend is the top layer of the
map. The last layer in the legend is the bottom layer
on the map. The layers are drawn from bottom up,
hence the bottom layer is drawn first then the last
but one layer and so on. As a result is it important to
• carefully order the map layers so data is not
obscured by layers placed on top.
• Changing the Drawing Order:
• Click and drag a layer to the desired location.
• Put the layers in the following order from top to bottom,
• • Zebra Mussels
• • Africanized Honey Bees
• • Airports
• • Roads
• • Railroads
• • Mortality 1988-1992
• • Rivers and Streams
• • Lakes and Ponds
• • Federal Lands
• • Urban Areas
• • Coal Fields
• • U.S. Counties
• • Ecoregions – Omernik
• Ecoregions – Bailey
• • U.S. States
• Save your project
• Removing a Layer from the Map
• General Information for Removing a Layer
from the Map
• Removing a layer does not remove or delete
the underlying data, it just
• removes the reference to the layer from the
project
• Steps for Using the Removing a Layer from
the Map
• Right-click on the layer in the legend, a new
menu will popup
• Click on [Remove]
• Making the Layer Scalable
• General Information for Making the Layer
Scalable
• When adding a new data layer to the project
the default scale dependency
• will be set to all. Essentially meaning that the
layer will be visible at all scales.
• If map units have been set for this project it is
possible to make any of the layers
• scale dependent, that is, visible between
certain scale bounds.
• For example, for a layer to be visible below
1:50000 set Min Scale to 1
• and Max Scale to 50000. For a layer to be
visible between 1:20000 and 1:50000
• set Min Scale to 20000 and Max Scale to
50000
• Steps for Using the Making the Layer Scalable
• Right-click on the layer in the legend, a new
menu will appear.
• set the maximum scale for U.S. Counties to be
2500000 and the
• minimum scale to 2400, check the ‘(use scale
dependent rendering)’ turn on U.S.
• Counties.
• Zoom out to the Full extent of the map using
the [Zoom to Full Extent] Button
• using the [Zoom Last] and [Zoom to Full
Extent], you can
• switch between the Great Lakes and the
Whole coverage
• Turn on the Coal Fields layer and zoom to its
extent
• Zoom into the area around the Great Lakes
until the counties appear. what is your current
map scale? It is on the lower right of
• screen Scale 1: ?
• Zoom to extent of Zebra Mussels
• what is your current map scale? It is on the
lower right of
• screen Scale 1: ?
• 26/9 Are there coal Fields in Wisconsin? Are
there coal fields in New York State?
Map Layer Symbolization
• General Information for Map Layer
Symbolization:
• Default Symbology - When adding a new map
layer to the project a
• default symbol will be automatically
generated. QGIS will select a random color
• scheme and pick a pen and fill style
appropriate to the geometry type of the data
• to be used for display purposes.
• GIS supports a number of symbology
renderers to control how vector
• features are displayed. Currently the following
renderers are available:
• • Single symbol - a single style is applied to
every object in the layer.
• • Graduated symbol - objects within the layer
are displayed with different
• symbols classified by the values of a particular
field.
• • Continuous color - objects within the layer
are displayed with a spread of
• colors classified by the numerical values
within a specified field.
• • Unique value - objects are classified by the
unique values within a specified
• field with each value having a different
symbol.
• For layers containing point features, additional
renderers are available that
• use SVG icons:
• • Single marker - a single specified icon is used
for every point within the layer.
• •
• Graduated marker - points within the layer
are displayed with different icons
• classified by values within a particular field.
• • Unique value marker - points are classified
by unique values within a
• specified field with each value having a
different icon.
Changing the Default Symbology
• Steps for Changing the Default Symbology
• Right-click on the layer in the legend, a new
menu will appear
• Click on [Properties], the Layer Properties
dialog will be displayed
• Click on the [Symbology] tab. Changes made
under the outline style and
• Fill Patterns sections will become the new
default symbology
• Change the color of the U.S. States Layer. Click on it
in the
• legend, Click [Properties]. Click the Fill color, select
‘define custom Color’ and
• set it to Red, Green Blue(RGB) Values of 240,219,0;
Click [Add to Custom
• Colors]; Click [Ok]; Click the Line color and set it to
RGB 0,97,73; Click [Add
• to Custom Colors]; Click [Ok]; Leave Transparency
set at 0%, Click [OK].
• TASK #15 Change the color of the Coal Fields,
Click on it in the legend,
• Click [Properties]. Set Legend type to “Unique
Value”, set categorised field to
• “Descriptio”. Click [Apply], A list will appear
with all the values, Set the following values.
Name RGB Value
• Anthracite / other uses 191,71,31
• Anthracite / potentially minable 160,137,115
• Lignite / other uses 98,1,59
• Lignite / potentially minable 226,137,169
• Low Volatile Bituminous / other uses
32,238,125
• Low Volatile Bituminous / potentially minable
136,238,179
• Medium and High Volatile Bituminous /
other uses 179,11,136
• Medium and High Volatile Bituminous /
potentially minable 179,136,179
• NO COAL / INTERNAL POLYGON hollow
• Subbituminous / other uses 255,170,0
• Subbituminous / potentially minable
255,170,75
Questions
• #4 what is the color of the coal fields in
Michigan?
• #5 Using the [Identify Features], what type of
coal is in Michigan?
• #6 Using the [Identify Features], what type of
coal is found on the eastern side of the large
coal fields that extend from New York State
southwest to Alabama?
• #7 Make sure your map units are decimal
degrees and your project is WGS 84. What is
the approximate length of the Coal field
described in #6?
• #8 What is the approximate area of the Coal
field in Question #6?
Changing Selected Symbology
• Selected symbology is used to render a feature that
has been selected.
• By making this symbol different from the main
default symbol it is easy to see which features on the
map are selected
• Steps for Changing the Default Symbology
• Click on [Settings]
• Click on [Project Properties]
• Click on the Colored bar under Map Appearance and
set the color to desired choice.
Adding a Label to a Layer
• Label themes are an easy method to add
dynamic text labels to geometry feature on
the map. QGIS will extract a user-defined
field from the map data to be used as the
label text.
Steps for Adding a Label to a Layer
• Right-click on the layer in the legend, a new
menu will appear
• Click on [Properties], the Layer Properties
dialog will be displayed.
• Click the [Labels] tab
• Select the ‘(Field containing label)’
• Select the ‘(display labels)’ so a check
appears.
• Click [OK]
TASK
• Label U.S. Counties with the County names.
Zoom in until the counties and their name
appear and then zoom out again to the Zebra
Mussel Coverage
• Turn on Lakes and Ponds, Open the layer
property, Change ‘Legend Type’ to “Unique
Value”,
• Set the ‘Classification Field’ to “feature”.
• Click [Apply],
• Click on the [blank] Button under ‘Outline
Style’.
• Click on the Null Feature
• Click on the [hollow] button under ‘Fill
Patterns’. This turns off the Outline
• Click [Apply]
• This will make the null layer invisible
• Repeat these steps for the ‘Glacier’ Feature
• Now Select ‘Bay or Estuary or Ocean’ Feature,
Click on the fill Color and set the RGB to
• 76,143,209
• Turn off the Outline as well just like the ‘Null’
Feature Repeat these steps for Canal, Lake,
Reservoir, and Stream
• For the ‘Swamp or Marsh’ Feature, hide the
outline and set RGB to 76,209,185
• For ‘Lake Dry’, ‘Lake Intermittent’, ‘Reservoir
Intermittent’, hide the Outline and set the
• RGB to 197,132,2 Click [OK]
TASK
• #18 Open the County File, on the symbology
page, set the Fill to Hollow, then Click [OK]
• #9Are there swamps in both North Carolina
and South Carolina?
• #19 Turn on Rivers and Streams, Right click
on it in the legend, Click on [General] tab,
check the ‘(use scale dependent rendering)’
set the maximum scale for Rivers to be 5000
and the minimum scale to 2400 Click the
[Properties]. Click the [Symbology] tab. Click
the outline color and set it to (RGB) Values of
• 29,190,224; Click [Add to Custom Colors];
Click [Ok]; Click [Ok] Click [Ok]Click “Close”.
• Save Project
TASK
• #20Turn on Urban Areas, Right click on it in
the legend, Click the [Properties]. Click the
[Symbology] tab. Set outline Style to Blank;
Click the fill color and set it to (RGB) Values of
244,150,104; Click [Add to Custom Colors];
Click [Ok]; Click the Outline color and set it to
blank;
Task
• Zoom into New England (This should include
the states of NewYork on the West and Maine
on the East.
Querying Map Features
• Identifying features - The identify tool is the
simplest way to retrieve attribute data about a
feature on the map
• The identify result tool has a limited radius of
effect.
• Click the [Settings] menu from the main
menu. Click on the [Options] tab
• Click on [Selection and Measuring]
• Enter a valid search radius.
• Press the [OK] button.
Steps for Querying Map Features
• Click the [Identify] button on the toolbar.
• Move the mouse over the map and click on
the feature to be identified.
• The Identify Results dialog will be displayed.
TASK
• Zoom into the state of Maine.
• What is the northern most county in Maine?
• What are size in square miles of this county?
Selecting Features by Rectangle
• Allows the user to select features on the map by
drawing a rectangle. Any features of the active layer
that fall within the selection tolerance of the rectangle
will be selected
• Steps for Selecting Features by Rectangle
• Click on the layer that has features to be looked at
from on the legend. This will make the layer active.
• Click the [Select Features] button on the toolbar.
• Move the mouse over the map and click and hold the
mouse button. This click will represent the first corner
of the rectangle.
• Move the mouse to another location, keeping
the mouse button held down.
• Release the mouse button to specify the
opposite corner of the rectangle.
• Features of the active layer that fall within the
selection tolerance will be selected and
drawn. by holding down the control key, you
can draw additional rectangles and add the
selection to the original selected data.
To view attribute data of selected features, click on
[Open Table] in the ‘Attributes Toolbar’, the
Attribute Table dialog for the layer will open.
• Click on the [Move Selected to Top] button to see
the attributes of the selected features moved to the
top of the table
• TASK
• turn on Urban Areas, click on it in the legend, click
on properties, Set the outline style to ‘blank’ , click
the fill color and set it to RGB of 244,150,104; click
[Add to Custom Colors]; click [Ok]; click [Ok].
• Click on the [Move Selected to Top] button to
see the attributes of the selected features
moved to the top of the table.
• TASK #24 turn on Urban Areas, click on it in
the legend, click on properties,
• Set the outline style to ‘blank’ , click the fill
color and set it to RGB of 244,150,104; click
[Add to Custom Colors]; click [Ok]; click [Ok].
• QUESTION . In the eastern most county of
Maine (Washington County), what are the
names of the six towns?
Selecting Features by Attribute
• Selecting by Attribute allows the user to select features from within the
• attribute table of the layer.
• Steps for Selecting Features by Attribute
• Click on the layer that has features to be looked at from on the legend.
• Click on [Open Table] in the ‘Attributes Toolbar’, the Attribute Table
• dialog for the layer will open. Type in the search attributes, select the
column that is to be searched, and the type of selection to be done. Click
[Search] There are several options that can be done
• • [Remove Selection] – Unselects the values just selected
• • [Move Selection to Top]
• • [Invert Selection]
TASK
• open attribute table for Urban Areas, Search
for ‘WA’ in the‘STATE’ Attribute column, and
have it select them.
• How many features were selected?
• Search for the town of ‘Machias’ in ‘Name’.
Was it found?
Data Creating and Editing
• Creating a New Layer
• To create a new layer for editing, choose [New Vector Layer]
from the [Layer] menu. The ‘New Vector Layer’ dialog will be
displayed. Choose the type of layer (point, line, or polygon).
To complete the creation of the new layer, add the desired
attributes by clicking on the [Add] button and specifying a
name and type for the attribute.
• Only real, integer, and string attributes are supported
• Click [Ok] and provide a name for the shapefile. QGIS will
automatically
• Add a .shp extension to the name specified.
• When the program asks for the layer Projection, make sure
the Radio button ‘EPSG ID’ is selected
• TASK #26 Turn on airports, click on [Layer] then
[New Vector Layer], select ‘line’, then click on [Add],
make the name “number”, type is’ integer’, click
[OK], click [OK] to close the new layer. save it as
‘lines’, click [Save], Set projection as Projected
Coordinate system, U.S. National Atlas, Equal Area,
Select “EPSG ID (numeric codes associated with coordinate system definitions. For
instance, EPSG:4326 is geographic WGS84)”, click [OK], click on ‘Capture
Line’, draw a line between the two airports in
Aroostook County. Save changes
• QUESTION #19 what is the distance between the
two airports as measured down the line?
• Penobscot county is just south of Aroostook County
near the center of the state, click on [Layer] then
[New Vector Layer], select ‘polygon’, then click on
[Add], make the name “number”, type is’ integer’,
click [OK], click [OK] to close the new layer. save it
as ‘polygon’, click [Save], Set projection as Projected
Coordinate system, U.S. National Atlas, Equal Area,
Select “EPSG ID”, click [OK], click on ‘Capture
Polygon’, draw a polygon covering the three
airports in Penobscot County. Save changes
• QUESTION What is the area between the three
airports measured in square kilometers?
Editing a Layer
• QGIS supports basic capabilities for editing
spatial data. Before performing any edits,
always make a backup of the dataset you are
about to edit.
Steps for Editing a Layer
• To edit an existing layer, click on the legend
entry for that layer then choose [Start Editing
the Current Layer] from the ‘Digitizing
Toolbar’.
• Remember to backup the data to be edited
before starting!
• Now that the layer is editable, use the [Capture
Points] icon (or similar icon for line and polygon
layers) on the ‘Digitize toolbar’ to put the QGIS
cursor into digitizing mode. If capturing a point
feature, simply use the pan and zoom tools to
navigate to the area of interest, then click the
[Capture Points] tool
• and click on the map area to create the new point
feature.
• A window will appear allowing the user to set the
attributes, type in the data, press [Ok].
• When finished editing features, choose [Stop
Editing] from the layer’s context menu.
Choosing [Yes] will save the changes to disk,
while choosing [No] at this point will cause
them to be discarded.
Working with Raster Data
• General Information for Working with Raster
Data
• Definition: Raster data in GIS are matrices of
discrete cells that represent
• features on, above or below the earth’s
surface. Each cell in the raster grid is the
• same size, and cells are usually rectangular (in
QGIS they will always be rectangular).
Raster datasets
• Typical raster datasets include remote
sensing data such as aerial photography or
satellite imagery and modeled data such as an
elevation matrix(DEM).
• QGIS supports a number of different raster
data formats. Currently tested
• Unlike vector data, raster data typically do
not have an associated database record for
each cell.
Loading Raster Data
• Raster layers are loaded either by clicking on
the [Load Raster] icon on the ‘Manage Layers
Toolbar’ Or by selecting the [Layer] and then
[Add Raster Layer] menu option.
• More than one layer can be loaded at the
same time by holding down the Control key
and clicking on multiple items in the file
dialog.
• TASK Turn off all layers in the Project. Load
the image ‘shdrlfi020l.tif’ into the Penn
project, move it to the bottom of the legend
and make it visible. Right Click on
shdrlfi020l.tif and rename it” Shaded Relief’
Raster Properties
• QGIS supports three forms of raster layers:
• • Single Band Grayscale Rasters
• • Palette Based RGB Rasters
• • Multi-band RGB Rasters
• From these three basic layer types, eight
forms of symbolized raster display can be
used:
• • Single Band Grayscale
• • Single Band Pseudocolor
• • Paletted Grayscale (where only the red,
green or blue component of the image
• is displayed)
• • Paletted Pseudocolor (where only the red,
green or blue component of the
• image is displayed, but using a pseudocolor
algorithm)
• • Paletted RGB
• • Multi-band Grayscale (using only one of the
bands to display the image)
• • Multi-band Pseudocolor (using only one of
the bands shown in pseudocolor)
• • Multi-band RGB (using any combination of
three bands)
• QGIS can invert the colors in a given layer so
that light colors become
• dark (and dark colors become light). Use the
Invert Color Map checkbox to
• enable / disable this behavior. QGIS has the
ability to display each raster layer at
• varying transparency levels. Use the
transparency slider to indicate to what extent
• The transparency can also be set using the
transparency slider in the layer context menu
which is accessible by right-clicking on the layer
in the legend.
• the underlying layers (if any) should be visible
though the current raster layer.
• The transparency can also be set using the
transparency slider in the layer context
• menu which is accessible by right-clicking on
the layer in the legend. Right Click on Shaded
Relief layer and select properties, on the
• symbology tab, select “(Invert Color Map)”,
Click [OK]
What happened to the color of the water?
• The General tab displays basic information
about the selected raster, including the layer
source and display name in the legend (which
can be modified). This tab also shows a
thumbnail of the layer, its legend symbol, and
• the palette.
• The Metadata tab displays a wealth of
information about the raster layer,
• including statistics about each band in the
current raster layer. Statistics are gathered on
a ’need to know’ basis, so it may well be that a
given layers statistics have not yet been
collected.
• To gather statistics for a layer, select
pseudocolor rendering and click the
• [Apply] button, Gathering statistics for a
layer can be time consuming. Please be
• patient while QGIS examines the data!
• Large resolution raster layers can slow
navigation in QGIS, By creating lower
resolution copies of the data (pyramids),
performance can be considerably improved as
QGIS selects the most suitable resolution to
use depending on the level of zoom.
• If the user forgets to check ‘projection on the
fly’ and add an image to a set of shapefiles
layers and they are in different projections, it
may exit the program.
Note
• If the user tries to reproject the image by setting ‘projection
on the fly’ and then adding shapefile layers in one projection
(thus setting the projection for the project) and then add a
image layer in a different projection, it may exit the program.
Add the image to the project first, check ‘projection on the
fly’, add shapefile layers, do not reproject while images are
loaded.
Plug-ins and Extensions
• QGIS has been designed with a Plug-in
architecture. This allows new
• features/functions to be added to the
application. Many of the features in QGIS
• are actually implemented as Plug-ins.
• There are two types of Plug-ins in QGIS: core
and user-contributed. A core Plug-in is
maintained by the QGIS development team
and is part of every QGIS distribution. A user-
contributed Plug-in is an external Plug-in that
is maintained by the individual author. The
QGIS Community site (http://qgis.org) serves
as the repository for user contributed Plug-ins.
Usage of Plug-ins
• Managing Plug-ins consists of loading or
unloading them from QGIS. Loaded Plug-ins
are “remembered” when the user exits the
application and restored the next time QGIS is
run. To manage Plug-ins, open the [Plug-in
Manager] from the [Tools] menu.
• The Plug-in Manager displays all the available
Plug-ins and their status (loaded or unloaded).
Adding Data Using the Delimited Text Plug-in
• General Information for Adding Data Using
the Delimited Text Plug-in. The Delimited Text
Plug-in allows the user to load a delimited text
file as a layer in QGIS. Setup for Adding Data
Using the Delimited Text Plug-in: To view a
delimited text file as layer, the text file must
contain: A delimited header row of field
names. This must be the first line in the text
• File •
• The header row must contain an X and Y field.
These fields can have any name. The x and y
coordinates must be specified as a number.
The coordinate system is not important
• An example of a valid text file might look like this:
• name, latdec, longdec, cell,
• 196 mile creek,61.89806,-150.0775,tyonek d-1 ne,
• 197 1/2 mile creek,61.89472,-150.09972,tyonek d-1 ne
• a b mountain,59.52889,-135.28333,skagway c-1 sw,
• apw dam number 2,60.53,-145.75167,cordova c-5 sw,
• apw reservoir,60.53167,-145.75333,cordova c-5 sw,
• apw reservoir,60.53,-145.75167,cordova c-5 sw,
• aaron creek,56.37861,-131.96556,bradfield canal b-6,
• aaron island,58.43778,-134.81944,juneau b-3 ne,
• aats bay,55.905,-134.24639,craig d-7,
• Some items of note about the text file are:
• • The example text file uses , as delimiter. Any
character can be used to delimit the fields.
The first row is the header row. It contains the
fields name, latdec, longdec, and cell. No
quotes (") are used to delimit text fields
• The x coordinates are contained in the
longdec field. The y coordinates are contained
in the latdec field
Adding Data Using the Delimited
Text Plug-in
• Open the Plug-in Manager by choosing the
[Tools] then the [Plug-in Manager] menu. The
Plug-in Manager displays a list of available
Plug-ins. Plugins that are already loaded have
a check mark to the left of their name.
• Click on the checkbox to the left of the [Add
Delimited Text Layer] Plugin and click [Ok] to
load it. Click on [Add Delimited Text Layer] on
Plug-in toolbar. This will open the Delimited
Text dialog.
• First select the file to import by clicking on the
ellipsis button: Select the desired text file from
the file dialog. Once the file is selected,
• the Plug-in attempts to parse the file using the
last used delimiter, in this case ‘,’
• If the delimiter ‘,’ is not correct for the file, the
X and Y field drop-down boxes will not contain
valid field names. To properly parse the file,
change the delimiter
• After changing the delimiter, click [Parse].
The drop-down boxes now contain the fields
properly parsed.
• Choose the X and Y fields from the drop down
boxes and enter a Layer name.
• To add the layer to the map, click [Add
Layer]. The delimited text file now behaves as
any other map layer in QGIS.
• TASK place several Buoys off the northeast
coast. Using a text editor like wordpad or
notepad, create a file with the following data
in it.
• Station, lat, long,comment
• 44013,42.35,-70.69,Boston 16 NM east of Boston
• 44018,41.26,-69.29,SE Cape Cod 30 NM East of
Nantucket MA
• 44027,44.27,-67.31,Joneport ME
• 44005,43.19,-69.19,Gulf of Maine 78 NM East of
Portsmouth NH
• 44007,43.53,70.14,Portland 12 NM Southeast of
Portland ME
• Add save it as buoys.txt
• NOTE Remember, The data is in WGS84 and
should be set as the projection when creating
the shapefile. Click on [Tools] then [Plug-in
Manager] menu, Turn on [Delimited Text]
Plugin, open the Delimited Text dialog, select
buoys.txt to import, make sure the delimiter is
‘,’ Choose ‘long’ as the X field and ‘lat’ as the Y
field, enter a Layer name of ‘buoys’, click [Add
Layer]. Label the buoys by using the station
number
• What are the buoys from north to south?
• In order to do any further editing of this file
you have to rightclick on the file just created
and select [Save as Shape File]. If the user
opens the buoy layer attribute table without
resaving it as a shapefile, the attribute table
• may be missing data.
• TASK resave the buoys as a shapefile named
NEBuoys
Georeferencer Plug-in
• QGIS Geo-referencing Plug-in is a tool that
can generate world files for raster files. World
files are small text files that contain the world
coordinates for the upper left corner of the
raster, and the size in world coordinate units
of every raster pixel. This Plug-in can be used
to add world files to scanned paper maps, so
the user can use them in a project with other
datasets covering the same area.
Use of Georeferencer Plug-in
• To figure out the coordinates for the raster's
upper left corner and the size of the pixels, the
Plug-in needs to know the world coordinates
for some points in the raster. The user can
supply these coordinates by clicking on points
in the raster and entering their coordinates in
a popup window. The more coordinates
• given, the better the generated world file
should fit the "real" coordinates.
• When the user thinks that enough coordinates
have been entered, tell the Plug-in to
generate the world file. The Plug-in will then
try to fit a certain transform to the given
coordinates.
• The user can choose between two types of
transform, "Linear" and "Helmert".
Transform
• If the user chooses the "Linear" transform
type (which isn't really linear in the
mathematical sense but it is a combination of
two separate line functions in the X and Y
coordinates) the Plug-in will assume that the
raster only needs to be scaled and translated
to fit the map, and it will simply generate a
world file for the original raster file.
• If the user on the other hand chooses the
"Helmert" transform the Plug-in will assume
that the raster also needs to be rotated to fit
the map (this is useful if the user has scanned
a paper map and couldn't get it to line up
perfectly in the scanner). A new raster file will
be generated, which is a rotated copy of the
old raster, and a world file will be generated
for this new raster file instead
• If the user chooses the "Helmert" transform
he/she will also get to choose the resampling
method for the rotation - "Cubic" or "Bilinear"
is best for RGB raster, but "Nearest neighbor"
should be used for raster that use an indexed
colormap.
Assignment
• By use of appropriate illustration, explain the
following types of raster compaction techniques
12mks
• i) Run-length encoding
• Ii) Quadtrees
• Iii) Chain coding
•
• c) Discuss the technique used by the Universal
Transverse Mercator (UTM) for geo-referencing
8mks