GIS Tutorials >> Quantum GIS >> Beginner Quantum GIS Tutorials >> How to generate contours using raster data in Quantum GIS (QGIS)

GIS Programming Tutorials

GIS Theoretical Tutorials

GISTutor Newsletter

GISTutor Poll

How did you hear about us?

GISTutor Users Online

We have 35 guests online
How to generate contours using raster data in Quantum GIS (QGIS)
( 5 Votes )

This beginner QGIS tutorial explains how to generate contours directly from raster elevation data by using the GdalTools Contour function.  I suggest users to complete the tutorial called ‘Using QGIS Plugins’ to find out how to properly install and enable the GdalTools Python Plugin. 


Sample raster elevation data can be downloaded from here.




Once you have downloaded and extracted the raster elevation data, open up QGIS and select Add Raster Layer.  Navigate to the location of the dem_clip.tif file and add it to your current project.


Generating Contours from Raster


To generate contours directly from the raster elevation data, select Raster > Contour to open the GdalTools Contour menu.  In the Contour menu, make sure to select dem_clip as the Input file (raster).  For Output directory for contour lines (shapefile) click on the Select button.  This tool is asking for you to select the parent folder for where the output file contour.shp is to be stored.  Navigate to the location of your raster elevation data, click the Create New Folder icon and name the folder ‘rastercontour’.  Finally select the ‘rastercontour’ directory and click on the Choose button.




Back in the GdalTools Contour menu, set the Interval between contour lines to ‘100’.  Place a check next to Attribute Name and leave the name set to ELEV.  Lastly place a checkbox in the Load into canvas when finished option.  Click OK and then Close. 




You should now see your contour lines overlaid on top of your elevation raster.  In order to better symbolize your contours with graduated colors and appropriate feature labels, continue onto the tutorial titled ‘How to generate contours using point data in Quantum GIS (QGIS)’ and complete the bottom two sections: Adding Symbology to Contours and Labeling Contours.  Once you have completed the tutorial you should have a nice clear map which shows the vector contours with graduated color scheme and feature labels overlaid on top of the original raster elevation data.





+2 #1 jeremylindsell 2013-09-26 09:57
If I only want to draw one contour at the height of my choice, is there a way to specify individual contour values rather than having to accept all contours at the specified interval and then delete the ones I don't need? Thanks

Add comment

Security code