Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to create a DEM from depth contours (shapefile) in QGIS. I've been trying to work out how to do this based on this previous question, notably from this link from that page, however I'm stuck, and was hoping someone could help.

My progress/process so far:

  1. open new map in QGIS, import the contour shapefile

  2. set GRASS extent, set new GRASS mapfile, etc

  3. try to 'import' the shapefile into grass by converting it into a grass file, based on a hunch from the wording in this page (search in page: 'use of qgis and grass'): file management, import into grass, import vector into grass, import loaded vector (v.in.ogr.qgis), then view output. This creates an identical looking layer.

  4. try to use r.surf.contour on this - doesn't allow layer to be selected.

  5. try to use r.surf.contour2 on this - either crashes QGIS or produces a full block of colour.

Any thoughts/tips on what I should be doing differently?


Update:

Interpolation failing, tried everything in GRASS & in GRASS plugin, failed, could problem be due to source shapefile?

Something I learnt from elsewhere was 'geometry tools > check geometry validity' which I ran on the contour shapefile and it found loads of errors. I'm wondering if this could be the reason that all my efforts to create a DEM are failing? Would anyone do me the huge favour of having a look at my shapefile to see if I'm just being useless, or if it's a problem that a relative novice would be excused for not anticipating?

Thanks in advance!

share|improve this question
    
Did you try to use the intrpolation plugin? No Grass necesary... –  Gerardo Jimenez May 9 '13 at 16:46
    
Hi Gerardo, thanks for the idea. I've been playing around with it without much success. I'm using 10m contours for the whole of Ireland and interpolation doesn't seem to result in the high res i'm looking for... should I be able to get the result I need from this method? –  dez93_2000 May 17 '13 at 1:02

2 Answers 2

The GRASS tutorial looks like the ticket. Following along your steps, are you converting the contours to raster somewhere between 1 and 4?

Last paragraph in the About section:

A number of the r.surf.* modules want the input data to be in raster form already, so we rasterize the contour lines, using the level column for the height values. Also some of the older r.surf.* modules only like to work on integers, so to preserve sub-meter fidelity we do a little trick where we multiply by a large number, do the process, then divide by that number again (to avoid terracing be sure it's floating point, not an integer).

share|improve this answer
    
so the rasterisation process is where i'm probably going wrong. Should I be importing the vector into grass, or converting it into a raster first? Do I need to use the v.to.rast.constant in grass to do this, or the QGIS version? –  dez93_2000 May 9 '13 at 0:35
2  
The procedure should be: import the contour lines into GRASS, convert GRASS vector to raster using v.to.rast.attr. Then run r.surf.contour to get the dem. –  Micha May 11 '13 at 15:06
    
Micha, thanks very much for the walkthrough, that sorted it. Kinda: any tips on getting a higher res output for the raster? There doesn't seem to be such an option. See image link, with imported-into-GRASS contours (thin lines), resultant raster (red squares) and DEM from the raster (colour gradient): imgur.com/miHRcF4 –  dez93_2000 May 17 '13 at 1:00
1  
Investigate the 'Region' settings: gis.stackexchange.com/questions/15727/… –  Barrett May 17 '13 at 13:19
    
Thanks Barrett, looking at that now. If you happen to know what the cell sizes correspond to off the top of your head, please lemme know! Cheers. –  dez93_2000 May 21 '13 at 14:24

I used this tutorial to create a Digital Terrain Model (DTM).

It uses as input contour shapefiles converted in raster contours that are later interpolated in DTM (looks like a continuous heat map)

It is not using QGIS but just GRASS, but it may be feasible with the Grass plugin from QGIS.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.