QGIS Module 2

776 views

Published on

Module 2: Attribute Tables and Adding Data to QGIS

Published in: Self Improvement
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
776
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
60
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

QGIS Module 2

  1. 1. SessionTwo: •Attribute Tables and •JOIN: how to add data to QGIS
  2. 2. Why are attribute tables important? Attribute tables define the elements of a shapefile and allow you to see what is “inside” the layer. They also allow you to zoom, highlight and select for other operations.
  3. 3. “Flat File” with columns and rows Row = geographic feature record Column = attribute field (item of information about a feature)
  4. 4. Attribute field general types • Numeric (integer or decimals) • Text (string) • Date • Blob (binary large object) Source: http://www.esi.utexas.edu/gk12/workshops/gis/ppts.php
  5. 5. Each different layer has its own attribute table so when we open a new one here…
  6. 6. ATTRIBUTE TABLE CAN BE USED TO ZOOM INTO A SELECTED FEATURE – IN THIS CASE A DISTRICT; HIGHLIGHT THE ENTIRE ROW TO SELECT IT
  7. 7. THE SELECTED FEATURE IS LARGE AND HIGHLIGHTED IN YELLOW
  8. 8. YOU CAN USE THE ZOOM FEATURES ON THE TOOLBAR TO ZOOMOUT TO SEE THE SELECTION IN CONTEXT OF THE COUNTRY
  9. 9. De-select on toolbar to end the highlighted area
  10. 10. JOIN • Basic to all GIS programs is “joining” • This is how tables of data (excel, csv, etc) are transformed into maps • For example, HIV prevalence by province
  11. 11. Change data form Must change the data format from EXCEL or other database into a form that QGIS can use • The easiest process is using .dbf • .dbf is an “old” data file type (dbase) BUT shapefiles contain .dbf file data which is why we use them • To convert we need LibreOffice
  12. 12. LIBRE OFFICE • Open Libre office and open your excel data (name of excel file or type of data)
  13. 13. In Libre Office choose spreadsheet
  14. 14. View the data you want to add.. Save as “name”.dbf inside data folder
  15. 15. Open or maximize QGIS • You will now add your .dbf file that you created in Libre Office to the map layers you are already displaying • Click on “add vector layer”
  16. 16. 1. 2. 3.
  17. 17. Open “attribute layer” for moz_adm1 • Find the column that has the name of the provinces in it.
  18. 18. JOIN in QGIS • Double click on moz_adm1 • When layer opens click on “join” tab
  19. 19. 11.You will see this. Note default target field ID_0 2. You MUST change target field! You need to match “like” with “like” so if you have province data, in this case provincia, you must match with QGIS’s province layer, in this case NAME_1.
  20. 20. Return to Map Layers and double click on moz_adm1
  21. 21. Check to see that the two layers have been added by hitting the tab called fields.can you see them?
  22. 22. DOUBLE CLICK ON MOZ-ADM1 CLICK ON GENERAL, NOW CHANGE THE TITLE TO RESAVE THE LAYER UNDER A NAME WHICH REFLECTS YOUR DATA
  23. 23. RENAME THE FILE CLICK OK
  24. 24. “Joining”: putting table data inside the map layer
  25. 25. Now make sure to change the column so it is set to the file with prevalence that you wish to map. You DO NOT want Column set to ID_0 which is the default. It will crash your computer.
  26. 26. How to change the classification Double click on a row to begin. Be sure to select “label” afterward to ensure that your changes are reflected in your labels. This is also an opportunity to simplify the label presentation.
  27. 27. Prevalence map with province names
  28. 28. OK! Now try this with your own data…. If you don’t have data make up data to practice
  29. 29. Adding two variables to one map layer
  30. 30. How to map a second presentation of prevalence onto one map: using symbols • This step shows you how to map a second level of prevalence, HIV prevalence in men (MHIVPREV) onto a map where the colors of provinces represent the HIV prevalence of women
  31. 31. Here is the final map with the male and female HIV prevalence Male HIV prevalence is represented as the pink dots and female HIV prevalence is represented within the blue shaded province layers.
  32. 32. Now go back to the diagram layer, where you see pie chart and choose text diagram. What do you think?
  33. 33. End session 2 Thank you!

×