I am following the "QGIS by Example" text book and a task requires that a point layer is rasterized using the following GDAL code

gdal_rasterize -l layer name -burn 1 -a_nodata 0 -te coordinates - tr 10 10 -ot Byte

This should provide a raster layer with the value of 1 for the point locations and 0 elsewhere within the coordinates provided. A tiff file is generated but doesn't show on the map canvas despite my styling attempts. I have tried all sorts of variations in the GDAL command and added an integer field set to 1 to the shapefile to use this but without success. This may not be relevant but I have used the book download file for the next exercise using the raster proximity tool but receive a message stating that the GDAL dataset can't be opened. Is there an issue with settings in QGIS - my version is 2.18.26

  • Perhaps add -init 0 ? – Kazuhito Feb 1 at 15:02
  • I would suggest inspecting the output TIF to see what it has done - Zoom to Layer to see if extents are as expected. Check properties for min/max of raster bands, CRS, etc. You may also run the command omitting the -te parameter and it will default to the input extents. – CrystallineEntity Feb 1 at 15:15
  • But you will not be using that command literally so written, right? – Gabriel De Luca Feb 4 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.