Masking layers by a vector polygon layer in QGISIs there a way to hillshade vector polygons with a DEM in QGIS?Exporting a QGIS layout with Addition on layersTransparency on black/white raster after clipping in QGIS?C++ QGIS Conditional Label ColouringMerge and export two layers that utilize blending modesPyQGIS: vector layer does not get displayed after renderingCan I use a polygon to show a WMS-layer inside while maintaining transparency outside?Calculate Density in QGISCombine raster (monocromatic and RGB image)Creating QGIS map that can be exported and used for 2-colour (spot) printing?

Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?

Arrow those variables!

Avoiding the "not like other girls" trope?

How does a predictive coding aid in lossless compression?

Mathematica command that allows it to read my intentions

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?

Do UK voters know if their MP will be the Speaker of the House?

Why would the Red Woman birth a shadow if she worshipped the Lord of the Light?

How to prevent "they're falling in love" trope

One verb to replace 'be a member of' a club

Is "remove commented out code" correct English?

Am I breaking OOP practice with this architecture?

What is the most common color to indicate the input-field is disabled?

Intersection Puzzle

How can saying a song's name be a copyright violation?

iPad being using in wall mount battery swollen

Can my sorcerer use a spellbook only to collect spells and scribe scrolls, not cast?

How dangerous is XSS?

Why is consensus so controversial in Britain?

CAST throwing error when run in stored procedure but not when run as raw query

What method can I use to design a dungeon difficult enough that the PCs can't make it through without killing them?

Valid term from quadratic sequence?

Probability that a draw from a normal distribution is some number greater than another draw from the same distribution



Masking layers by a vector polygon layer in QGIS


Is there a way to hillshade vector polygons with a DEM in QGIS?Exporting a QGIS layout with Addition on layersTransparency on black/white raster after clipping in QGIS?C++ QGIS Conditional Label ColouringMerge and export two layers that utilize blending modesPyQGIS: vector layer does not get displayed after renderingCan I use a polygon to show a WMS-layer inside while maintaining transparency outside?Calculate Density in QGISCombine raster (monocromatic and RGB image)Creating QGIS map that can be exported and used for 2-colour (spot) printing?













3















I have a vector layer of buildings:



enter image description here



and a polygon layer coloured by some quantity:



enter image description here



and I want to mask one by the other to produce this:



enter image description here



This can be done by setting the blend mode to "Multiply" with the building polygons on top as long as the polygons are white and the background of that layer is black.



One way of doing that is to use an "Inverted Polygons" fill but that is very slow at low zoom levels since all the buildings are in view and that's a lot of inverted polygons.



The other way I thought I'd cracked this was to create a "Group" layer with the buildings filled in white and a virtual layer consisting of the bounding box of the buldings filled in black. On its own it looks right:



enter image description here



but QGIS (3.6) doesn't let you blend grouped layers (Gimp and Photoshop probably do) so it doesn't work.



I really want to do it in the canvas so solutions involving processing intersections and creating new layers and so on aren't going to work either.



I'm not sure if I'm missing a trick to create a style for a layer to have a black background, or if there's something else in the blending modes that will do this...










