You are on page 1of 12

Page1of 12

TM 620: Environmental Management (using GIS Technologies)


January-February 2016

Instructor: Al Tongco PhD


Founding Director of Philippine GIS Data Clearinghouse (www.philgis.org)
Email:al_tongco@yahoo.com
, Globe Cell: 0905-332-4448

ACT05: Creating New GIS Datasets and Joining Tables

Purpose: To learn how to create a new GIS dataset and joining tables.

Open QGIS.

In Menu Bar, click Project > Project Properties. Set the parameters as shown.

Click CRS tab.


Enable on the fly'
Coordinate Reference System: WGS 84 / UTM zone 51N

Click OK.

ClickAdd Vector Layer


tool.

Browse the folder C:\.....\MYDATA\VECTORS\PHL_adm_shp_28\

Add PHL_adm2.shp
.
Page2of 12

Open its attribute table.

Calculate a new field and name it Area_HA (in hectares) using a QGIS function.

Click OK.
Page3of 12

Save edits.
Click Toggle edit' tool.

Select by expression.

Click Select.

Save as
CebuMunis.shp
. Save in C:\...\OUTPUT\VECTORS\

Click Deselect Features from All Layers' tool


..
Page4of 12

Using Layer Properties


CebuMunis
of , map Area_HA', as Categorized, as shown:

Click OK.

Map Area_HA' using Graduated: 5 classes, as shown.


Page5of 12

Click OK.

Save project ACT05_CebuMunis_Join.qgs


as .

Save in C:\.....\OUTPUT\PROJECTS
Page6of 12

Joining Tables

Let's join the population values of Cebu towns with theCebuMunis.shp.


GIS dataset

Go tohttp://nap.psa.gov.ph/activestats/psgc/default.asp
and copy-and-paste the population data
for Cebu towns.

Copy and paste in WPS Spreadsheet.

Save as
CebuTowns.csv
in C:\.....\Desktop\USC_GIS\MYDATA\TABLES

The following spreadsheet functions are useful in editing the table to make it ready for integration
with QGIS:

MID
Page7of 12

Copy and Paste Special > Values


PROPER
(Instructor will give a demo how to do this portion.)

Save the cleaned up table


CebuTowns.csv
as , as shown below:

(IMPORTANT: The MUNICIT entriesCebuTowns.csv


of should be exactly the same as those of
NAME_1 in the attribute table
CebuMunis.)
of

Close the table.


Click Delimited text layer' tool
and add
CebuTowns.csv
to QGIS.
Page8of 12

Click OK.

Open the Properties > Fields


CebuTowns.csv.
of

Note that VOTER_10, POPN_10, and HECTARES should be integer type.

If Type name' is integer', click OK.


Page9of 12

(If text', remove


CebuTowns.csv
from the Layer Panel, and convert the fields in WPS Spreadsheet
to become numeric. Redo the adding process.)

The Join Process

First, make the following changes in attribute names to synchronize joining process:

Under NAME_2 CebuMunis


of dataset, replace Cordoba' with Cordova', and replace Carcar' with
Carcar City'. [Hint: Use Toggle Editing tool.]

Open the PropertiesCebuMunis.


of

Click the Plus sign to open the Add vector join' window

Fill out the blanks as shown above.

Click OK.

Open the Attribute Table


CebuMunis
of to check if the join process is successful.
Page10of 12

The table shows that the join process is successful.

Save as
CebuMunis
asCebuMunis_Join
in C:\.....\Desktop\USC_GIS\OUTPUT\VECTORS

Compare the areas of towns as calculated by QGIS (Area_HA) and those from PSGC. What can you
conclude? And why?

You may close the tables.

Now you can remove


CebuTowns, CebuMunis,
andPHL_adm2.

AddPHL_adm1.

Apply random colors to Cebu towns and transparency to provinces similar to the one shown below.
Page11of 12

Save Project.

YOUR TURN: Repeat the ACT05 using Region 8. Save the


ACT05_LeyteMunis_Join.qgs
project as in
C:\......\PROJECT folder.

NOTE: Use appropriate names in assigning for Leyte towns.

Exit QGIS.

End of Exercise.
Page12of 12

You might also like