I have converted a Road shp file into a Raster in QGIS, however after the conversion the Road is no longer continous (i.e only the cell corners are touching). I have tried increasing the resolution during conversion however that has not solved the problem. The first image is what I need, the 2nd is my current result.
-
1Please overlay the road shape, as well as add your conversion parameters.– ErikCommented Nov 24, 2020 at 14:35
-
6You could buffer the lines to a desirable thickness and then rasterize that, or apply symbology and export to a tif.– JohnCommented Nov 24, 2020 at 14:41
-
Buffering the roads has actually offered some success so thanks for that suggestion.– AQGISCommented Dec 9, 2020 at 11:45
Add a comment
|
1 Answer
Using the gdal tool (Processing Toolbox) called 'rasterize' you can set an advanced parameter to: -at
(so, minus at)
Your GDAL/OGR console call would look something like this:
gdal_rasterize -l layer_name -burn 30.0 -at path_to_data_file temp.tif
The documentation for gdal_rasterize is at: https://gdal.org/programs/gdal_rasterize.html#gdal-rasterize
Hope it works
Update
The advanced option is typed in by hand.
-
thank you for the answer. I have opened up the processing toolbox, but I can't seem to find a specific GDAL rasterize option. The vector to Raster option then doesn't offer a advanced setting where you can choose the - at option. I am using QGIS 3.4– AQGISCommented Nov 25, 2020 at 14:53
-
Check in: Processing Toolbox - GDAL - Vector Conversion - Rasterize (vector to raster)– FPGCommented Nov 26, 2020 at 2:53
-
I have followed that path however I still can't find the option for -at– AQGISCommented Nov 26, 2020 at 12:20
-
-
sorry for slow reply. I have added the tool used to the question.– AQGISCommented Dec 3, 2020 at 14:11