Tutorial: Digitizing in QGIS

Tutorial moved to http://www.qgistutorials.com/en/docs/digitizing_basics.html

Digitizing is one of the most common tasks that a GIS Specialist has to do. Often a large amount of ‘GIS time’ is spent in digitizing raster data to create vector layers that you use in your analysis. Quantum GIS has powerful capabilities to digitize raster data. In this tutorial, we will take some high resolution satellite imagery and digitize it to create a vector polygon layer.

The imagery we are using today is from Quickbird satellite. This particular image of Kolkata, India is made available freely by DigitalGlobe for educational use. You can download this image from http://glcf.umd.edu/data/quickbird/

The task at hand is to digitize all the water bodies from the satellite image and create a ‘waterbodies’ polygon layer.
  • Prepare and load the satellite imagery to QGIS. Once you have downloaded the data, unzip it and extract the TIF file. Load this TIF file in QGIS by clicking Layer → Add Raster Layer.
  • Browse to the TIF file and Click ‘Open’ to load the image into your project.
  • You will notice that the image seems completely black and without information. In reality, it contains a lot of information but we are not able to see it because it is very ‘low-contrast’. Right click the image layer and click on ‘Properties’. In the Propoerties dialog, click on the histogram tab. You see here that the pixels from 0-255 have some values, but the display range is from 0 -2048.
  • To display this image to a contrast level that our eyes can distinguish, we will have to stretch these pixels over a much smaller range. Once we do this, the difference between individual pixel values will be large (high-contrast) and we will see the image clearly. To do this, go to the ‘Style’ tab. Select ‘Custom min/max values’ and enter the value 500 as the max value. Then select ‘Stretch and Clip to Minmax’ under Contrast Enhancement and click OK.
  • Now you will see that the details in the image is visible clearly. Now we are ready to start Digitizing.
  • Zoom into the center part of the image so we can make out individual features. Use the ‘Zoom In’ button on the ‘Map Navigation’ toolbar to zoom and pan to the area.
  • Now create a new empty layer where we can digitize the features. Click on Layer → New → New Shapefile Layer
  • In the next dialog box, choose ‘WGS84’ as the coordinate reference system. You can choose any projection that is suitable for your region. Here we are choosing WGS84 to keep it simple. Click OK.
  • Another dialog box will pop up asking for more information about the new layer. Since we are creating a waterbodies polygon layer, choose ‘Polygon’ as the Type of the layer. Below that, there is a section named ‘New attribute’. Here you can specify what attribute information you want to collect about the features you are digitizing. These will differ from project to project, but here we will add a ‘name’ attribute. Enter the details and click ‘Add to attributes list’ button.
  • When prompted, save the layer with the name ‘water_bodies’.
  • Before we start digitizing, we need to make sure we are using the correction projection. The layer we created is in ‘WGS84’ projection, but the image is not. You can check that by right-clicking on the image layer and going to ‘Properties’. In the ‘General’ tab, you will see that the projection is UTM.
  • We need to have both our layers in the same projection before we can start digitizing. Either you can reproject the image layer to match our water_bodies layer or vice-versa. There is an easier way to do this without re-projecting by enabling ‘On-the-fly reprojection’. You can go to Settings → Project Properties
  • In the ‘Project Properties’ dialog, check the ‘Enable on the fly CRS transformation’ box. In the Coordinate Reference System box below, choose ‘WGS 84’. This will ensure that regardless of the projection, all the layers will be transformed in real time and displayed in WGS 84 coordinate system. Click Ok.
  • Once you get back to your Canvas, you will see the image is gone. This is because we are in WGS84 coordinate space and the image is not in the viewport. Right-click the image layer and choose ‘Zoom to layer extent’. The image will be back in the view.
  • Now enable the ‘Digitizing’ toolbar by right clicking in the ‘Toolbar’ section of QGIS. In the pop up menu, make sure ‘Digitizing’ box is checked.
  • Select the ‘water_bodies’ layer. Zoom to a region where you can see water bodies in the image. Then click ‘Toggle Editing’
  • Various other buttons in the toolbar will be enabled now. To start drawing a polygon, click on the ‘Capture Polygon’ button.
  • Draw the polygon by click on the edge of the visible lake. Keep clicking till the polygon is complete. Right click to join the last node to the first one and close the polygon. A dialog will pop-up asking for attribute information. Enter the ‘Id’ and ‘Name’ of the feature you just digitized and click OK.
  • Similarly, draw polygons for other features in the image. You can look at the other options in the toolbar to help you with your editing. Once you are done, click on ‘Toggle Editing’ button. In the pop-up dialog, click on ‘Yes’ to save your edits.
Now your basic digitizing is complete. You will have a shapefile with polygon features and an attribute table with ‘id’ and ‘name’ attributes. Hope you found this tutorial useful. Do leave a comment to this post with ideas, suggestions or questions relating to this feature in QGIS.


  1. I've been using height maps to generate contour lines and find it useful to clip the raster to the area I'm interested in using Raster > Extraction > Clipper. This makes both generating the Contours faster as well as just the responsiveness of the UI.

  2. How do I display my NAME attribute as the label of a shape file? Or how do I change the text in a label?

  3. this is absolutely helpful, thanks! What if I want to mark roads? Then I shoud use lines, not the polygon, right?

    1. Thank you. Yes, you should use lines to digitize roads.

  4. how to get the area from qgis for a polygon?

    1. use Area() function in Field Calculator to add an area attribute to each feature. Make sure your polygon layer is projected in a coordinate system whose units are what you need for the area. If your later is in lat/long projection, the area will be calculated in 'square degrees' - which doesn't make sense. So use a projecction that has meter or feet as units, so you get your area in 'square meters' or 'square feet'

  5. Would it be possible to do the same thing using Google maps plugin in Qgis?
    Say I wanted to map the slums in a city. Would that be possible? Are there any separate steps to be followed?

    P.s. All your tutorials are immensely helpful.

    1. Hey Sirus, You could use google maps via the Openlayers plugin, but I would suggest using Google Earth. It's less static than the Qgis raster layers, so digitizing is easier. Also, when using GoogleEarth, if you need multiple polygons in a single layer make sure they are in the same folder before saving.

  6. How about digitizing buildings for instance, or anything with 90degree angles. Is there a plugin that will allow for making perfect angles?

    1. Yes. Try the CADTools plugin. It hasn't Orthogonal Digitized mode which allows you to draw lines at right angles.

  7. I want the procedure in digitizing pits/holes on alluvial flood planes

  8. Hey, Ujaval! I was asked to translate your tutorials on Russian. So I need your permission, and, then, where should I put the translation, here or somewhere else? Nadezda

    1. Hi Nadezda,

      Great to hear that. Feel free to translate the tutorials and use it. I have licensed them under fairly open terms.


      You can host it anywhere you like. Ideally you should host it in a place you can easily make edits etc., so you can update it when I add new material. Once you place them online, can you send me a link and the purpose for which they are being used? I would like to feature them on this site for other users.