I am trying to rasterize a shapefile using the "rasterize" tool in qgis.
The problem is that the resulting raster doesn't seem to rasterize correctly…
The teal and purple lines show water flow, and this is the shapefile I would like to rasterize
The resulting raster takes all of the extent of the file and gives it a value of 1, even if it is not part of the water flow
Dialog
Best Answer
Assuming that your projection is in meters, the procedure for rasterizing include:
1) At the layer properties, copy the extent of your 'rivers' shapefile and remove the text characters. In my example is:
2) Click in Raster -> Conversión -> Rasterize menu option. Select the output file name and, afterward, click in "Raster resolution in map units per pixel". I assume a pixel size of x = 30 m, y = 30 m. Now, click in the pencil icon and paste in the gdal_rasterize command, before pixel size, your equivalent to this:
The complete command, in my case, would be:
3) After click in OK, 'Zoom In' to one arbitrary area of the output raster (rasterized by ID and with pseudocolor renderer) where it can be observed that the rasterization is as espected: