In our previous exercises, we worked with existing datasets that had to be created previously. In this exercise, we will learn how to create vector datasets using a raster image from Google Earth.

4.3.1 Objectives

You will need the files for Section_4_3 to complete this module.

4.3.2 Create new vector datasets

  1. Launch QGIS and create a new project.
  2. Before adding new vector data, you need a vector dataset. We will begin by creating new datasets before adding new vector data to them.

4.3.3 Create a point vector dataset

  1. On the main menu, click on Layer > Create Layer > New Shapefile Layer.
    Step 3
  2. Our first layer will be a point layer of sex worker hotspots, so in the New Vector Layer dialog box, select point as the Type.
  3. Leave the CRS box as the default of EPSG:4326 - WGS 84.
  4. We will now create a new attribute for adding data.
  5. Under New attribute enter TYPE in the Name box.
  6. We will store text values in this attribute, so leave the Type as Text data.
  7. Change the Width to 30. The text values we are going to store here are not very long and will not exceed 30 characters.
  8. Click Add to the attribute list.
    Steps 4-10
  9. Add the following new attributes:
    NameTypeWidth
    CategoryText data30
    EstNumbersWhole number10

    Step 11
  10. Click OK. In the dialog box that opens, save the file in MyExercises as Hotspots.shp.
  11. Click Save. The file will be added to your layer list.
  12. You now have an empty dataset.
  13. Save your project in MyExercises as Exercise_6.

4.3.4 Add a raster layer

Our data source is a raster image obtained from Google Earth. We will digitize hotspots from this image.

  1. On the main menu, click on Layer > Add Layer > Add Raster Layer.
    Step 16
  2. Navigate to your Data folder. For file type, select GeoTIFF from the pull-down menu.
  3. Select Hotspots.tif and click Open.
    Step 18
  4. The image has been added to your map. Drag it below the empty point file. Note the different icons for the layers despite the same name.
    Step 19

4.3.5 Digitize point data

  1. We will digitize seven hotspots.
  2. Refer to the image below to locate the point marked A on your image in QGIS.
    Step 21
  3. To add data to our new empty layer Hotspots, the layer must be in edit mode.
  4. Right-click on Hotspots empty point layer and select Toggle Editing to set to edit mode.
    Step 23
  5. Once you are in edit mode, the digitizing tools toolbar will become active.
  6. Click on the Add features button.
    Step 25
  7. Click on the location for point A on your image.
  8. The Feature Attributes dialog box opens up.
  9. Type 1 in the Id field and FSW in the Type field. In the Category field, type Street. In the EstNumber (estimated numbers), type 56. Click OK.
    Steps 26-28
  10. A point has been added to your image. Let's change it to a bright yellow color so that it is visible.
  11. Double-click on the point file and change the color in the Layer Properties dialog box.
  12. Digitize the remaining six points and update their attributes as per the table below.
    Point ID Type Category EstNumbers
    B 2 IDU Street 60
    C 3 FSW Hotel 25
    D 4 FSW Residential 20
    E 5 FSW Street 18
    F 6 IDU Street 36
    G 7 FSW Residential 10
  13. Your map should resemble the graphic below.
    Step 32: Visual Coparison
  14. Right-click on the layer and open the Attribute table.
  15. We now have a dataset consisting of various hotspots.
    Steps 33-34
  16. Close the attribute table.
  17. Click on the Save layer edits button on the edits toolbar.
    Step 36
  18. Click on the Toggle editing button to exit edit mode.
    Step 37

4.3.6 Symbolize hotspots using proportional symbols

Proportional symbols are a way of symbolizing point data to show the relative magnitude of a particular variable. We will map the relative magnitude of hotspot types.

  1. Double-click Hotspots layer to open the Layer Properties dialog box.
  2. In the left panel, select Diagrams.
  3. Select the Display diagrams button.
  4. For Diagram type, use the pull-down menu to select Text diagram.
  5. Click on the Background color pull-down menu and select a yellow color.
  6. In the Attributes section at the bottom of the dialog box, click on Type and click the green plus sign to add it to the Assigned attributes. Do the same for EstNumbers. Change the color to a dark color like black.Steps 38-43
  7. Click on the Size tab and un-check the Fized size option.
  8. To select your scale attribute use the Attribute pull-down menu and select EstNumbers as the attribute to map using proportional symbols.
  9. Click on the Find maximum value button. In the box next to it, change the size to 10 or 9.
    Steps 44-46
  10. Click on the Position tab and select Over point from the Placement pull-down menu.
    Step 47
  11. Click OK.
  12. Your map should resemble the graphic below.
    Step 49: Visual Comparison

Top