10

What I want to do is to fill a polygon (country) with a graphic file in any format (*.jpg, .bmp, .png).

It should look like this:

enter image description here

I'm aware that GIS soft is not proper for such an operation but maybe is there any option to do it only in QGIS.

Taras
  • 32,823
  • 4
  • 66
  • 137
muszynov
  • 647
  • 4
  • 16

3 Answers3

10

Use the "raster image fill" style on the polygon layer. This fill style allows drawing a polygon using a PNG/JPG/BMP/... etc.

ndawson
  • 27,620
  • 3
  • 61
  • 85
7

Using a gradient, you can obtain this:

Result

Gradient settings

You have to use two stops at the border between colours, one for each colour, to make sure the result is neat. SVG would in any case be the way to go for any flag with more than straight lines!

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Victor
  • 1,852
  • 14
  • 20
  • 1
    to force discrete gradient, put one stop at 33.2% (in this case, black) and the other one in 33.3% (red). Do the same with 66.5% and 66.6% (red and yellow, respectively). – aldo_tapia Nov 24 '16 at 17:48
0

This can be done using Python by creating image patches and clipping images using the patches. Needs Python libraries like shapely, cartopy and GeoPandas. here

Vince
  • 20,017
  • 15
  • 45
  • 64
dee49
  • 1
  • 2
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Dec 06 '21 at 16:05