6

Is there a way to color on the outside of polygons like this?

I have tried to use the inverted polygon style in QGIS but it didn't work.

enter image description here

Taras
  • 32,823
  • 4
  • 66
  • 137
neogeomat
  • 8,380
  • 3
  • 52
  • 91
  • 2
    What went wrong ? I think inverted polygon style is definitely the answer to your question ... as Ed mentioned the Mask plugin is using this style to achieve masking (of selected objects) ... – Snaileater Sep 13 '17 at 16:27
  • Use the Geometry Checker plugin to check the validity of your polygon's geometry. If the geometry is invalid QGIS doesn't know where the outside of the polygon is. – csk Sep 14 '17 at 16:40

3 Answers3

13

I am not sure what was going wrong with inverted polygon style, but here is a simple polygon to show you how to do it:

enter image description here

Go to Layer Properties -> Style -> Change Single Symbol to Inverted polygons

enter image description here

Notice I used the same color in your question because you want to color the outside polygon with this specific color.

Here is the output:

enter image description here

ahmadhanb
  • 40,826
  • 5
  • 51
  • 105
3

I'm not aware of another stylistic way to achieve that effect (if inverted pgons is not working), however, you could download the Mask plugin (https://plugins.qgis.org/plugins/mask/) which will automatically create an exterior mask around a selected polygon. It creates a new memory polygon layer that you can style however you want.

This plugin allows user to quickly transform a polygon selection into a map masking layer or a region of interest, following symbology choice. The plugin allows also to spatially filter labeling of other layer, so that labels will only appear in the Region of Interest.

Taras
  • 32,823
  • 4
  • 66
  • 137
Ed Rollason
  • 3,878
  • 2
  • 19
  • 34
3

Despite a brilliant answer from @ahmadhanb, I would like to share an idea of how to invert a filling of polygon with Geometry Generator.

Let's assume that there is a polygon, shown on the Picture beyond.

input

Use the following setting for the Geometry generator

input

and get the result, see image below

result

Taras
  • 32,823
  • 4
  • 66
  • 137