1

I'm trying to create a 3D view in Qgis 3.0 for the first time. It's asking for a raster file from which to calculate elevations. All I have for elevation data is a shapefile of contours (as lines).

I've tried simply rasterizing the contour lines shapefile, but it comes up with Error 1 "Wrong value for -outsize parameter" and I can't seem to get any information on this error.

enter image description here

Is there a way to get a raster file suitable for use with the 3D view from a shapefile with contour lines?

Edit - I've followed the link trail from the previous question, they all seem to link back to the tutorial which @Marco linked to.

The trouble is, all those start with converting the vectors to raster, and that, as the question suggests, is where I'm having the problem. Perhaps, given that converting raster contour lines to raster DEM is so well covered I should change the question title to just "How do I convert vector contours to raster contours?"

  • I suggest you to have a look to this wiki: https://grasswiki.osgeo.org/wiki/Contour_lines_to_DEM. The grass commands are available through the processing toolbox in QGIS – Marco Mar 07 '18 at 08:05
  • @Marco Part of it may well be a duplicate, but I seem to be getting stuck at a different point, the conversion of the vector lines to raster lines. –  Mar 07 '18 at 08:54
  • I am quoting @Micha "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" – Marco Mar 07 '18 at 08:59
  • @Marco So there isn't a way within Qgis? I'm not familiar with GRASS. –  Mar 07 '18 at 09:00
  • @BERA "I've tried simply rasterizing the contour lines shapefile, but it comes up with Error 1 "Wrong value for -outsize parameter" and I can't seem to get any information on this error." - from the question. –  Mar 07 '18 at 09:01
  • My guess is that your are using Rasterize (Vector to raster), a GDAL command, but maybe not!? Could you paste the screenshot before you press OK? You migth have an error in the parameters. Here the man page: http://www.gdal.org/gdal_rasterize.html where I read "The resolution or size must be specified using the -tr or -ts option for all new rasters". – Marco Mar 07 '18 at 09:12
  • @Marco I think I've replicated the screen shot, but only by starting again, so I might not have it right. I tried carrying out the GRASS instructions you quoted by simply ignoring the "import the contour lines into GRASS" instruction and it worked to a certain extent, but the result is extremely 'terraced' so I need to work out what parameters (if any) can be altered to get a smoother result, but that will definitely be another question. We should close this as a duplicate now, I don't think finding the error in the GDAL method is necessary as the GRASS method produces a 3D map of some sorts. –  Mar 07 '18 at 09:31

0 Answers0