Clip layers in a map with transparency

144
5
10-12-2022 09:07 AM
arthurV
New Contributor II

Hi, I would like to create a mask around some part of my map. This would help to highlight a specific portion of the map.

I know there is the clip layers option. It's usefull, but I would like to keep, with transparency, what is set outside my clip extend.

Result expected is what you can see here in Qgis.

ImpulsMap-Tutoriels-EffectuerPochoirMasqueQgis22-PochoirRemplissageSimpleResultat

Tags (1)
0 Kudos
5 Replies
BarryNorthey
Occasional Contributor

You could try the Feature Outline Masks (Cartography) tool but it requires an Advanced license. I selected the Alberta province and then switched selections and built the masks on those features. I got this effect which might be what you are looking for.

BarryNorthey_2-1665597728466.png

 

 

 

0 Kudos
arthurV
New Contributor II

Unfortunatly my organization do not have this licence.

0 Kudos
Jennifer_Parmeley
New Contributor III

I often use definition queries to do this. 

0 Kudos
arthurV
New Contributor II

Could you explain a bit more?

0 Kudos
BarryNorthey
Occasional Contributor

A Definition Query filters the features (and their attributes) that you do or don't want to display in a layer without deleting features. All the features return when the query is switched off. One way to do this is to sketch a  single polygon around the area of interest and call it Mask. Then Union Mask with the French provinces layer. Run GP Tool Multipart to Single Part on the Unioned layer.You can now draw or nor draw whatever province polygons you want using a Definition Query.

The Definition Query below can be built using the query wizard and a bunch of ORs or in my example, using SQL's NOT IN command. In my example the target field is called name followed by NOT IN then a list of the names of the provinces from the name field that you don't want to display enclosed in parentheses. Feature names in the list are enclosed by single quotes but the apostrophe is interpreted as a single quote causing problems so there must be two as shown for SQL to understand it: BarryNorthey_1-1665796152368.png

BarryNorthey_1-1665803490892.png

 

name NOT IN ('Yvelines', 'Paris', 'Essonne', 'Hauts-de-Seine', 'Seine-Saint-Denis', 'Val-d''Oise', 'Val-de-Marne', 'Seien-et-Marne')

You can then adjust the layer transparency. Hope this works.

0 Kudos