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 28 guests online
How to generate contours using raster data in Quantum GIS (QGIS)
( 3 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.

 

qgis_point_contour_output

 

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.

 

qgis_choose_raster_contour_ouput_directory

 

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. 

 

qgis_gdaltools_contour_menu

 

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.

 

qgis_point_contour_output

 

Comments  

 
0 #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
Quote
 

Add comment


Security code
Refresh