0

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.Continous road I would like to achieve

Discontinous

method used

3
  • 1
    Please overlay the road shape, as well as add your conversion parameters.
    – Erik
    Commented Nov 24, 2020 at 14:35
  • 6
    You could buffer the lines to a desirable thickness and then rasterize that, or apply symbology and export to a tif.
    – John
    Commented Nov 24, 2020 at 14:41
  • Buffering the roads has actually offered some success so thanks for that suggestion.
    – AQGIS
    Commented Dec 9, 2020 at 11:45

1 Answer 1

1

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.

enter image description here

8
  • 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
    – AQGIS
    Commented Nov 25, 2020 at 14:53
  • Check in: Processing Toolbox - GDAL - Vector Conversion - Rasterize (vector to raster)
    – FPG
    Commented Nov 26, 2020 at 2:53
  • I have followed that path however I still can't find the option for -at
    – AQGIS
    Commented Nov 26, 2020 at 12:20
  • can you add a screen-shot of the tool that you are using?
    – FPG
    Commented Nov 29, 2020 at 22:55
  • sorry for slow reply. I have added the tool used to the question.
    – AQGIS
    Commented Dec 3, 2020 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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