share|improve this question


























    3















    I have a vector layer of buildings:



    enter image description here



    and a polygon layer coloured by some quantity:



    enter image description here



    and I want to mask one by the other to produce this:



    enter image description here



    This can be done by setting the blend mode to "Multiply" with the building polygons on top as long as the polygons are white and the background of that layer is black.



    One way of doing that is to use an "Inverted Polygons" fill but that is very slow at low zoom levels since all the buildings are in view and that's a lot of inverted polygons.



    The other way I thought I'd cracked this was to create a "Group" layer with the buildings filled in white and a virtual layer consisting of the bounding box of the buldings filled in black. On its own it looks right:



    enter image description here



    but QGIS (3.6) doesn't let you blend grouped layers (Gimp and Photoshop probably do) so it doesn't work.



    I really want to do it in the canvas so solutions involving processing intersections and creating new layers and so on aren't going to work either.



    I'm not sure if I'm missing a trick to create a style for a layer to have a black background, or if there's something else in the blending modes that will do this...










    share|improve this question
























      3












      3








      3








      I have a vector layer of buildings:



      enter image description here



      and a polygon layer coloured by some quantity:



      enter image description here



      and I want to mask one by the other to produce this:



      enter image description here



      This can be done by setting the blend mode to "Multiply" with the building polygons on top as long as the polygons are white and the background of that layer is black.



      One way of doing that is to use an "Inverted Polygons" fill but that is very slow at low zoom levels since all the buildings are in view and that's a lot of inverted polygons.



      The other way I thought I'd cracked this was to create a "Group" layer with the buildings filled in white and a virtual layer consisting of the bounding box of the buldings filled in black. On its own it looks right:



      enter image description here



      but QGIS (3.6) doesn't let you blend grouped layers (Gimp and Photoshop probably do) so it doesn't work.



      I really want to do it in the canvas so solutions involving processing intersections and creating new layers and so on aren't going to work either.



      I'm not sure if I'm missing a trick to create a style for a layer to have a black background, or if there's something else in the blending modes that will do this...










      share|improve this question














      I have a vector layer of buildings:



      enter image description here



      and a polygon layer coloured by some quantity:



      enter image description here



      and I want to mask one by the other to produce this:



      enter image description here



      This can be done by setting the blend mode to "Multiply" with the building polygons on top as long as the polygons are white and the background of that layer is black.



      One way of doing that is to use an "Inverted Polygons" fill but that is very slow at low zoom levels since all the buildings are in view and that's a lot of inverted polygons.



      The other way I thought I'd cracked this was to create a "Group" layer with the buildings filled in white and a virtual layer consisting of the bounding box of the buldings filled in black. On its own it looks right:



      enter image description here



      but QGIS (3.6) doesn't let you blend grouped layers (Gimp and Photoshop probably do) so it doesn't work.



      I really want to do it in the canvas so solutions involving processing intersections and creating new layers and so on aren't going to work either.



      I'm not sure if I'm missing a trick to create a style for a layer to have a black background, or if there's something else in the blending modes that will do this...







      qgis cartography masking






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      SpacedmanSpacedman

      24.8k23551




      24.8k23551




















          2 Answers
          2






          active

          oldest

          votes


















          5














          You can put the colored polygons on top, with a layer blending mode set to darken



          Below, have the building layer with the polygon fill in white.



          At the bottom, add a new layer containing one large black polygon.




          enter image description here



          Without the black background:



          enter image description here






          share|improve this answer























          • Bingo. Polygons on top just didn't occur to me! I can use my virtual bounding box layer as the black background.

            – Spacedman
            2 days ago


















          2














          Here's an alternate method for coloring the colored buildings to match the underlying zones.



          With Geometry Generator styling, create a separate symbol layer of buildings that intersect each of the zones.



          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 1)))
          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 2)))
          etc.


          enter image description here



          Change the color of each symbol layer to match the zone color. Create a black background, eg by setting the map canvas background color to black, or by changing the zone layer style to black-filled simple polygons.



          enter image description here



          Disclaimer: My test dataset was very small, so I have no idea if this will render faster than the inverted polygon method.






          share|improve this answer























          • That looks a bit long-winded for general use, but possibly useful in some instances... thanks.

            – Spacedman
            2 days ago











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "79"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317382%2fmasking-layers-by-a-vector-polygon-layer-in-qgis%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5














          You can put the colored polygons on top, with a layer blending mode set to darken



          Below, have the building layer with the polygon fill in white.



          At the bottom, add a new layer containing one large black polygon.




          enter image description here



          Without the black background:



          enter image description here






          share|improve this answer























          • Bingo. Polygons on top just didn't occur to me! I can use my virtual bounding box layer as the black background.

            – Spacedman
            2 days ago















          5














          You can put the colored polygons on top, with a layer blending mode set to darken



          Below, have the building layer with the polygon fill in white.



          At the bottom, add a new layer containing one large black polygon.




          enter image description here



          Without the black background:



          enter image description here






          share|improve this answer























          • Bingo. Polygons on top just didn't occur to me! I can use my virtual bounding box layer as the black background.

            – Spacedman
            2 days ago













          5












          5








          5







          You can put the colored polygons on top, with a layer blending mode set to darken



          Below, have the building layer with the polygon fill in white.



          At the bottom, add a new layer containing one large black polygon.




          enter image description here



          Without the black background:



          enter image description here






          share|improve this answer













          You can put the colored polygons on top, with a layer blending mode set to darken



          Below, have the building layer with the polygon fill in white.



          At the bottom, add a new layer containing one large black polygon.




          enter image description here



          Without the black background:



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          JGHJGH

          13.5k21139




          13.5k21139












          • Bingo. Polygons on top just didn't occur to me! I can use my virtual bounding box layer as the black background.

            – Spacedman
            2 days ago

















          • Bingo. Polygons on top just didn't occur to me! I can use my virtual bounding box layer as the black background.

            – Spacedman
            2 days ago
















          Bingo. Polygons on top just didn't occur to me! I can use my virtual bounding box layer as the black background.

          – Spacedman
          2 days ago





          Bingo. Polygons on top just didn't occur to me! I can use my virtual bounding box layer as the black background.

          – Spacedman
          2 days ago













          2














          Here's an alternate method for coloring the colored buildings to match the underlying zones.



          With Geometry Generator styling, create a separate symbol layer of buildings that intersect each of the zones.



          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 1)))
          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 2)))
          etc.


          enter image description here



          Change the color of each symbol layer to match the zone color. Create a black background, eg by setting the map canvas background color to black, or by changing the zone layer style to black-filled simple polygons.



          enter image description here



          Disclaimer: My test dataset was very small, so I have no idea if this will render faster than the inverted polygon method.






          share|improve this answer























          • That looks a bit long-winded for general use, but possibly useful in some instances... thanks.

            – Spacedman
            2 days ago















          2














          Here's an alternate method for coloring the colored buildings to match the underlying zones.



          With Geometry Generator styling, create a separate symbol layer of buildings that intersect each of the zones.



          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 1)))
          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 2)))
          etc.


          enter image description here



          Change the color of each symbol layer to match the zone color. Create a black background, eg by setting the map canvas background color to black, or by changing the zone layer style to black-filled simple polygons.



          enter image description here



          Disclaimer: My test dataset was very small, so I have no idea if this will render faster than the inverted polygon method.






          share|improve this answer























          • That looks a bit long-winded for general use, but possibly useful in some instances... thanks.

            – Spacedman
            2 days ago













          2












          2








          2







          Here's an alternate method for coloring the colored buildings to match the underlying zones.



          With Geometry Generator styling, create a separate symbol layer of buildings that intersect each of the zones.



          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 1)))
          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 2)))
          etc.


          enter image description here



          Change the color of each symbol layer to match the zone color. Create a black background, eg by setting the map canvas background color to black, or by changing the zone layer style to black-filled simple polygons.



          enter image description here



          Disclaimer: My test dataset was very small, so I have no idea if this will render faster than the inverted polygon method.






          share|improve this answer













          Here's an alternate method for coloring the colored buildings to match the underlying zones.



          With Geometry Generator styling, create a separate symbol layer of buildings that intersect each of the zones.



          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 1)))
          intersection($geometry, geometry(get_feature( 'zones', 'zoneNo', 2)))
          etc.


          enter image description here



          Change the color of each symbol layer to match the zone color. Create a black background, eg by setting the map canvas background color to black, or by changing the zone layer style to black-filled simple polygons.



          enter image description here



          Disclaimer: My test dataset was very small, so I have no idea if this will render faster than the inverted polygon method.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          cskcsk

          9,6301035




          9,6301035












          • That looks a bit long-winded for general use, but possibly useful in some instances... thanks.

            – Spacedman
            2 days ago

















          • That looks a bit long-winded for general use, but possibly useful in some instances... thanks.

            – Spacedman
            2 days ago
















          That looks a bit long-winded for general use, but possibly useful in some instances... thanks.

          – Spacedman
          2 days ago





          That looks a bit long-winded for general use, but possibly useful in some instances... thanks.

          – Spacedman
          2 days ago

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317382%2fmasking-layers-by-a-vector-polygon-layer-in-qgis%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

          Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

          Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020