3

I have contours that need to go on a TIFF file. They are both georeferenced and in the correct location. I am currently trying to use QGIS to bring them in and change the linetype/lineweight of the contours on the TIFF. I have achieved how to bring them in through the Raster > Conversion > Rasterize tool and then changing the color to what is desired which can be found On My Other Post.

I was wondering if there was a way to bring styles that are on the vector layers onto the TIFF file through the rasterize tool but from looking at the code in the rasterize tool Here.

Also, on a previous post Here, Joseph pointed out that it is probably not possible to bring the style of a vector layer through using the Rasterize tool but only through its attributes.

Ultimately, I want the contours brought in to have a dashed linetype and/or be thicker than what it currently is.

EDIT: If I have polygons through the buffer tool am I able to rasterize the polygons onto a TIFF? It seems only line vectors can.

4

You are looking at the wrong tool. If you want to export a vector layer with styling into a raster file, you can use:

  1. Project -> Save as Image ...

which gives you a raster of the screen content with a world file by default, but only at screen resolution.

  1. New Print Composer -> Composer -> Export as Image ...

In the right panel, you have to go to Export settings, and activate Save as world file. Then you can load the raster in a different QGIS project together with other layers. The image size can be adjusted with the dpi resolution.

  • So in the print composer I should 'Add new map' to bring in the TIFF file and the contours on top of it and then save that new raster and the world file at a resolution to my liking? – Shub Jul 10 '17 at 18:11
  • This also makes the contours giant as I zoom into the TIFF after I export as an image. – Shub Jul 10 '17 at 18:29
  • If you want the contours to automatically re-size as you zoom in, you should leave them in vector format. – csk Jul 10 '17 at 18:36
  • @csk I need a TIFF file with the vectors actually on it though. I will need to end up bringing the TIFF over into a new program as an aerial. – Shub Jul 10 '17 at 18:49
  • No, you put the vector layer and raster into your canvas, then create a new print composer with both visible, If you want only the contours, dsiable the raster layer, but export as a raster file with the same resolution (in px) as the existing raster file has. – AndreJ Jul 10 '17 at 19:07
3

QGIS 2.18

You can use the QFieldSync plugin for this purpose. It ships with a new processing algorithm "basemap" (which you may need to manually enable through the processing configuration interface) that can be used to rasterize and save a styled map into any raster file supported by gdal.

QGIS 3.x

The Convert map to raster algorithm is a port of the basemap algorithm to QGIS core. It contains some additional improvements over the original algorithm.

enter image description here

1

If you have Mapinfo 15 and above (64 Bit version) then you can easily do so by following the below steps:

Open Mapinfo->Raster TAB->Raster Operations->Rasterize Tool

Showing Rasterize Tool

Just select the vector layer that you want to rasterize. The output created will be a Raster layer with all the style information carried over from vector into raster file. And yes there is option to output raster in tiff format.

Should be fairly simple.

Let me know if you have any query.

Your Answer

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

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